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

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


        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
View Full Code Here


        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);
       
        Assert.assertEquals("a", c.invoke());
       
        m.remove(sp);
        // after removing the original service, the consumer's remove should be called once
View Full Code Here

       
        Assert.assertEquals("a", c.invoke());
       
        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);
    }
View Full Code Here

        m.add(sa);
        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
View Full Code Here

        Assert.assertTrue(list.contains("aaa"));
        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);
View Full Code Here

        // wait until the single resource is available
        e.waitForStep(3, 5000);
        // trigger a 'change' in our resource
        provider.change();
        // wait until the changed callback is invoked
        e.waitForStep(4, 5000);
        m.clear();
     }
   
    static class ResourceAdapter {
        protected URL m_resource; // injected by reflection.
View Full Code Here

            .add(m.createServiceDependency()
                .setService(CommandProcessor.class)
                .setRequired(true)
            );
        m.add(shellClient);
        e.waitForStep(3, 5000);
        // now create a component with a missing dependency
        Component missing = m.createComponent()
            .setImplementation(new Object() { public String toString() { return "Object"; }})
            .add(m.createServiceDependency()
                .setService(Object.class)
View Full Code Here

                .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)
        m_deploymentAdmin.start();
View Full Code Here

        // 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

             
        m.add(a);
        m.add(c);
        m.add(b);
       
        e.waitForStep(4, 5000);
       
        System.out.println("changing A props ...");
        props = new Hashtable();
        props.put("foo", "bar2");
        a.setServiceProperties(props);
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.