Skip to content

Package: ChangeBroker_ITest

ChangeBroker_ITest

nameinstructionbranchcomplexitylinemethod
ChangeBroker_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%
testServiceAvailable()
M: 0 C: 29
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 8
100%
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: * jfaltermeier - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.changebroker.test;
15:
16: import static org.junit.Assert.assertNotNull;
17: import static org.junit.Assert.assertTrue;
18:
19: import org.eclipse.emf.ecp.changebroker.internal.ChangeBrokerImpl;
20: import org.eclipse.emf.ecp.changebroker.spi.ChangeBroker;
21: import org.junit.Test;
22: import org.osgi.framework.BundleContext;
23: import org.osgi.framework.FrameworkUtil;
24: import org.osgi.framework.ServiceReference;
25:
26: public class ChangeBroker_ITest {
27:
28:         @Test
29:         public void testServiceAvailable() {
30:                 final BundleContext bundleContext = FrameworkUtil.getBundle(this.getClass()).getBundleContext();
31:                 final ServiceReference<ChangeBroker> serviceReference = bundleContext.getServiceReference(ChangeBroker.class);
32:                 assertNotNull("Null service reference", serviceReference); //$NON-NLS-1$
33:                 final ChangeBroker service = bundleContext.getService(serviceReference);
34:                 assertNotNull("ChangeBroker is null", service); //$NON-NLS-1$
35:                 assertTrue(ChangeBrokerImpl.class.isInstance(service));
36:                 bundleContext.ungetService(serviceReference);
37:         }
38:
39: }