Examples of JavaImplementation


Examples of org.apache.tuscany.sca.implementation.java.JavaImplementation

        assertEquals(JavaScopeImpl.CONVERSATION, type.getJavaScope());
    }

    public void testRequestScope() throws IntrospectionException {
        ScopeProcessor processor = new ScopeProcessor(new DefaultAssemblyFactory());
        JavaImplementation type = javaImplementationFactory.createJavaImplementation();
        processor.visitClass(Request.class, type);
        assertEquals(JavaScopeImpl.REQUEST, type.getJavaScope());
    }
View Full Code Here

Examples of org.apache.tuscany.sca.implementation.java.JavaImplementation

        assertEquals(JavaScopeImpl.REQUEST, type.getJavaScope());
    }

    public void testStatelessScope() throws IntrospectionException {
        ScopeProcessor processor = new ScopeProcessor(new DefaultAssemblyFactory());
        JavaImplementation type = javaImplementationFactory.createJavaImplementation();
        processor.visitClass(Stateless.class, type);
        assertEquals(JavaScopeImpl.STATELESS, type.getJavaScope());
    }
View Full Code Here

Examples of org.apache.tuscany.sca.implementation.java.JavaImplementation

        assertEquals(JavaScopeImpl.STATELESS, type.getJavaScope());
    }

    public void testNoScope() throws IntrospectionException {
        ScopeProcessor processor = new ScopeProcessor(new DefaultAssemblyFactory());
        JavaImplementation type = javaImplementationFactory.createJavaImplementation();
        processor.visitClass(None.class, type);
        assertEquals(JavaScopeImpl.STATELESS, type.getJavaScope());
    }
View Full Code Here

Examples of org.apache.tuscany.sca.implementation.java.JavaImplementation

    /**
     * Verifies a single service interface is computed when only one interface
     * is implemented
     */
    public void testSingleInterface() throws Exception {
        JavaImplementation type = javaImplementationFactory.createJavaImplementation();
        Constructor<SingleInterfaceImpl> ctor = SingleInterfaceImpl.class.getConstructor();
        type.setConstructor(new JavaConstructorImpl<SingleInterfaceImpl>(ctor));
        processor.visitEnd(SingleInterfaceImpl.class, type);
        assertEquals(1, type.getServices().size());
        assertTrue(ModelHelper.matches(ModelHelper.getService(type, PropertyInterface.class.getSimpleName()),
                                       PropertyInterface.class));
        assertTrue(type.getProperties().isEmpty());
        assertTrue(type.getReferences().isEmpty());
    }
View Full Code Here

Examples of org.apache.tuscany.sca.implementation.java.JavaImplementation

    /**
     * Verifies property and reference setters are computed
     */
    public void testPropertyReference() throws Exception {
        JavaImplementation type = javaImplementationFactory.createJavaImplementation();
        Constructor<SingleInterfaceWithPropertyReferenceImpl> ctor = SingleInterfaceWithPropertyReferenceImpl.class
            .getConstructor();
        type.setConstructor(new JavaConstructorImpl<SingleInterfaceWithPropertyReferenceImpl>(ctor));
        processor.visitEnd(SingleInterfaceWithPropertyReferenceImpl.class, type);
        assertEquals(1, type.getServices().size());
        assertTrue(ModelHelper
            .matches(ModelHelper.getService(type, Interface1.class.getSimpleName()), Interface1.class));
        assertEquals(1, type.getProperties().size());
        org.apache.tuscany.sca.assembly.Property prop = ModelHelper.getProperty(type, "property");
        assertNotNull(prop);
        assertEquals(ComplexProperty.class, type.getPropertyMembers().get("property").getType());
        assertEquals(1, type.getReferences().size());
        assertTrue(ModelHelper.matches(ModelHelper.getReference(type, "reference"), Ref.class));
    }
View Full Code Here

Examples of org.apache.tuscany.sca.implementation.java.JavaImplementation

    /**
     * Verifies that a property setter is not introspected if an analogous
     * operation is in the service interface
     */
    public void testPropertySetterInInterface() throws Exception {
        JavaImplementation type = javaImplementationFactory.createJavaImplementation();
        Constructor<SingleInterfaceImpl> ctor = SingleInterfaceImpl.class.getConstructor();
        type.setConstructor(new JavaConstructorImpl<SingleInterfaceImpl>(ctor));
        processor.visitEnd(SingleInterfaceImpl.class, type);
        assertEquals(0, type.getProperties().size());
    }
View Full Code Here

Examples of org.apache.tuscany.sca.implementation.java.JavaImplementation

    /**
     * Verifies that a reference setter is not introspected if an analogous
     * operation is in the service interface
     */
    public void testReferenceSetterInInterface() throws Exception {
        JavaImplementation type = javaImplementationFactory.createJavaImplementation();
        Constructor<RefInterfaceImpl> ctor = RefInterfaceImpl.class.getConstructor();
        type.setConstructor(new JavaConstructorImpl<RefInterfaceImpl>(ctor));
        processor.visitEnd(RefInterfaceImpl.class, type);
        assertEquals(0, type.getReferences().size());
    }
View Full Code Here

Examples of org.apache.tuscany.sca.implementation.java.JavaImplementation

    /**
     * Verifies collection generic types or array types are introspected as
     * references according to spec rules
     */
    public void testReferenceCollectionType() throws Exception {
        JavaImplementation type = javaImplementationFactory.createJavaImplementation();
        Constructor<ReferenceCollectionImpl> ctor = ReferenceCollectionImpl.class.getConstructor();
        type.setConstructor(new JavaConstructorImpl<ReferenceCollectionImpl>(ctor));
        processor.visitEnd(ReferenceCollectionImpl.class, type);
        assertEquals(1, type.getProperties().size());
        assertEquals(3, type.getReferences().size());
    }
View Full Code Here

Examples of org.apache.tuscany.sca.implementation.java.JavaImplementation

    /**
     * Verifies collection generic types or array types are introspected as
     * properties according to spec rules
     */
    public void testPropertyCollectionType() throws Exception {
        JavaImplementation type = javaImplementationFactory.createJavaImplementation();
        Constructor<PropertyCollectionImpl> ctor = PropertyCollectionImpl.class.getConstructor();
        type.setConstructor(new JavaConstructorImpl<PropertyCollectionImpl>(ctor));
        processor.visitEnd(PropertyCollectionImpl.class, type);
        assertEquals(0, type.getReferences().size());
        assertEquals(4, type.getProperties().size());
    }
View Full Code Here

Examples of org.apache.tuscany.sca.implementation.java.JavaImplementation

     * Verifies references are calculated when the type marked with is
     *
     * @Remotable
     */
    public void testRemotableRef() throws Exception {
        JavaImplementation type = javaImplementationFactory.createJavaImplementation();
        Constructor<RemotableRefImpl> ctor = RemotableRefImpl.class.getConstructor();
        type.setConstructor(new JavaConstructorImpl<RemotableRefImpl>(ctor));
        processor.visitEnd(RemotableRefImpl.class, type);
        assertEquals(2, type.getReferences().size());
        assertEquals(0, type.getProperties().size());
    }
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.