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

Examples of org.apache.felix.dm.test.components.Ensure


    /**
     * Test an AdapterService which provides its interface using a @ServiceLifecycle.
     */
    @Test
    public void testAdapterServiceWithPublisher() {
        Ensure e = new Ensure();
        ServiceRegistration sr = register(e, AdapterServiceTestWithPublisher.ENSURE);
        e.waitForStep(6, 10000);
        sr.unregister();
    }
View Full Code Here


    /**
     * Test a BundleAdapterService which provides its interface using a @ServiceLifecycle.
     */
    @Test
    public void testBundleAdapterServiceWithPublisher() {
        Ensure e = new Ensure();
        ServiceRegistration sr = register(e, BundleAdapterServiceTestWithPublisher.ENSURE);
        e.waitForStep(5, 10000);
        sr.unregister();
    }
View Full Code Here

    /**
     * Test a ResourceAdapterService which provides its interface using a @ServiceLifecycle.
     */
    @Test
    public void TestResourceAdapterServiceWithPublisher() {
        Ensure e = new Ensure();
        ServiceRegistration sr = register(e, ResourceAdapterServiceTestWithPublisher.ENSURE);
        e.waitForStep(5, 10000);
        sr.unregister();
    }
View Full Code Here

    /**
     * Test a FactoryConfigurationAdapterService which provides its interface using a @ServiceLifecycle.
     */
    @Test
    public void testFactoryAdapterServiceWithPublisher() {
        Ensure e = new Ensure();
        ServiceRegistration sr = register(e, FactoryConfigurationAdapterServiceTestWithPublisher.ENSURE);
        e.waitForStep(5, 10000);
        sr.unregister();
    }
View Full Code Here

        super(true /* start test components bundle */);
    }

    @Test
    public void testSimpleAnnotations() throws Throwable {
        Ensure e = new Ensure();
        ServiceRegistration er = register(e, Producer.ENSURE);
        e.waitForStep(3, 10000); // Producer registered
        ServiceRegistration er2 = register(e, Consumer.ENSURE);

        er2.unregister(); // stop consumer
        er.unregister(); // stop provider

        // And check if components have been deactivated orderly.
        e.waitForStep(10, 10000);
        e.ensure();
        stopTestBundle();
    }
View Full Code Here

     * Tests a simple ResourceConsumer
     * @param context
     */
    @Test
    public void testResourceAnnotation() {
        Ensure e = new Ensure();
        ServiceRegistration sr = register(e, ResourceAnnotation.ENSURE_RESOURCE);
        ServiceRegistration sr2 = register(e, ResourceAnnotation.ENSURE_PROVIDER);
        stopTestBundle();
        e.waitForStep(1, 10000);
        sr.unregister();
        sr2.unregister();
    }
View Full Code Here

    /**
     * Tests a simple ResourceConsumer using a class field for resource injection
     */
    @Test
    public void testResourceAnnotationAutoConfig() {
        Ensure e = new Ensure();
        ServiceRegistration sr = register(e, ResourceAnnotation.ENSURE_FIELD);
        ServiceRegistration sr2 = register(e, ResourceAnnotation.ENSURE_PROVIDER);
        stopTestBundle();
        e.waitForStep(1, 10000);
        sr.unregister();
        sr2.unregister();
    }
View Full Code Here

      * Tests a ResourceAdapter
      * @param context
      */
    @Test
    public void testResourceAdapterAnnotation() throws Throwable {
        Ensure e = new Ensure();
        ServiceRegistration sr = register(e, ResourceAnnotation.ENSURE_ADAPTER);
        ServiceRegistration sr2 = register(e, ResourceAnnotation.ENSURE_PROVIDER);
        stopTestBundle();
        e.waitForStep(2, 10000);
        e.ensure();
        sr.unregister();
        sr2.unregister();
    }
View Full Code Here

        super(true /* start test components bundle */);
    }

    @Test
    public void testMultipleAnnotations() {
        Ensure e = new Ensure();
        ServiceRegistration sr = register(e, MultipleAnnotations.ENSURE);
        e.waitForStep(7, 10000);
        stopTestBundle();
        // And check if the test.annotation bundle has been deactivated orderly
        e.waitForStep(11, 10000);
        sr.unregister();
    }
View Full Code Here

    /**
     * Tests a simple Consumer, which has a BundleDependency over the dependency manager bundle.
     */
    @Test
    public void testBundleDependencyAnnotation() {
        Ensure e = new Ensure();
        ServiceRegistration sr = register(e, BundleDependencyAnnotation.ENSURE_CONSUMER);
        e.waitForStep(1, 10000);
        stopTestBundle();
        e.waitForStep(2, 10000);
        sr.unregister();
    }
View Full Code Here

TOP

Related Classes of org.apache.felix.dm.test.components.Ensure

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.