Package org.apache.felix.dm.test.components

Examples of org.apache.felix.dm.test.components.Ensure.step()


        // add it, and since it has no dependencies, it should be activated immediately
        m.add(s);
        // remove it so it gets destroyed
        m.remove(s);
        // ensure we executed all steps inside the component instance
        e.step(6);
    }
   
    static class ComponentInstance {
        private final Ensure m_ensure;
        public ComponentInstance(Ensure e) {
View Full Code Here


        Assert.assertEquals("a", c.invoke());
        m.remove(sp);
        // finally removing the original service should give a remove
        e.waitForStep(6, 2000);
        m.remove(sc);
        e.step(7);
    }
   
    @Test
    public void testSingleAspectThatAlreadyExisted() {
        DependencyManager m = new DependencyManager(context);
View Full Code Here

        Assert.assertEquals("aa", c.invoke());
       
        // now the consumer's added should be invoked once, as the aspect is already available and should
        // directly hide the original service
        e.waitForStep(1, 2000);
        e.step(2);

        m.remove(sa);
        // after removing the aspect, the consumer should get the original service back, so
        // remove and add will be invoked
        e.waitForStep(4, 2000);
View Full Code Here

        m.remove(sp);
        // after removing the original service, the consumer's remove should be called once
        e.waitForStep(5, 2000);
       
        m.remove(sc);
        e.step(6);
    }

    @Test
    public void testMultipleAspects() {
        DependencyManager m = new DependencyManager(context);
View Full Code Here

        m.add(sa2);
        m.add(sc);
        // the consumer will monitor progress, it should get it's add invoked twice, once for every
        // (highest) aspect
        e.waitForStep(2, 2000);
        e.step(3);
       
        // now invoke all services the consumer collected
        List<String> list = c.invokeAll();
        // and make sure both of them are correctly invoked
        Assert.assertTrue(list.size() == 2);
View Full Code Here

        Assert.assertTrue(list.contains("bbb"));
       
        m.remove(sc);
        // removing the consumer now should get its removed method invoked twice
        e.waitForStep(5, 2000);
        e.step(6);
        m.remove(sa2);
        m.remove(sa);
        m.remove(sp2);
        m.remove(sp);
        e.step(7);
View Full Code Here

        e.step(6);
        m.remove(sa2);
        m.remove(sa);
        m.remove(sp2);
        m.remove(sp);
        e.step(7);
    }
   
    public static interface ServiceInterface {
        public String invoke(String input);
    }
View Full Code Here

            .add(m.createServiceDependency()
                .setService(Object.class)
                .setRequired(true)
            );
        m.add(missing);
        e.step(4);
        e.waitForStep(5, 5000);
        m.remove(missing);
        // now start/stop deploymentadmin, which we use here because it's a bundle that
        // publishes a service that uses the dependency manager (saving us from having to
        // create a bundle that does that on the fly)
View Full Code Here

        // now start/stop deploymentadmin, which we use here because it's a bundle that
        // publishes a service that uses the dependency manager (saving us from having to
        // create a bundle that does that on the fly)
        m_deploymentAdmin.start();
        m_deploymentAdmin.stop();
        e.step(6);
        e.waitForStep(7, 5000);
        e.ensure();
        m.remove(shellClient);
       
    }
View Full Code Here

        // then the resource provider, which will provide 3 resources,
        // 2 of which match the consumers filter conditions
        m.add(resourceProvider);
        // make sure our consumer invoked openStream() on both resources,
        // increasing the step counter to 2
        e.step(3);
       
        // now add another consumer, that matches only one resource, and uses
        // a dynamic proxy as its implementation
        m.add(dynamicProxyConsumer);
        // ensure the resource was injected properly
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.