EMMA Coverage Report (generated Sun Feb 05 10:43:15 CET 2012)
[all classes][de.uka.ipd.sdq.pcm.gmf.resource.helper]

COVERAGE SUMMARY FOR SOURCE FILE [AddLatencyAndThroughputRecordingCommand.java]

nameclass, %method, %block, %line, %
AddLatencyAndThroughputRecordingCommand.java0%   (0/1)0%   (0/3)0%   (0/83)0%   (0/30)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class AddLatencyAndThroughputRecordingCommand0%   (0/1)0%   (0/3)0%   (0/83)0%   (0/30)
AddLatencyAndThroughputRecordingCommand (TransactionalEditingDomain): void 0%   (0/1)0%   (0/4)0%   (0/2)
AddLatencyAndThroughputRecordingCommand (TransactionalEditingDomain, Communic... 0%   (0/1)0%   (0/7)0%   (0/3)
doExecute (): void 0%   (0/1)0%   (0/72)0%   (0/25)

1package de.uka.ipd.sdq.pcm.gmf.resource.helper;
2 
3import org.eclipse.emf.transaction.RecordingCommand;
4import org.eclipse.emf.transaction.TransactionalEditingDomain;
5import org.eclipse.gmf.runtime.common.core.command.ICommand;
6import org.eclipse.gmf.runtime.emf.type.core.commands.SetValueCommand;
7import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
8import org.eclipse.jface.dialogs.Dialog;
9import org.eclipse.ui.PlatformUI;
10 
11import de.uka.ipd.sdq.pcm.core.CoreFactory;
12import de.uka.ipd.sdq.pcm.core.PCMRandomVariable;
13import de.uka.ipd.sdq.pcm.dialogs.stoex.StochasticExpressionEditDialog;
14import de.uka.ipd.sdq.pcm.resourceenvironment.CommunicationLinkResourceSpecification;
15import de.uka.ipd.sdq.pcm.resourceenvironment.ResourceenvironmentPackage;
16import de.uka.ipd.sdq.stoex.analyser.visitors.TypeEnum;
17 
18public class AddLatencyAndThroughputRecordingCommand extends RecordingCommand {
19 
20        private CommunicationLinkResourceSpecification communicationLinkResourceSpecification;
21 
22        public AddLatencyAndThroughputRecordingCommand(
23                        TransactionalEditingDomain domain,
24                        CommunicationLinkResourceSpecification communicationLinkResourceSpecification) {
25                super(domain);
26                this.communicationLinkResourceSpecification = communicationLinkResourceSpecification;
27        }
28 
29        private AddLatencyAndThroughputRecordingCommand(
30                        TransactionalEditingDomain domain) {
31                super(domain);
32        }
33 
34        @Override
35        protected void doExecute() {
36                // Throughput
37                PCMRandomVariable rv = CoreFactory.eINSTANCE.createPCMRandomVariable();
38                rv.setSpecification("");
39 
40                StochasticExpressionEditDialog dialog = new StochasticExpressionEditDialog(
41                                PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
42                                TypeEnum.ANY, rv);
43                dialog.open();
44 
45                rv.setSpecification(dialog.getResultText());
46 
47                ICommand cmd = new MySetValueCommand(new SetRequest(communicationLinkResourceSpecification,
48                                ResourceenvironmentPackage.eINSTANCE.getCommunicationLinkResourceSpecification_Throughput_CommunicationLinkResourceSpecification(),
49                                rv));
50                cmd.setLabel("Throughput");
51                
52                // Latency
53                rv = CoreFactory.eINSTANCE.createPCMRandomVariable();
54                rv.setSpecification("");
55 
56                dialog = new StochasticExpressionEditDialog(
57                                PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
58                                TypeEnum.ANY, rv);
59                dialog.open();
60 
61                rv.setSpecification(dialog.getResultText());
62 
63                cmd = new SetValueCommand(
64                                new SetRequest(
65                                                communicationLinkResourceSpecification,
66                                                ResourceenvironmentPackage.eINSTANCE
67                                                                .getCommunicationLinkResourceSpecification_Latency_CommunicationLinkResourceSpecification(),
68                                                rv));
69 
70        }
71 
72}

[all classes][de.uka.ipd.sdq.pcm.gmf.resource.helper]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov