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: 26 C: 0
0%
M: 4 C: 0
0%
M: 4 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
createComponent()
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
createComponent2()
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
createComposite()
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
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-2013 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: * EclipseSource Muenchen GmbH - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.ui.view.editor.test.model.test.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.ui.view.editor.test.model.test.Component;
22: import org.eclipse.emf.ecp.ui.view.editor.test.model.test.Component2;
23: import org.eclipse.emf.ecp.ui.view.editor.test.model.test.Composite;
24: import org.eclipse.emf.ecp.ui.view.editor.test.model.test.TestFactory;
25: import org.eclipse.emf.ecp.ui.view.editor.test.model.test.TestPackage;
26:
27: /**
28: * <!-- begin-user-doc -->
29: * An implementation of the model <b>Factory</b>.
30: * <!-- end-user-doc -->
31: *
32: * @generated
33: */
34: public class TestFactoryImpl extends EFactoryImpl implements TestFactory {
35:         /**
36:          * Creates the default factory implementation.
37:          * <!-- begin-user-doc -->
38:          * <!-- end-user-doc -->
39:          *
40:          * @generated
41:          */
42:         public static TestFactory init() {
43:                 try {
44:                         final TestFactory theTestFactory = (TestFactory) EPackage.Registry.INSTANCE
45:                                 .getEFactory(TestPackage.eNS_URI);
46:•                        if (theTestFactory != null) {
47:                                 return theTestFactory;
48:                         }
49:                 } catch (final Exception exception) {
50:                         EcorePlugin.INSTANCE.log(exception);
51:                 }
52:                 return new TestFactoryImpl();
53:         }
54:
55:         /**
56:          * Creates an instance of the factory.
57:          * <!-- begin-user-doc -->
58:          * <!-- end-user-doc -->
59:          *
60:          * @generated
61:          */
62:         public TestFactoryImpl() {
63:                 super();
64:         }
65:
66:         /**
67:          * <!-- begin-user-doc -->
68:          * <!-- end-user-doc -->
69:          *
70:          * @generated
71:          */
72:         @Override
73:         public EObject create(EClass eClass) {
74:•                switch (eClass.getClassifierID()) {
75:                 case TestPackage.COMPONENT:
76:                         return createComponent();
77:                 case TestPackage.COMPOSITE:
78:                         return createComposite();
79:                 case TestPackage.COMPONENT2:
80:                         return createComponent2();
81:                 default:
82:                         throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
83:                 }
84:         }
85:
86:         /**
87:          * <!-- begin-user-doc -->
88:          * <!-- end-user-doc -->
89:          *
90:          * @generated
91:          */
92:         @Override
93:         public Component createComponent() {
94:                 final ComponentImpl component = new ComponentImpl();
95:                 return component;
96:         }
97:
98:         /**
99:          * <!-- begin-user-doc -->
100:          * <!-- end-user-doc -->
101:          *
102:          * @generated
103:          */
104:         @Override
105:         public Composite createComposite() {
106:                 final CompositeImpl composite = new CompositeImpl();
107:                 return composite;
108:         }
109:
110:         /**
111:          * <!-- begin-user-doc -->
112:          * <!-- end-user-doc -->
113:          *
114:          * @generated
115:          */
116:         @Override
117:         public Component2 createComponent2() {
118:                 final Component2Impl component2 = new Component2Impl();
119:                 return component2;
120:         }
121:
122:         /**
123:          * <!-- begin-user-doc -->
124:          * <!-- end-user-doc -->
125:          *
126:          * @generated
127:          */
128:         @Override
129:         public TestPackage getTestPackage() {
130:                 return (TestPackage) getEPackage();
131:         }
132:
133:         /**
134:          * <!-- begin-user-doc -->
135:          * <!-- end-user-doc -->
136:          *
137:          * @deprecated
138:          * @generated
139:          */
140:         @Deprecated
141:         public static TestPackage getPackage() {
142:                 return TestPackage.eINSTANCE;
143:         }
144:
145: } // TestFactoryImpl