Package org.apache.tuscany.container.spring.mock

Examples of org.apache.tuscany.container.spring.mock.TestBean.echo()


        for (InboundInvocationChain chain : inboundWire.getInvocationChains().values()) {
            chain.setTargetInvoker(composite.createTargetInvoker("foo", chain.getOperation()));
        }
        composite.register(service);
        TestBean serviceInstance = (TestBean) composite.getService("fooService").getServiceInstance();
        assertEquals("bar", serviceInstance.echo("bar"));
    }


    private AbstractApplicationContext createSpringContext() {
        StaticApplicationContext beanFactory = new StaticApplicationContext();
View Full Code Here


        CompositeComponent parent = createNiceMock(CompositeComponent.class);
        DeploymentContext context = createNiceMock(DeploymentContext.class);
        SpringCompositeComponent component =
            (SpringCompositeComponent) builder.build(parent, componentDefinition, context);
        TestBean bean = (TestBean) component.getApplicationContext().getBean("foo");
        assertEquals("call foo", bean.echo("call foo"));
    }

    /**
     * Verifies that the builder calls back into the registry to load services and wires them to bean targets when no
     * <code>sca:service</code> tag is specified in the Spring application.xml
View Full Code Here

        CompositeComponent parent = createNiceMock(CompositeComponent.class);
        DeploymentContext context = createNiceMock(DeploymentContext.class);
        CompositeComponent component = (CompositeComponent) builder.build(parent, componentDefinition, context);
        Service service = component.getService("fooService");
        TestBean bean = (TestBean) service.getServiceInstance();
        assertEquals("call foo", bean.echo("call foo"));
        verify(registry);
    }

    @SuppressWarnings("unchecked")
    private SpringComponentType createComponentType() {
View Full Code Here

    public void testDemoBoot() {
        SpringCompositeComponent comp = (SpringCompositeComponent) component.getChild("Spring");
        Service service = (Service) comp.getChild("fooService");
        TestBean bean = (TestBean) service.getServiceInstance();
        bean.echo("foo");
        bean.getBean().echo("foo");
    }

    protected void setUp() throws Exception {
        addExtension("spring.extension", getClass().getClassLoader().getResource("META-INF/sca/spring.system.scdl"));
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.