Package mock.org.osgi.framework

Examples of mock.org.osgi.framework.ServiceReferenceMock


        // name we do not know.
        perThreadExpectations.addThreadSpecificBuilder(
                dispatcherThread, dispatcherExpectations);

        adminServiceReferenceMock =
                new ServiceReferenceMock("adminServiceReferenceMock");

        DelayedReferenceContainer referenceContainer =
                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);

        listenerMock = new ConfigurationListenerMock(
                "listenerMock", dispatcherExpectations);
View Full Code Here


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

        final ServiceReferenceMock unauthorizedFactoryReferenceMock =
                new ServiceReferenceMock("unauthorizedFactoryReferenceMock",
                        expectations);

        // Create a mock ManagedServiceFactory that is invoked from the
        // dispatcher thread.
        final ManagedServiceFactoryMock unauthorizedManagedFactoryMock =
                new ManagedServiceFactoryMock("unauthorizedManagedFactoryMock",
                        dispatcherExpectations);

        final ServiceReferenceMock attackingFactoryReferenceMock =
                new ServiceReferenceMock("attackingFactoryReferenceMock",
                        expectations);

        // Create a mock ManagedServiceFactory that is invoked from the
        // dispatcher thread.
        final ManagedServiceFactoryMock attackingManagedFactoryMock =
View Full Code Here

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

        final ServiceReferenceMock unauthorizedServiceReferenceMock =
                new ServiceReferenceMock("unauthorizedServiceReferenceMock",
                        expectations);

        // Create a mock ManagedService that is invoked from the
        // dispatcher thread.
        final ManagedServiceMock unauthorizedManagedServiceMock =
                new ManagedServiceMock("unauthorizedManagedServiceMock",
                        dispatcherExpectations);

        final ServiceReferenceMock attackingServiceReferenceMock =
                new ServiceReferenceMock("attackingServiceReferenceMock",
                        expectations);

        // Create a mock ManagedService that is invoked from the
        // dispatcher thread.
        final ManagedServiceMock attackingManagedServiceMock =
View Full Code Here

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

        FilterMock filterMock = new FilterMock("filterMock", expectations);

        referenceMock = new ServiceReferenceMock("referenceMock", expectations);

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

        // Creating a new configuration for a different bundle may check for
        // configure permission but shouldn't care if it does not have it.
        attackingAdmin.createFactoryConfiguration("FACTORY-PID");

        // Bind the factory PID to the unauthorized bundle.
        final ServiceReferenceMock managedServiceFactoryReferenceMock =
                new ServiceReferenceMock("managedServiceFactoryReferenceMock",
                        expectations);

        managedServiceFactoryReferenceMock.expects.getBundle()
                .returns(unauthorizedBundleMock).any();
        managedServiceFactoryReferenceMock.expects
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

TOP

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

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.