Skip to content

Package: TestFactoryImpl

TestFactoryImpl

nameinstructionbranchcomplexitylinemethod
TestFactoryImpl()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
create(EClass)
M: 32 C: 0
0%
M: 6 C: 0
0%
M: 6 C: 0
0%
M: 7 C: 0
0%
M: 1 C: 0
0%
createBase()
M: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
createTest1()
M: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
createTest2()
M: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
createTest3()
M: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
createTest4()
M: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
getPackage()
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getTestPackage()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
init()
M: 6 C: 11
65%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 3 C: 4
57%
M: 0 C: 1
100%

Coverage

1: /**
2: * Copyright (c) 2011-2015 EclipseSource Muenchen GmbH and others.
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License 2.0
6: * which accompanies this distribution, and is available at
7: * https://www.eclipse.org/legal/epl-2.0/
8: *
9: * SPDX-License-Identifier: EPL-2.0
10: *
11: * Contributors:
12: * Johannes Faltermeier - initial API and implementation
13: */
14: package org.eclipse.emf.ecp.common.test.model.impl;
15:
16: import org.eclipse.emf.ecore.EClass;
17: import org.eclipse.emf.ecore.EObject;
18: import org.eclipse.emf.ecore.EPackage;
19: import org.eclipse.emf.ecore.impl.EFactoryImpl;
20: import org.eclipse.emf.ecore.plugin.EcorePlugin;
21: import org.eclipse.emf.ecp.common.test.model.Base;
22: import org.eclipse.emf.ecp.common.test.model.Test1;
23: import org.eclipse.emf.ecp.common.test.model.Test2;
24: import org.eclipse.emf.ecp.common.test.model.Test3;
25: import org.eclipse.emf.ecp.common.test.model.Test4;
26: import org.eclipse.emf.ecp.common.test.model.TestFactory;
27: import org.eclipse.emf.ecp.common.test.model.TestPackage;
28:
29: /**
30: * <!-- begin-user-doc -->
31: * An implementation of the model <b>Factory</b>.
32: * <!-- end-user-doc -->
33: *
34: * @generated
35: */
36: public class TestFactoryImpl extends EFactoryImpl implements TestFactory {
37:         /**
38:          * Creates the default factory implementation.
39:          * <!-- begin-user-doc -->
40:          * <!-- end-user-doc -->
41:          *
42:          * @generated
43:          */
44:         public static TestFactory init() {
45:                 try {
46:                         final TestFactory theTestFactory = (TestFactory) EPackage.Registry.INSTANCE
47:                                 .getEFactory(TestPackage.eNS_URI);
48:•                        if (theTestFactory != null) {
49:                                 return theTestFactory;
50:                         }
51:                 } catch (final Exception exception) {
52:                         EcorePlugin.INSTANCE.log(exception);
53:                 }
54:                 return new TestFactoryImpl();
55:         }
56:
57:         /**
58:          * Creates an instance of the factory.
59:          * <!-- begin-user-doc -->
60:          * <!-- end-user-doc -->
61:          *
62:          * @generated
63:          */
64:         public TestFactoryImpl() {
65:                 super();
66:         }
67:
68:         /**
69:          * <!-- begin-user-doc -->
70:          * <!-- end-user-doc -->
71:          *
72:          * @generated
73:          */
74:         @Override
75:         public EObject create(EClass eClass) {
76:•                switch (eClass.getClassifierID()) {
77:                 case TestPackage.BASE:
78:                         return createBase();
79:                 case TestPackage.TEST1:
80:                         return createTest1();
81:                 case TestPackage.TEST2:
82:                         return createTest2();
83:                 case TestPackage.TEST3:
84:                         return createTest3();
85:                 case TestPackage.TEST4:
86:                         return createTest4();
87:                 default:
88:                         throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$
89:                 }
90:         }
91:
92:         /**
93:          * <!-- begin-user-doc -->
94:          * <!-- end-user-doc -->
95:          *
96:          * @generated
97:          */
98:         @Override
99:         public Base createBase() {
100:                 final BaseImpl base = new BaseImpl();
101:                 return base;
102:         }
103:
104:         /**
105:          * <!-- begin-user-doc -->
106:          * <!-- end-user-doc -->
107:          *
108:          * @generated
109:          */
110:         @Override
111:         public Test1 createTest1() {
112:                 final Test1Impl test1 = new Test1Impl();
113:                 return test1;
114:         }
115:
116:         /**
117:          * <!-- begin-user-doc -->
118:          * <!-- end-user-doc -->
119:          *
120:          * @generated
121:          */
122:         @Override
123:         public Test2 createTest2() {
124:                 final Test2Impl test2 = new Test2Impl();
125:                 return test2;
126:         }
127:
128:         /**
129:          * <!-- begin-user-doc -->
130:          * <!-- end-user-doc -->
131:          *
132:          * @generated
133:          */
134:         @Override
135:         public Test3 createTest3() {
136:                 final Test3Impl test3 = new Test3Impl();
137:                 return test3;
138:         }
139:
140:         /**
141:          * <!-- begin-user-doc -->
142:          * <!-- end-user-doc -->
143:          *
144:          * @generated
145:          */
146:         @Override
147:         public Test4 createTest4() {
148:                 final Test4Impl test4 = new Test4Impl();
149:                 return test4;
150:         }
151:
152:         /**
153:          * <!-- begin-user-doc -->
154:          * <!-- end-user-doc -->
155:          *
156:          * @generated
157:          */
158:         @Override
159:         public TestPackage getTestPackage() {
160:                 return (TestPackage) getEPackage();
161:         }
162:
163:         /**
164:          * <!-- begin-user-doc -->
165:          * <!-- end-user-doc -->
166:          *
167:          * @deprecated
168:          * @generated
169:          */
170:         @Deprecated
171:         public static TestPackage getPackage() {
172:                 return TestPackage.eINSTANCE;
173:         }
174:
175: } // TestFactoryImpl