Package org.apache.tuscany.core.component.scope

Examples of org.apache.tuscany.core.component.scope.ModuleScopeContainer.start()


*/
public class AtomicComponentWireInvocationTestCase extends TestCase {

    public void testWireResolution() throws NoSuchMethodException {
        ModuleScopeContainer scope = new ModuleScopeContainer(null);
        scope.start();
        Target target = new TargetImpl();
        SystemInboundWire inboundWire = EasyMock.createMock(SystemInboundWire.class);
        EasyMock.expect(inboundWire.getTargetService()).andReturn(target);
        EasyMock.replay(inboundWire);

View Full Code Here


    private Map<String, Member> members;

    public void testProxiedReferenceInjection() throws Exception {
        ScopeContainer scope = new ModuleScopeContainer(null);
        scope.start();
        Map<String, AtomicComponent> contexts =
            MockFactory.createWiredComponents("source", SourceImpl.class, scope,
                members, "target", Target.class, TargetImpl.class, scope);
        AtomicComponent sourceComponent = contexts.get("source");
        Source source = (Source) sourceComponent.getServiceInstance();
View Full Code Here

    /**
     * Tests a basic invocation to a target
     */
    public void testTargetInvocation() throws Exception {
        ModuleScopeContainer scope = new ModuleScopeContainer(null);
        scope.start();
        List<Class<?>> services = new ArrayList<Class<?>>();
        services.add(Greeting.class);
        Map<String, Object> properties = new Hashtable<String,Object>();
        properties.put("greeting","HeyThere");
       
View Full Code Here

    /**
     * Tests a basic invocation down a target wire
     */
    public void testTargetWireInvocation() throws Exception {
        ModuleScopeContainer scope = new ModuleScopeContainer(null);
        scope.start();
        List<Class<?>> services = new ArrayList<Class<?>>();
        services.add(Greeting.class);
        Map<String, Object> properties = new Hashtable<String,Object>();
        properties.put("greeting","HeyThere");
        RubyComponent context = new RubyComponent("source",
View Full Code Here

     * Validates building a wire from an atomic context to an atomic context
     */
    public void testAtomicWireBuild() throws Exception {
        WorkContext work = new WorkContextImpl();
        ScopeContainer scope = new ModuleScopeContainer(work);
        scope.start();

        Connector connector = new ConnectorImpl();
        SystemComponentBuilder builder = new SystemComponentBuilder();

        CompositeComponent parent = new CompositeComponentImpl(null, null, connector, null);
View Full Code Here

     * Validates building a wire from an atomic context to a reference context
     */
    public void testAtomicToReferenceWireBuild() throws Exception {
        WorkContext work = new WorkContextImpl();
        ScopeContainer scope = new ModuleScopeContainer(work);
        scope.start();

        Connector connector = new ConnectorImpl();
        SystemComponentBuilder builder = new SystemComponentBuilder();
        SystemBindingBuilder bindingBuilder = new SystemBindingBuilder();

View Full Code Here

     * Validates building a wire from a service context to an atomic context
     */
    public void testServiceToAtomicWireBuild() throws Exception {
        WorkContext work = new WorkContextImpl();
        ScopeContainer scope = new ModuleScopeContainer(work);
        scope.start();

        ConnectorImpl connector = new ConnectorImpl();
        SystemComponentBuilder builder = new SystemComponentBuilder();
        SystemBindingBuilder bindingBuilder = new SystemBindingBuilder();

View Full Code Here

    }

    protected void setUp() throws Exception {
        super.setUp();
        ModuleScopeContainer moduleScope = new ModuleScopeContainer();
        moduleScope.start();
        deploymentContext = new RootDeploymentContext(null, null, moduleScope, null);

    }
}
View Full Code Here

    /**
     * Tests a module-to-module scoped wire
     */
    public void testModuleToModule() throws Exception {
        ScopeContainer scope = new ModuleScopeContainer(null);
        scope.start();

        Map<String, AtomicComponent> contexts = MockFactory.createWiredComponents("source", SourceImpl.class,
            scope, members, "target", Target.class, TargetImpl.class, scope);
        scope.onEvent(new CompositeStart(this, null));
        AtomicComponent sourceComponent = contexts.get("source");
View Full Code Here

     * Tests a module-to-session scoped wire is setup properly by the runtime
     */
    public void testModuleToSession() throws Exception {
        WorkContext ctx = new WorkContextImpl();
        ScopeContainer moduleScope = new ModuleScopeContainer(ctx);
        moduleScope.start();
        ScopeContainer sessionScope = new HttpSessionScopeContainer(ctx);
        sessionScope.start();

        Map<String, AtomicComponent> contexts = MockFactory.createWiredComponents("source", SourceImpl.class,
            moduleScope, members, "target", Target.class, TargetImpl.class, sessionScope);
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.