Skip to content

Package: DomainModelReference_Test

DomainModelReference_Test

nameinstructionbranchcomplexitylinemethod
DomainModelReference_Test()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
setUp()
M: 0 C: 1
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
testFeaturePathDomainModelReferencePathWithNonUniqueReferences()
M: 0 C: 46
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 13
100%
M: 0 C: 1
100%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2014-2019 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: * Eugen Neufeld - initial API and implementation
13: * Christian W. Damus - bug 543160
14: ******************************************************************************/
15: package org.eclipse.emf.ecp.view.model.test;
16:
17: import static org.junit.Assert.assertEquals;
18:
19: import java.util.LinkedList;
20:
21: import org.eclipse.emf.ecore.EReference;
22: import org.eclipse.emf.ecore.EcoreFactory;
23: import org.eclipse.emf.ecp.view.spi.model.VControl;
24: import org.eclipse.emf.ecp.view.spi.model.VFeaturePathDomainModelReference;
25: import org.eclipse.emf.ecp.view.spi.model.VViewFactory;
26: import org.junit.Before;
27: import org.junit.Test;
28:
29: public class DomainModelReference_Test {
30:
31:         @Before
32:         public void setUp() throws Exception {
33:
34:         }
35:
36:         @Test
37:         public void testFeaturePathDomainModelReferencePathWithNonUniqueReferences() {
38:                 final VControl control = VViewFactory.eINSTANCE.createControl();
39:                 final LinkedList<EReference> referencePath = new LinkedList<EReference>();
40:                 final EReference ref1 = EcoreFactory.eINSTANCE.createEReference();
41:                 final EReference ref2 = EcoreFactory.eINSTANCE.createEReference();
42:                 referencePath.add(ref1);
43:                 referencePath.add(ref2);
44:                 referencePath.add(ref1);
45:                 final EReference feature = EcoreFactory.eINSTANCE.createEReference();
46:                 control.setDomainModelReference(feature, referencePath);
47:                 assertEquals(3, referencePath.size());
48:                 assertEquals(3, ((VFeaturePathDomainModelReference) control.getDomainModelReference())
49:                         .getDomainModelEReferencePath().size());
50:
51:         }
52:
53: }