Package mock.org.osgi.framework

Examples of mock.org.osgi.framework.FilterMock


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

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

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

        // =====================================================================
        //   Set Expectations
        // =====================================================================

        contextMock.expects
                .createFilter(
                        "(|(objectClass=org.osgi.service.cm.ManagedService)" +
                                "(objectClass=org.osgi.service.cm.ManagedServiceFactory)" +
                                "(objectClass=org.osgi.service.cm.ConfigurationPlugin))")
                .returns(filterMock);

        contextMock.fuzzy.addServiceListener(mockFactory.expectsInstanceOf(
                ServiceListener.class), null).does(new MethodAction() {
            public Object perform(MethodActionEvent event) throws Throwable {
                trackerListener = (ServiceListener)
                        event.getArgument(ServiceListener.class);
                return null;
            }
        });

        contextMock.expects.getServiceReferences(null, filterMock.toString())
                .returns(null);

        filterMock.expects.match(referenceMock).returns(true).any();

        ConfigurationServiceTracker tracker = new ConfigurationServiceTracker(
View Full Code Here


    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.FilterMock

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.