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

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


       
        // remove the service again, the component still has an instance bound
        // dependency on it, so stop() should be invoked, but the component
        // should not be destroyed
        m.remove(component2);
        e.step(15);
        Assert.assertNull("service should no longer be available", st.getService());
        component.remove(dependency2);
        Assert.assertNotNull("service should be available", st.getService());
        m.remove(component);
        e.step(19);
View Full Code Here


        e.step(15);
        Assert.assertNull("service should no longer be available", st.getService());
        component.remove(dependency2);
        Assert.assertNotNull("service should be available", st.getService());
        m.remove(component);
        e.step(19);
    }
   
    public static class MyComponent implements MyService2 {
        private final Ensure m_ensure;
        private final Ensure.Steps m_initSteps = new Ensure.Steps(1, 5);
View Full Code Here

        e.waitForStep(2, 15000);
        // and remove it again (this should not affect the consumer yet)
        m.remove(sp);
        // now add the second provider
        m.add(sp2);
        e.step(3);
        e.waitForStep(4, 15000);
        // and remove it again
        m.remove(sp2);
        // finally remove the consumer
        m.remove(sc);
View Full Code Here

        // and remove it again
        m.remove(sp2);
        // finally remove the consumer
        m.remove(sc);
        // ensure we executed all steps inside the component instance
        e.step(6);
    }

    static interface TemporalServiceInterface {
        public void invoke();
    }
View Full Code Here

        e.waitForStep(4, 15000);
        m.remove(s1);
        m.remove(s2);
        m.remove(s3);
        // ensure we executed all steps inside the component instance
        e.step(5);
    }
   
    @Test
    public void testFELIX2987() {
        // mimics testComponentWithRequiredConfigurationAndServicePropertyPropagation
View Full Code Here

        e.waitForStep(4, 15000);
        m.remove(s1);
        m.remove(s2);
        m.remove(s3);
        // ensure we executed all steps inside the component instance
        e.step(5);
    }


    static class ConfigurationCreator {
        private volatile ConfigurationAdmin m_ca;
View Full Code Here

        // helper class that ensures certain steps get executed in sequence
        Ensure e = new Ensure();
        Component consumerWithFilter = m.createComponent().setImplementation(new FilteredConsumer(e)).add(m.createBundleDependency().setFilter("(Bundle-SymbolicName=org.apache.felix.dependencymanager)").setCallbacks("add", "remove"));
        // add a consumer with a filter
        m.add(consumerWithFilter);
        e.step(2);
        // remove the consumer again
        m.remove(consumerWithFilter);
        e.step(4);
    }
   
View Full Code Here

        // add a consumer with a filter
        m.add(consumerWithFilter);
        e.step(2);
        // remove the consumer again
        m.remove(consumerWithFilter);
        e.step(4);
    }
   
    @Test
    public void testRequiredBundleDependency() {
        DependencyManager m = new DependencyManager(context);
View Full Code Here

                                      .setComposition("getComposition")
                                      .add(m.createServiceDependency().setService(ServiceInterface.class).setRequired(true).setCallbacks("add", null));
        m.add(sp);
        m.add(sc);
        // ensure we executed all steps inside the component instance
        e.step(6);
        m.clear();
    }
   
    static interface ServiceInterface {
        public void invoke();
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.