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

COVERAGE SUMMARY FOR SOURCE FILE [ExternalCallActionConfigureCommand.java]

nameclass, %method, %block, %line, %
ExternalCallActionConfigureCommand.java0%   (0/1)0%   (0/4)0%   (0/92)0%   (0/29)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ExternalCallActionConfigureCommand0%   (0/1)0%   (0/4)0%   (0/92)0%   (0/29)
ExternalCallActionConfigureCommand (ConfigureRequest, OperationSignature, Ope... 0%   (0/1)0%   (0/22)0%   (0/8)
doExecuteWithResult (IProgressMonitor, IAdaptable): CommandResult 0%   (0/1)0%   (0/26)0%   (0/10)
setOperationSignatureExternalCallAction (IProgressMonitor, IAdaptable): Comma... 0%   (0/1)0%   (0/22)0%   (0/6)
setRequiredRoleEntryLevelSystemCall (IProgressMonitor, IAdaptable): CommandRe... 0%   (0/1)0%   (0/22)0%   (0/5)

1/**
2 * 
3 */
4package de.uka.ipd.sdq.pcm.gmf.seff.helper;
5 
6import org.eclipse.core.commands.ExecutionException;
7import org.eclipse.core.runtime.IAdaptable;
8import org.eclipse.core.runtime.IProgressMonitor;
9import org.eclipse.gmf.runtime.common.core.command.CommandResult;
10import org.eclipse.gmf.runtime.common.core.command.ICommand;
11import org.eclipse.gmf.runtime.emf.type.core.commands.ConfigureElementCommand;
12import org.eclipse.gmf.runtime.emf.type.core.commands.SetValueCommand;
13import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
14import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
15 
16import de.uka.ipd.sdq.pcm.repository.OperationRequiredRole;
17import de.uka.ipd.sdq.pcm.repository.OperationSignature;
18import de.uka.ipd.sdq.pcm.seff.SeffPackage;
19 
20/**
21 * @author Roman Andrej
22 */
23public class ExternalCallActionConfigureCommand extends ConfigureElementCommand {
24 
25        private ConfigureRequest request = null;
26        private OperationSignature signature = null;
27        private OperationRequiredRole requiredRole = null;
28        
29        public ExternalCallActionConfigureCommand(ConfigureRequest request,
30                        OperationSignature signature, OperationRequiredRole requiredRole) {
31                super(request);
32                this.request = request;
33                this.signature = signature;
34                this.requiredRole = requiredRole;
35        }
36 
37        /* (non-Javadoc)
38         * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
39         */
40        @Override
41        protected CommandResult doExecuteWithResult(IProgressMonitor monitor,
42                        IAdaptable info) throws ExecutionException {
43                CommandResult commandResult = setOperationSignatureExternalCallAction(monitor,
44                                info);
45                if (!isOK(commandResult)) {
46                        return CommandResult
47                                        .newErrorCommandResult("Set OperationSignature for the ExternalCallAction failed!");
48                }
49                commandResult = setRequiredRoleEntryLevelSystemCall(monitor, info);
50                if (!isOK(commandResult)) {
51                        return CommandResult
52                                        .newErrorCommandResult("Set OperationProvidedRole for the ExternalCallAction failed!");
53                }
54                return CommandResult.newOKCommandResult();
55        }
56        
57        
58        private CommandResult setOperationSignatureExternalCallAction(
59                        IProgressMonitor monitor, IAdaptable info)
60                        throws ExecutionException {
61 
62                ICommand cmd = new SetValueCommand(new SetRequest(request
63                                .getElementToConfigure(), SeffPackage.eINSTANCE
64                                .getExternalCallAction_CalledService_ExternalService(),
65                                signature));
66 
67                cmd.execute(monitor, info);
68 
69                return cmd.getCommandResult();
70        }
71        
72        private CommandResult setRequiredRoleEntryLevelSystemCall(
73                        IProgressMonitor monitor, IAdaptable info)
74                        throws ExecutionException {
75 
76                ICommand cmd = new SetValueCommand(new SetRequest(request
77                                .getElementToConfigure(), SeffPackage.eINSTANCE
78                                .getExternalCallAction_Role_ExternalService(), requiredRole));
79 
80                cmd.execute(monitor, info);
81 
82                return cmd.getCommandResult();
83        }
84}

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