Package org.apache.tuscany.spi.implementation.java

Examples of org.apache.tuscany.spi.implementation.java.ConstructorDefinition


            DuplicateConstructorException e =
                new DuplicateConstructorException("Multiple constructor definitions found");
            e.setIdentifier(constructor.getDeclaringClass().getName());
            throw e;
        } else if (definition == null) {
            definition = new ConstructorDefinition(constructor);
        }
        Class<?>[] params = constructor.getParameterTypes();
        String[] names = annotation.value();
        Annotation[][] annotations = constructor.getParameterAnnotations();
        List<String> injectionNames = definition.getInjectionNames();
View Full Code Here


    @SuppressWarnings("unchecked")
    public void testPropertyProcessorWithHeuristicProcessor() throws Exception {
        PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>> type =
            new PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>>();
        Constructor ctor = Foo.class.getConstructor(String.class);
        type.setConstructorDefinition(new ConstructorDefinition(ctor));
        propertyProcessor.visitConstructor(null, ctor, type, null);
        heuristicProcessor.visitEnd(null, Foo.class, type, null);
        assertEquals(1, type.getProperties().size());
        assertNotNull(type.getProperties().get("foo"));
    }
View Full Code Here

        Constructor<Bar> ctor = Bar.class.getConstructor(String.class, BazMonitor.class);
        EasyMock.expect(monitorFactory.getMonitor(EasyMock.eq(BazMonitor.class))).andReturn(null);
        EasyMock.replay(monitorFactory);
        processor.visitConstructor(null, ctor, type, null);
        Map<String, JavaMappedProperty<?>> properties = type.getProperties();
        ConstructorDefinition definition = type.getConstructorDefinition();
        assertEquals(2, definition.getInjectionNames().size());
        assertEquals(BazMonitor.class.getName(), definition.getInjectionNames().get(1));
        String name = BazMonitor.class.getName();
        assertTrue(properties.get(name).getDefaultValueFactory() instanceof SingletonObjectFactory);
        EasyMock.verify(monitorFactory);
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.spi.implementation.java.ConstructorDefinition

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.