Examples of JavaMappedReference


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

     */
    public void testRefBuild() throws Exception {
        PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>> type =
            new PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>>();
        type.setImplementationScope(Scope.MODULE);
        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();
        impl.setComponentType(type);
View Full Code Here

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

     */
    public void testAutowireBuild() throws Exception {
        PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>> type =
            new PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>>();
        type.setImplementationScope(Scope.MODULE);
        JavaMappedReference mappedReference = new JavaMappedReference();
        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();
        impl.setComponentType(type);
View Full Code Here

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

        ctorDef.getInjectionNames().add("ref");
        type.setConstructorDefinition(ctorDef);
        SystemImplementation impl = new SystemImplementation();
        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();
        EasyMock.expect(parent.resolveSystemInstance(EasyMock.eq(Foo.class))).andReturn(targetFoo);
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.