Skip to content

Package: MappingSegmentConverter_ITest

MappingSegmentConverter_ITest

nameinstructionbranchcomplexitylinemethod
MappingSegmentConverter_ITest()
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: 13
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 4
100%
M: 0 C: 1
100%
setUpBeforeClass()
M: 0 C: 5
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
tearDown()
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%
testServiceType()
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%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2018 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: * Lucas Koehler - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emfforms.internal.core.services.segments.mapping;
15:
16: import static org.junit.Assert.assertTrue;
17:
18: import org.eclipse.emfforms.spi.core.services.databinding.emf.DomainModelReferenceSegmentConverterEMF;
19: import org.junit.After;
20: import org.junit.Before;
21: import org.junit.BeforeClass;
22: import org.junit.Test;
23: import org.osgi.framework.BundleContext;
24: import org.osgi.framework.FrameworkUtil;
25: import org.osgi.framework.ServiceReference;
26:
27: /**
28: * JUnit integration tests for {@link MappingSegmentConverter}.
29: *
30: * @author Lucas Koehler
31: *
32: */
33: public class MappingSegmentConverter_ITest {
34:
35:         private static BundleContext bundleContext;
36:         private DomainModelReferenceSegmentConverterEMF service;
37:         private ServiceReference<DomainModelReferenceSegmentConverterEMF> serviceReference;
38:
39:         @BeforeClass
40:         public static void setUpBeforeClass() {
41:                 bundleContext = FrameworkUtil.getBundle(MappingSegmentConverter_ITest.class)
42:                         .getBundleContext();
43:         }
44:
45:         @Before
46:         public void setUp() {
47:                 serviceReference = bundleContext
48:                         .getServiceReference(DomainModelReferenceSegmentConverterEMF.class);
49:                 service = bundleContext.getService(serviceReference);
50:         }
51:
52:         @After
53:         public void tearDown() {
54:                 bundleContext.ungetService(serviceReference);
55:         }
56:
57:         @Test
58:         public void testServiceType() {
59:                 assertTrue(MappingSegmentConverter.class.isInstance(service));
60:
61:         }
62:
63: }