Package mock.org.osgi.framework

Examples of mock.org.osgi.framework.BundleContextMock


        // Prepare the mock of OSGI environment
        ComponentContextMock componentCtx
                = new ComponentContextMock("componentCtx", expectations);

        BundleContextMock bundleCtx = new BundleContextMock("bundleCtx", expectations);
        componentCtx.expects.getBundleContext()
                    .returns(bundleCtx).any();
        bundleCtx.expects.getProperty(BootConstants.CONTEXT_AREA)
                 .returns(contextArea).any();
View Full Code Here


        // =====================================================================
        //   Create Mocks
        // =====================================================================

        final BundleContextMock bundleContextMock =
                new BundleContextMock("bundleContextMock", expectations);

        // =====================================================================
        //   Set Expectations
        // =====================================================================
View Full Code Here

        // =====================================================================
        //   Create Mocks
        // =====================================================================

        final BundleContextMock bundleContextMock =
                new BundleContextMock("bundleContextMock", expectations);

        // =====================================================================
        //   Set Expectations
        // =====================================================================
View Full Code Here

                new DelayedReferenceContainer();
        referenceContainer.setReference(adminServiceReferenceMock);

        // Create a bundle context that can be used across thread. This can
        // also be used to add expectations for the current thread.
        contextMock = new BundleContextMock("contextMock",
                perThreadExpectations);

        listenerReferenceMock =
                new ServiceReferenceMock("listenerReferenceMock",
                        dispatcherExpectations);
View Full Code Here

        // =====================================================================
        //   Create Mocks
        // =====================================================================

        contextMock = new BundleContextMock("contextMock", expectations);
        managerMock = new ConfigurationManagerMock("managerMock",
                expectations);
        pluginManagerMock = new PluginManagerMock(
                "pluginManagerMock", expectations);
View Full Code Here

        storeMock = new ConfigurationStoreMock("storeMock",
                expectations);

        storeMock.expects.load().returns(null).any();

        contextMock = new BundleContextMock("contextMock", expectations);

        pluginManagerMock = new PluginManagerMock(
                "pluginManagerMock", expectations);

        logServiceMock = new LogServiceMock("logServiceMock", expectations);
View Full Code Here

    /**
     * Tests that all the mock objects can be initialised correctly.
     */
    public void testInitialisation() {
        new BundleMock("bundleMock", expectations);
        new BundleContextMock("bundleContextMock", expectations);
        new ServiceReferenceMock("serviceReferenceMock", expectations);
        new ServiceRegistrationMock("serviceRegistrationMock", expectations);
        new FilterMock("filterMock", expectations);
    }
View Full Code Here

     *
     * @return the ManagedServiceFactory to test.
     */
    public ManagedServiceFactory createManagedServiceFactory() throws NoSuchMethodException {

        final BundleContextMock contextMock =
            new BundleContextMock("contextMock", expectations);
        final MockFactory mockFactory = MockFactory.getDefaultInstance();
        final Method registerServiceMethod = BundleContext.class.getMethod(
            "registerService",
            new Class[]{String.class, Object.class, Dictionary.class});
        final MethodIdentifier identifier =
View Full Code Here

TOP

Related Classes of mock.org.osgi.framework.BundleContextMock

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.