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

COVERAGE SUMMARY FOR SOURCE FILE [BasicComponentBuilder.java]

nameclass, %method, %block, %line, %
BasicComponentBuilder.java0%   (0/1)0%   (0/5)0%   (0/115)0%   (0/25)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class BasicComponentBuilder0%   (0/1)0%   (0/5)0%   (0/115)0%   (0/25)
BasicComponentBuilder (PCMAndCompletionModelHolder, OperationInterface, Opera... 0%   (0/1)0%   (0/14)0%   (0/5)
BasicComponentBuilder (PCMAndCompletionModelHolder, OperationInterface, Resou... 0%   (0/1)0%   (0/8)0%   (0/2)
build (): void 0%   (0/1)0%   (0/72)0%   (0/14)
createComponent (String): RepositoryComponent 0%   (0/1)0%   (0/17)0%   (0/3)
getBasicComponent (): BasicComponent 0%   (0/1)0%   (0/4)0%   (0/1)

1package de.uka.ipd.sdq.pcm.transformations.builder.abstractbuilder;
2 
3import de.uka.ipd.sdq.pcm.allocation.AllocationContext;
4import de.uka.ipd.sdq.pcm.allocation.AllocationFactory;
5import de.uka.ipd.sdq.pcm.core.composition.CompositionFactory;
6import de.uka.ipd.sdq.pcm.repository.BasicComponent;
7import de.uka.ipd.sdq.pcm.repository.Interface;
8import de.uka.ipd.sdq.pcm.repository.OperationInterface;
9import de.uka.ipd.sdq.pcm.repository.RepositoryComponent;
10import de.uka.ipd.sdq.pcm.repository.RepositoryFactory;
11import de.uka.ipd.sdq.pcm.resourceenvironment.ResourceContainer;
12import de.uka.ipd.sdq.pcm.transformations.builder.seff.DelegatorComponentSeffBuilder;
13import de.uka.ipd.sdq.pcm.transformations.builder.seff.ISeffBuilder;
14import de.uka.ipd.sdq.pcm.transformations.builder.util.PCMAndCompletionModelHolder;
15 
16/**
17 * A builder for creating basic components and their assembly and allocation context. The component has a single provided and required interface which
18 * can be optionally the same (usefull if used with a delegating seff builder).
19 * @author   Snowball
20 */
21public abstract class BasicComponentBuilder
22extends AbstractComponentBuilder {
23 
24        protected DelegatorComponentSeffBuilder seffBuilder;
25        private OperationInterface providedOperationInterface;
26        private OperationInterface requiredOperationInterface;
27        private AllocationContext myAllocationContext;
28        protected ResourceContainer container;
29 
30        public BasicComponentBuilder(
31                        PCMAndCompletionModelHolder models,
32                        OperationInterface interf,
33                        ResourceContainer container, 
34                        String componentName) {
35                this(models,interf,interf,container,componentName);
36        }
37        
38        public BasicComponentBuilder(
39                        PCMAndCompletionModelHolder models,
40                        OperationInterface providedIf,
41                        OperationInterface requiredIf,
42                        ResourceContainer container,
43                        String componentName) {
44                super(models, componentName);
45                this.providedOperationInterface = providedIf;
46                this.requiredOperationInterface = requiredIf;
47                this.container = container;
48        }
49 
50        protected abstract ISeffBuilder getSeffBuilder();
51        
52        @Override
53        public void build() {
54                super.build();
55                
56                myOperationProvidedRole = addOperationProvidedRole(providedOperationInterface,"ProvidedRole");
57                myOperationRequiredRole = addOperationRequiredRole(requiredOperationInterface,"RequiredRole");
58 
59                ISeffBuilder seffBuilder = this.getSeffBuilder();
60                seffBuilder.build();
61                getBasicComponent().getServiceEffectSpecifications__BasicComponent().addAll(seffBuilder.getSeffs());
62                
63                this.myAssemblyContext = CompositionFactory.eINSTANCE.createAssemblyContext();
64                this.myAssemblyContext.setEntityName("BCAssembly "+myComponent.getEntityName());
65                this.myAssemblyContext.setEncapsulatedComponent__AssemblyContext(myComponent);
66 
67                this.myAllocationContext = AllocationFactory.eINSTANCE.createAllocationContext();
68                myAllocationContext.setAssemblyContext_AllocationContext(myAssemblyContext);
69                myAllocationContext.setResourceContainer_AllocationContext(this.container);
70                
71                myModels.getAllocation().getAllocationContexts_Allocation().add(myAllocationContext);
72        }
73        
74        protected BasicComponent getBasicComponent() {
75                return (BasicComponent)myComponent;
76        }
77 
78        @Override
79        protected RepositoryComponent createComponent(String componentName) {
80                BasicComponent bc = RepositoryFactory.eINSTANCE.createBasicComponent();
81                bc.setEntityName("InnerBasicComponent_"+componentName+getNextCounter());
82                return bc;
83        }
84        
85}

[all classes][de.uka.ipd.sdq.pcm.transformations.builder.abstractbuilder]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov