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

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


        processor.visitMethod(method, type);
        assertEquals(method, type.getCallbackMembers().get(FooCallback.class.getName()).getAnchor());
    }

    public void testFieldCallbackInterface() throws Exception {
        JavaImplementation type = javaImplementationFactory.createJavaImplementation();
        processor.visitClass(FooImpl.class, type);
        org.apache.tuscany.sca.assembly.Service service = getService(type, Foo.class.getSimpleName());
        assertNotNull(service);
        Field field = FooImpl.class.getDeclaredField("callback");
        processor.visitField(field, type);
        assertEquals(field, type.getCallbackMembers().get(FooCallback.class.getName()).getAnchor());
    }
View Full Code Here


        processor.visitField(field, type);
        assertEquals(field, type.getCallbackMembers().get(FooCallback.class.getName()).getAnchor());
    }

    public void testFieldCallbackInterface1() throws Exception {
        JavaImplementation type = javaImplementationFactory.createJavaImplementation();
        processor.visitClass(FooImpl1.class, type);
        org.apache.tuscany.sca.assembly.Service service = getService(type, Foo.class.getSimpleName());
        assertNotNull(service);
        Field field1 = FooImpl1.class.getDeclaredField("callbackRef");
        processor.visitField(field1, type);
        assertEquals(field1, type.getCallbackMembers().get(FooCallback.class.getName()).getAnchor());
       
    }
View Full Code Here

        assertEquals(field1, type.getCallbackMembers().get(FooCallback.class.getName()).getAnchor());
       
    }
   
    public void testMethodDoesNotMatchCallback() throws Exception {
        JavaImplementation type = javaImplementationFactory.createJavaImplementation();
        processor.visitClass(BadBarImpl.class, type);
        Method method = BadBarImpl.class.getMethod("setWrongInterfaceCallback", String.class);
        try {
            processor.visitMethod(method, type);
            fail();
View Full Code Here

            // expected
        }
    }

    public void testNoParamCallback() throws Exception {
        JavaImplementation type = javaImplementationFactory.createJavaImplementation();
        processor.visitClass(BadBarImpl.class, type);
        Method method = BadBarImpl.class.getMethod("setNoParamCallback");
        try {
            processor.visitMethod(method, type);
            fail();
View Full Code Here

            // expected
        }
    }

    public void testFieldDoesNotMatchCallback() throws Exception {
        JavaImplementation type = javaImplementationFactory.createJavaImplementation();
        processor.visitClass(BadBarImpl.class, type);
        Field field = BadBarImpl.class.getDeclaredField("wrongInterfaceCallback");
        try {
            processor.visitField(field, type);
            fail();
View Full Code Here

            // expected
        }
    }

    public void testBadCallbackInterfaceAnnotation() throws Exception {
        JavaImplementation type = javaImplementationFactory.createJavaImplementation();
        try {
            processor.visitClass(BadFooImpl.class, type);
            fail();
        } catch (IntrospectionException e) {
            // expected
View Full Code Here

    private AssemblyFactory assemblyFactory = new DefaultAssemblyFactory();
    private JavaImplementationFactory javaImplementationFactory = new DefaultJavaImplementationFactory();
   
    public void testNoLevel() throws IntrospectionException {
        EagerInitProcessor processor = new EagerInitProcessor(assemblyFactory);
        JavaImplementation type = javaImplementationFactory.createJavaImplementation();
        processor.visitClass(Level.class, type);
    }
View Full Code Here

        processor.visitClass(Level.class, type);
    }

    public void testSubclass() throws IntrospectionException {
        EagerInitProcessor processor = new EagerInitProcessor(assemblyFactory);
        JavaImplementation type = javaImplementationFactory.createJavaImplementation();
        processor.visitClass(SubClass.class, type);
    }
View Full Code Here

    private AssemblyFactory assemblyFactory = new DefaultAssemblyFactory();
    private JavaImplementationFactory javaImplementationFactory = new DefaultJavaImplementationFactory();

    public void testDestroy() throws Exception {
        DestroyProcessor processor = new DestroyProcessor(assemblyFactory);
        JavaImplementation type = javaImplementationFactory.createJavaImplementation();
        Method method = Foo.class.getMethod("destroy");
        processor.visitMethod(method, type);
        assertNotNull(type.getDestroyMethod());
    }
View Full Code Here

        assertNotNull(type.getDestroyMethod());
    }

    public void testBadDestroy() throws Exception {
        DestroyProcessor processor = new DestroyProcessor(assemblyFactory);
        JavaImplementation type = javaImplementationFactory.createJavaImplementation();
        Method method = Bar.class.getMethod("badDestroy", String.class);
        try {
            processor.visitMethod(method, type);
            fail();
        } catch (IllegalDestructorException e) {
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.