Package org.apache.tuscany.spi.idl.java

Examples of org.apache.tuscany.spi.idl.java.JavaServiceContract


    @SuppressWarnings("unchecked")
    public void testCreateTargetInvoker() {
        // TODO: this doesn't really test anything yet
        RMIReference ref = new RMIReference(null, null, null, null, null, null, null, null);
        ServiceContract contract = new JavaServiceContract();
        contract.setInterfaceClass(String.class);
        List l = new ArrayList();
        l.add(new DataType(null, null));
        DataType in = new DataType(null, l);
        Operation operation = new Operation(null, in, null, null);
        try {
View Full Code Here


        configuration.setWireService(new JDKWireService());
        final JavaAtomicComponent component = new JavaAtomicComponent("target", configuration, null);

        InboundWire wire = createMock(InboundWire.class);

        JavaServiceContract contract = new JavaServiceContract(Target.class);
        EasyMock.expect(wire.getServiceContract()).andReturn(contract).anyTimes();
        expect(wire.getServiceName()).andReturn("Target");
        Map<Operation<?>, InboundInvocationChain> chains = new HashMap<Operation<?>, InboundInvocationChain>();
        expect(wire.getInvocationChains()).andReturn(chains);
        expect(wire.getCallbackReferenceName()).andReturn(null);
View Full Code Here

*/
public class JavaInterfaceProcessorRegistryImplTestCase extends TestCase {
    private JavaInterfaceProcessorRegistryImpl impl;

    public void testSimpleInterface() throws InvalidServiceContractException {
        JavaServiceContract contract = impl.introspect(Simple.class);
        // TODO spec to clairfy interface name
        assertEquals(JavaIntrospectionHelper.getBaseName(Simple.class), contract.getInterfaceName());
        assertEquals(Simple.class, contract.getInterfaceClass());
        Map<String, Operation<Type>> operations = contract.getOperations();
        assertEquals(1, operations.size());
        Operation<Type> baseInt = operations.get("baseInt");
        assertNotNull(baseInt);

        DataType<Type> returnType = baseInt.getOutputType();
View Full Code Here

        JavaMappedReference mappedReference = new JavaMappedReference();
        mappedReference.setName("ref");
        Method refMethod = FooImpl.class.getMethod("setRef", Foo.class);
        refMethod.setAccessible(true);
        mappedReference.setMember(refMethod);
        ServiceContract contract = new JavaServiceContract(Foo.class);
        mappedReference.setServiceContract(contract);
        type.add(mappedReference);
        ConstructorDefinition<FooImpl> ctorDef = new ConstructorDefinition<FooImpl>(FooImpl.class.getConstructor());
        type.setConstructorDefinition(ctorDef);
        SystemImplementation impl = new SystemImplementation();
View Full Code Here

        mappedReference.setName("ref");
        mappedReference.setAutowire(true);
        Method refMethod = FooImpl.class.getMethod("setRef", Foo.class);
        refMethod.setAccessible(true);
        mappedReference.setMember(refMethod);
        ServiceContract contract = new JavaServiceContract(Foo.class);
        mappedReference.setServiceContract(contract);
        type.add(mappedReference);
        ConstructorDefinition<FooImpl> ctorDef = new ConstructorDefinition<FooImpl>(FooImpl.class.getConstructor());
        type.setConstructorDefinition(ctorDef);
        SystemImplementation impl = new SystemImplementation();
View Full Code Here

        impl.setComponentType(type);
        impl.setImplementationClass(FooImpl2.class);
        JavaMappedReference mappedReference = new JavaMappedReference();
        mappedReference.setName("ref");
        mappedReference.setAutowire(true);
        ServiceContract contract = new JavaServiceContract(Foo.class);
        mappedReference.setServiceContract(contract);
        type.add(mappedReference);
        ComponentDefinition<SystemImplementation> definition = new ComponentDefinition<SystemImplementation>(impl);
        CompositeComponent parent = EasyMock.createNiceMock(CompositeComponent.class);
        FooImpl targetFoo = new FooImpl();
View Full Code Here

    }

    public static <T> OutboundWire createOutboundWire(QualifiedName targetName, Class<T> interfaze)
        throws InvalidServiceContractException {
        OutboundWire wire = new OutboundWireImpl();
        JavaServiceContract contract = new JavaServiceContract(interfaze);
        wire.setServiceContract(contract);
        wire.setTargetName(targetName);
        wire.addInvocationChains(createInvocationChains(interfaze));
        return wire;
    }
View Full Code Here

*/
public class JDKOutboundInvocationHandlerTestCase extends TestCase {

    public void testToString() {
        OutboundWireImpl wire = new OutboundWireImpl();
        wire.setServiceContract(new JavaServiceContract(Foo.class));
        JDKOutboundInvocationHandler handler = new JDKOutboundInvocationHandler(wire, new WorkContextImpl());
        Foo foo = (Foo) Proxy.newProxyInstance(getClass().getClassLoader(), new Class[]{Foo.class}, handler);
        assertNotNull(foo.toString());
    }
View Full Code Here

        assertNotNull(foo.toString());
    }

    public void testHashCode() {
        OutboundWireImpl wire = new OutboundWireImpl();
        wire.setServiceContract(new JavaServiceContract(Foo.class));
        JDKOutboundInvocationHandler handler = new JDKOutboundInvocationHandler(wire, new WorkContextImpl());
        Foo foo = (Foo) Proxy.newProxyInstance(getClass().getClassLoader(), new Class[]{Foo.class}, handler);
        assertNotNull(foo.hashCode());
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.spi.idl.java.JavaServiceContract

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.