Package org.apache.tuscany.spi.wire

Examples of org.apache.tuscany.spi.wire.WireService


    }

    protected void setUp() throws Exception {
        super.setUp();
        registry = new BuilderRegistryImpl();
        WireService service = EasyMock.createNiceMock(WireService.class);
        registry.setWireService(service);
        deploymentContext = new RootDeploymentContext(null, null, null, null);
    }
View Full Code Here


        JavaServiceContract contract = new JavaServiceContract(Greeter.class);
        EasyMock.expect(inboundWire.getServiceContract()).andReturn(contract).anyTimes();
        EasyMock.replay(inboundWire);

        //Create mocked WireService, for ServiceExtension.getServiceInstance()
        WireService wireService = EasyMock.createNiceMock(WireService.class);
        wireService.createProxy(EasyMock.isA(InboundWire.class));
        EasyMock.expectLastCall().andReturn(new GreeterImpl()).anyTimes();
        EasyMock.replay(wireService);

        CeltixService celtixService = new CeltixService("name", Greeter.class, null, wireService, wsBinding, bus, null);
        //Not sure how InboundWire is set to CeltixService, is the following way correct?
View Full Code Here

        OutboundWire wire = EasyMock.createMock(OutboundWire.class);
        wire.getInvocationChains();
        EasyMock.expectLastCall().andReturn(new HashMap<Operation<?>, OutboundInvocationChain>());
        EasyMock.expect(wire.getReferenceName()).andReturn("target").atLeastOnce();
        EasyMock.replay(wire);
        WireService service = EasyMock.createMock(WireService.class);
        EasyMock.expect(service.createProxy(EasyMock.eq(wire))).andAnswer(new IAnswer<Object>() {
            public Object answer() throws Throwable {
                OutboundWire wire = (OutboundWire) EasyMock.getCurrentArguments()[0];
                wire.getInvocationChains();
                return target;
            }
View Full Code Here

            "SOAPService"));
        Port port = wsdlService.getPort("SoapPort");
        WebServiceBinding wsBinding = new WebServiceBinding(wsdlDef, port, "uri", "portURI", wsdlService);

        //Create a mocked WireService, make the call of ServiceExtension.getServiceInstance() returns a proxy instance.
        WireService wireService = EasyMock.createNiceMock(WireService.class);
        wireService.createProxy(EasyMock.isA(InboundWire.class));
        EasyMock.expectLastCall().andReturn(null);
        EasyMock.replay(wireService);

        //Create a mocked InboundWire, make the call of ServiceExtension.getInterface() returns a Class
        InboundWire inboundWire = EasyMock.createNiceMock(InboundWire.class);
View Full Code Here

        Service wsdlService = wsdlDef.getService(new QName("http://objectweb.org/hello_world_soap_http",
            "SOAPService"));
        Port port = wsdlService.getPort("SoapPort");
        WebServiceBinding wsBinding = new WebServiceBinding(wsdlDef, port, "uri", "portURI", wsdlService);
        //Create a mocked WireService, make the call of ServiceExtension.getServiceInstance() returns a proxy instance.
        WireService wireService = EasyMock.createNiceMock(WireService.class);
        EasyMock.replay(wireService);
        CompositeComponent parent = EasyMock.createNiceMock(CompositeComponent.class);
        // TODO figure out what to do with the service contract
        ServiceContract<?> contract = new WSDLServiceContract();
        contract.setInterfaceClass(Greeter.class);
View Full Code Here

*/
public class WireObjectFactoryTestCase extends TestCase {

    public void testCreateInstance() throws Exception {
        RuntimeWire wire = createMock(RuntimeWire.class);
        WireService service = createMock(WireService.class);
        service.createProxy(wire);
        expectLastCall().andReturn(null);
        replay(service);
        WireObjectFactory factory = new WireObjectFactory(wire, service);
        factory.getInstance();
        verify(service);
View Full Code Here

        SpringImplementation impl = new SpringImplementation(createComponentType());
        ComponentDefinition<SpringImplementation> componentDefinition =
            new ComponentDefinition<SpringImplementation>("spring", impl);

        // Create a service instance that the mock builder registry will return
        WireService wireService = ArtifactFactory.createWireService();
        ServiceExtension serviceContext =
            new ServiceExtension("fooService", TestBean.class, null, wireService);
        InboundWire inboundWire = ArtifactFactory.createInboundWire("fooService", TestBean.class);
        OutboundWire outboundWire = ArtifactFactory.createOutboundWire("fooService", TestBean.class);
        ArtifactFactory.terminateWire(outboundWire);
View Full Code Here

    @SuppressWarnings("unchecked")
    public void testBuildConnect() throws Exception {
        CompositeComponent parent = new CompositeComponentImpl(null, null, null, null);

        CompositeBuilder builder = new CompositeBuilder();
        WireService wireService = new JDKWireService();
        builder.setWireService(wireService);
        BuilderRegistryImpl builderRegistry = new BuilderRegistryImpl();
        builderRegistry.setWireService(wireService);
        JavaComponentBuilder jBuilder = new JavaComponentBuilder();
        jBuilder.setWireService(wireService);
View Full Code Here

public class CallbackWireObjectFactoryTestCase extends TestCase {

    public void testCreateInstance() throws Exception {
        JavaServiceContract contract = new JavaServiceContract();
        contract.setCallbackClass(Foo.class);
        WireService service = createMock(WireService.class);
        service.createCallbackProxy(contract, null);
        expectLastCall().andReturn(null);
        replay(service);
        CallbackWireObjectFactory factory = new CallbackWireObjectFactory(contract, service, null);
        factory.getInstance();
        verify(service);
View Full Code Here

        expect(iwire.getInvocationChains()).andReturn(chains);
        replay(iwire);
        WirePostProcessorRegistry registry = createMock(WirePostProcessorRegistry.class);
        registry.process(EasyMock.eq(iwire), EasyMock.eq(owire));
        replay(registry);
        WireService wireService = createMock(WireService.class);
        wireService.checkCompatibility((ServiceContract<?>) EasyMock.anyObject(),
            (ServiceContract<?>) EasyMock.anyObject(), EasyMock.eq(false));
        expectLastCall().anyTimes();   
        replay(wireService);
        ConnectorImpl connector = new ConnectorImpl(wireService, registry, null, null);
        connector.connect(iwire, owire, false);
View Full Code Here

TOP

Related Classes of org.apache.tuscany.spi.wire.WireService

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.