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

COVERAGE SUMMARY FOR SOURCE FILE [RoleEditHelperAdvice.java]

nameclass, %method, %block, %line, %
RoleEditHelperAdvice.java0%   (0/1)0%   (0/2)0%   (0/146)0%   (0/38)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class RoleEditHelperAdvice0%   (0/1)0%   (0/2)0%   (0/146)0%   (0/38)
RoleEditHelperAdvice (): void 0%   (0/1)0%   (0/3)0%   (0/1)
getAfterConfigureCommand (ConfigureRequest): ICommand 0%   (0/1)0%   (0/143)0%   (0/37)

1package de.uka.ipd.sdq.pcm.gmf.repository.helper;
2 
3import org.eclipse.gmf.runtime.common.core.command.ICommand;
4import org.eclipse.gmf.runtime.emf.type.core.commands.SetValueCommand;
5import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
6import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelperAdvice;
7import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
8import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
9 
10import de.uka.ipd.sdq.pcm.core.entity.EntityPackage;
11import de.uka.ipd.sdq.pcm.repository.InfrastructureProvidedRole;
12import de.uka.ipd.sdq.pcm.repository.InfrastructureRequiredRole;
13import de.uka.ipd.sdq.pcm.repository.OperationProvidedRole;
14import de.uka.ipd.sdq.pcm.repository.OperationRequiredRole;
15import de.uka.ipd.sdq.pcm.repository.Role;
16 
17public class RoleEditHelperAdvice extends AbstractEditHelperAdvice implements
18                IEditHelperAdvice {
19 
20        @Override
21        protected ICommand getAfterConfigureCommand(ConfigureRequest request) {
22                Role r = (Role) request.getElementToConfigure();
23                String interfaceName = "";
24                String componentName = "";
25                String prefix = "";
26                if (r instanceof OperationProvidedRole) {
27                        OperationProvidedRole pr = (OperationProvidedRole) r;
28                        interfaceName = pr.getProvidedInterface__OperationProvidedRole() == null ? "interface"
29                                        : pr.getProvidedInterface__OperationProvidedRole().getEntityName();
30                        componentName = pr.getProvidingEntity_ProvidedRole() == null ? "component"
31                                        : pr.getProvidingEntity_ProvidedRole().getEntityName();
32                        prefix = "Provided";
33                } else if (r instanceof OperationRequiredRole) {
34                        OperationRequiredRole rr = (OperationRequiredRole) r;
35                        interfaceName = rr.getRequiredInterface__OperationRequiredRole() == null ? "interface"
36                                        : rr.getRequiredInterface__OperationRequiredRole().getEntityName();
37                        componentName = rr.getRequiringEntity_RequiredRole() == null ? "component"
38                                        : rr.getRequiringEntity_RequiredRole().getEntityName();
39                        prefix = "Required";
40                } else if (r instanceof InfrastructureProvidedRole) {
41                        InfrastructureProvidedRole pr = (InfrastructureProvidedRole) r;
42                        interfaceName = pr.getProvidedInterface__InfrastructureProvidedRole() == null ? "infrastructureInterface" 
43                                        : pr.getProvidedInterface__InfrastructureProvidedRole().getEntityName();
44                        componentName = pr.getProvidingEntity_ProvidedRole() == null ? "infrastructureComponent"
45                                        : pr.getProvidingEntity_ProvidedRole().getEntityName();
46                        prefix = "Provided";
47                } else if (r instanceof InfrastructureRequiredRole) {
48                        InfrastructureRequiredRole pr = (InfrastructureRequiredRole) r;
49                        interfaceName = pr
50                                        .getRequiredInterface__InfrastructureRequiredRole() == null ? "infrastructureInterface"
51                                        : pr.getRequiredInterface__InfrastructureRequiredRole().getEntityName();
52                        componentName = pr.getRequiringEntity_RequiredRole() == null ? "infrastructureComponent"
53                                        : pr.getRequiringEntity_RequiredRole().getEntityName();
54                        prefix = "Required";
55                }
56                SetRequest setRequest = new SetRequest(r, EntityPackage.eINSTANCE
57                                .getNamedElement_EntityName(), prefix + "_" + interfaceName + "_"
58                                + componentName);
59                return new SetValueCommand(setRequest);
60        }
61 
62}

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