Package org.knowhowlab.osgi.testing.it.arquillian.simple.bundle

Examples of org.knowhowlab.osgi.testing.it.arquillian.simple.bundle.SimpleService


        BundleContext context = bundle.getBundleContext();
        ServiceReference sref = context.getServiceReference(SimpleService.class.getName());
        assertNotNull("ServiceReference not null", sref);

        // Get the service for the reference
        SimpleService service = (SimpleService) context.getService(sref);
        assertNotNull("Service not null", service);

        // Invoke the service
        int sum = service.sum(1, 2, 3);
        assertEquals(6, sum);

        // Stop the bundle
        bundle.stop();
        assertEquals(Bundle.RESOLVED, bundle.getState());
View Full Code Here


        findBundle(OSGiAssert.getBundleContext(), EXAMPLE_BUNDLE_SYMBOLIC_NAME, Version.emptyVersion).start();
        assertBundleState(Bundle.ACTIVE, EXAMPLE_BUNDLE_SYMBOLIC_NAME, Version.emptyVersion);

        // Get the service reference
        assertServiceAvailable(SimpleService.class);
        SimpleService service = getService(OSGiAssert.getBundleContext(), SimpleService.class);
        // Invoke the service
        int sum = service.sum(1, 2, 3);
        assertEquals(6, sum);

        // Stop the bundle
        findBundle(OSGiAssert.getBundleContext(), EXAMPLE_BUNDLE_SYMBOLIC_NAME, Version.emptyVersion).stop();
        assertBundleState(Bundle.RESOLVED, EXAMPLE_BUNDLE_SYMBOLIC_NAME, Version.emptyVersion);
View Full Code Here

TOP

Related Classes of org.knowhowlab.osgi.testing.it.arquillian.simple.bundle.SimpleService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.