Package org.apache.tuscany.sca.implementation.java

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


        assertEquals(Multiplicity.ONE_ONE, reference.getMultiplicity());
        assertEquals("myRef", reference.getName());
    }

    public void testTwoReferencesSameType() throws Exception {
        JavaImplementation type = javaImplementationFactory.createJavaImplementation();
        Constructor<Foo> ctor = Foo.class.getConstructor(String.class, String.class);
        visitConstructor(ctor, type);
        assertNotNull(getReference(type, "myRef1"));
        assertNotNull(getReference(type, "myRef2"));
    }
View Full Code Here


        assertNotNull(getReference(type, "myRef1"));
        assertNotNull(getReference(type, "myRef2"));
    }

    public void testDuplicateProperty() throws Exception {
        JavaImplementation type = javaImplementationFactory.createJavaImplementation();
        Constructor<BadFoo> ctor = BadFoo.class.getConstructor(String.class, String.class);
        try {
            visitConstructor(ctor, type);
            fail();
        } catch (DuplicateReferenceException e) {
View Full Code Here

            // expected
        }
    }

    public void testNoName() throws Exception {
        JavaImplementation type = javaImplementationFactory.createJavaImplementation();
        Constructor<NoNameFoo> ctor = NoNameFoo.class.getConstructor(String.class);
        visitConstructor(ctor, type);
        assertNotNull(getReference(type, "_ref0"));
    }
View Full Code Here

        visitConstructor(ctor, type);
        assertNotNull(getReference(type, "_ref0"));
    }

    public void testNamesOnConstructor() throws Exception {
        JavaImplementation type = javaImplementationFactory.createJavaImplementation();
        Constructor<Foo> ctor = Foo.class.getConstructor(Integer.class);
        visitConstructor(ctor, type);
        assertNotNull(getReference(type, "myRef"));
    }
View Full Code Here

        visitConstructor(ctor, type);
        assertNotNull(getReference(type, "myRef"));
    }

    public void testInvalidNumberOfNames() throws Exception {
        JavaImplementation type = javaImplementationFactory.createJavaImplementation();
        Constructor<BadFoo> ctor = BadFoo.class.getConstructor(Integer.class, Integer.class);
        try {
            visitConstructor(ctor, type);
            fail();
        } catch (InvalidConstructorException e) {
View Full Code Here

            // expected
        }
    }

    public void testNoMatchingNames() throws Exception {
        JavaImplementation type = javaImplementationFactory.createJavaImplementation();
        Constructor<BadFoo> ctor = BadFoo.class.getConstructor(List.class, List.class);
        try {
            visitConstructor(ctor, type);
            fail();
        } catch (InvalidConstructorException e) {
View Full Code Here

    private ComponentNameProcessor nameProcessor;
    private JavaImplementationFactory javaImplementationFactory;

    public void testComponentContextMethod() throws Exception {
        Method method = Foo.class.getMethod("setContext", ComponentContext.class);
        JavaImplementation type = javaImplementationFactory.createJavaImplementation();
        processor.visitMethod(method, type);
        assertNotNull(type.getResources().get("context"));
    }
View Full Code Here

        assertNotNull(type.getResources().get("context"));
    }

    public void testComponentContextField() throws Exception {
        Field field = Foo.class.getDeclaredField("context");
        JavaImplementation type = javaImplementationFactory.createJavaImplementation();
        processor.visitField(field, type);
        assertNotNull(type.getResources().get("context"));
    }
View Full Code Here

        assertNotNull(type.getResources().get("context"));
    }

    public void testRequestContextMethod() throws Exception {
        Method method = Foo.class.getMethod("setRequestContext", RequestContext.class);
        JavaImplementation type = javaImplementationFactory.createJavaImplementation();
        processor.visitMethod(method, type);
        assertNotNull(type.getResources().get("requestContext"));
    }
View Full Code Here

        assertNotNull(type.getResources().get("requestContext"));
    }

    public void testRequestContextField() throws Exception {
        Field field = Foo.class.getDeclaredField("requestContext");
        JavaImplementation type = javaImplementationFactory.createJavaImplementation();
        processor.visitField(field, type);
        assertNotNull(type.getResources().get("requestContext"));
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.implementation.java.JavaImplementation

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.