Package org.apache.tuscany.core.runtime

Examples of org.apache.tuscany.core.runtime.RuntimeContext.stop()


        HelloWorldService service1 = (HelloWorldService) child.getContext("target").getInstance(null);
        Assert.assertEquals("foo", service1.hello("foo"));

        child.publish(new RequestEnd(this, id));
        child.publish(new ModuleStop(this));
        runtime.stop();

    }

    protected void setUp() throws Exception {
        super.setUp();
View Full Code Here


        Assert.assertNotNull(source);
        Assert.assertEquals(0, mockInterceptor.getCount());
        Assert.assertEquals("foo", source.hello("foo"));
        Assert.assertEquals(1, mockInterceptor.getCount());
        child.publish(new ModuleStop(this));
        runtime.stop();
    }

}
View Full Code Here

        source.getGenericComponent().getString();
        Assert.assertEquals(1, mockInterceptor.getCount());
        source.getGenericComponent().getString();
        Assert.assertEquals(2, mockInterceptor.getCount());
        child.publish(new ModuleStop(this));
        runtime.stop();
    }

    public void testRefWithSourceInterceptorHandler() throws Exception {
        MockSyncInterceptor mockInterceptor = new MockSyncInterceptor();
        MockInterceptorBuilder interceptorBuilder = new MockInterceptorBuilder(mockInterceptor, true);
View Full Code Here

        Assert.assertEquals(1, mockHandler.getCount());
        source.getGenericComponent().getString();
        Assert.assertEquals(2, mockInterceptor.getCount());
        Assert.assertEquals(2, mockHandler.getCount());
        child.publish(new ModuleStop(this));
        runtime.stop();
    }

    public void testRefWithTargetInterceptorHandler() throws Exception {
        MockSyncInterceptor mockInterceptor = new MockSyncInterceptor();
        MockInterceptorBuilder interceptorBuilder = new MockInterceptorBuilder(mockInterceptor, false);
View Full Code Here

        Assert.assertEquals(1, mockHandler.getCount());
        source.getGenericComponent().getString();
        Assert.assertEquals(2, mockInterceptor.getCount());
        Assert.assertEquals(2, mockHandler.getCount());
        child.publish(new ModuleStop(this));
        runtime.stop();
    }

    public void testRefWithTargetInterceptor() throws Exception {
        MockSyncInterceptor mockInterceptor = new MockSyncInterceptor();
        MockInterceptorBuilder interceptorBuilder = new MockInterceptorBuilder(mockInterceptor, false);
View Full Code Here

        app1a.publish(new ModuleStop(this));
        app1.publish(new ModuleStop(this));
        Source source = (Source) app1a.getContext("source").getInstance(null);
        assertEquals(target, source.getTarget());
        source.getTarget().getString();
        runtime.stop();
    }

    /**
     * Covers the case where a component in app1a requests autowire, which is resolved to service exposed as an entry
     * point on app1b. The entry point is wired to a component in app1b.
View Full Code Here

        Target target = (Target) app1b.getContext("target.ep").getInstance(null);
        assertNotNull(target);
        Source source = (Source) app1a.getContext("source").getInstance(null);
        assertEquals(target, source.getTarget());
        source.getTarget().getString();
        runtime.stop();
    }

    /**
     * Covers the case where a component in system1a requests autowire, which is resolved to an entry point exposed on
     * system2. The entry point is wired to a component in system2.
View Full Code Here

        system1a.publish(new ModuleStart(this));

        Source source = (Source) system1a.getContext("source").getInstance(null);
        assertEquals(target, source.getTarget());
        source.getTarget().getString();
        runtime.stop();
    }

    /**
     * Covers the case where a component in system1a requests autowire, which is resolved to component in its parent,
     * system1.
 
View Full Code Here

        system1a.publish(new ModuleStart(this));

        Source source = (Source) system1a.getContext("source").getInstance(null);
        assertEquals(target, source.getTarget());
        source.getTarget().getString();
        runtime.stop();
    }

    /**
     * Covers the case where a component in system1a requests autowire, which is resolved to component in the parent of
     * its parent (grandparent), system.
View Full Code Here

        system1a.publish(new ModuleStart(this));

        Source source = (Source) system1a.getContext("source").getInstance(null);
        assertEquals(target, source.getTarget());
        source.getTarget().getString();
        runtime.stop();
    }

    private RuntimeContext createScenario1Runtime() throws Exception {
        RuntimeContext runtime = MockFactory.createCoreRuntime();
        runtime.start();
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.