You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by jm...@apache.org on 2006/08/25 06:51:30 UTC
svn commit: r436652 [2/2] - in /incubator/tuscany/java/sca:
commands/launcher/src/main/resources/META-INF/tuscany/
containers/container.spring/src/main/java/org/apache/tuscany/container/spring/impl/
core/src/main/java/org/apache/tuscany/core/bootstrap/...
Modified: incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/HeuristicAndPropertyTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/HeuristicAndPropertyTestCase.java?rev=436652&r1=436651&r2=436652&view=diff
==============================================================================
--- incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/HeuristicAndPropertyTestCase.java (original)
+++ incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/HeuristicAndPropertyTestCase.java Thu Aug 24 21:51:28 2006
@@ -22,20 +22,22 @@
import org.osoa.sca.annotations.Property;
-import junit.framework.TestCase;
import org.apache.tuscany.spi.implementation.java.ConstructorDefinition;
import org.apache.tuscany.spi.implementation.java.JavaMappedProperty;
import org.apache.tuscany.spi.implementation.java.JavaMappedReference;
import org.apache.tuscany.spi.implementation.java.JavaMappedService;
import org.apache.tuscany.spi.implementation.java.PojoComponentType;
+import junit.framework.TestCase;
+import org.apache.tuscany.core.idl.java.InterfaceJavaIntrospectorImpl;
+
/**
* @version $Rev$ $Date$
*/
public class HeuristicAndPropertyTestCase extends TestCase {
- private PropertyProcessor propertyProcessor = new PropertyProcessor();
- private HeuristicPojoProcessor heuristicProcessor = new HeuristicPojoProcessor();
+ private PropertyProcessor propertyProcessor;
+ private HeuristicPojoProcessor heuristicProcessor;
/**
* Verifies the property and heuristic processors don't collide
@@ -52,6 +54,13 @@
assertNotNull(type.getProperties().get("foo"));
}
+ protected void setUp() throws Exception {
+ super.setUp();
+ ImplementationProcessorServiceImpl service =
+ new ImplementationProcessorServiceImpl(new InterfaceJavaIntrospectorImpl());
+ propertyProcessor = new PropertyProcessor(service);
+ heuristicProcessor = new HeuristicPojoProcessor(service);
+ }
public static class Foo {
public Foo(@Property(name = "foo") String prop) {
Modified: incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/HeuristicConstructorTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/HeuristicConstructorTestCase.java?rev=436652&r1=436651&r2=436652&view=diff
==============================================================================
--- incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/HeuristicConstructorTestCase.java (original)
+++ incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/HeuristicConstructorTestCase.java Thu Aug 24 21:51:28 2006
@@ -23,14 +23,14 @@
import org.osoa.sca.annotations.Remotable;
import org.apache.tuscany.spi.annotation.Autowire;
-import org.apache.tuscany.spi.model.ServiceContract;
-import org.apache.tuscany.spi.implementation.java.JavaMappedService;
-
-import junit.framework.TestCase;
import org.apache.tuscany.spi.implementation.java.JavaMappedProperty;
import org.apache.tuscany.spi.implementation.java.JavaMappedReference;
+import org.apache.tuscany.spi.implementation.java.JavaMappedService;
import org.apache.tuscany.spi.implementation.java.PojoComponentType;
+import org.apache.tuscany.spi.model.ServiceContract;
+import junit.framework.TestCase;
+import org.apache.tuscany.core.idl.java.InterfaceJavaIntrospectorImpl;
import org.apache.tuscany.core.idl.java.JavaServiceContract;
/**
@@ -38,7 +38,8 @@
*/
public class HeuristicConstructorTestCase extends TestCase {
- private HeuristicPojoProcessor processor = new HeuristicPojoProcessor();
+ private HeuristicPojoProcessor processor =
+ new HeuristicPojoProcessor(new ImplementationProcessorServiceImpl(new InterfaceJavaIntrospectorImpl()));
/**
* Verifies a single constructor is chosen with a parameter as the type
Modified: incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/HeuristicPojoProcessorTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/HeuristicPojoProcessorTestCase.java?rev=436652&r1=436651&r2=436652&view=diff
==============================================================================
--- incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/HeuristicPojoProcessorTestCase.java (original)
+++ incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/HeuristicPojoProcessorTestCase.java Thu Aug 24 21:51:28 2006
@@ -18,24 +18,24 @@
*/
package org.apache.tuscany.core.implementation.processor;
+import java.lang.reflect.Constructor;
import java.util.Collection;
import java.util.List;
-import java.lang.reflect.Constructor;
import org.osoa.sca.annotations.Property;
import org.osoa.sca.annotations.Reference;
import org.osoa.sca.annotations.Remotable;
import org.osoa.sca.annotations.Service;
-import org.apache.tuscany.spi.implementation.java.JavaMappedService;
-
-import junit.framework.TestCase;
import org.apache.tuscany.spi.implementation.java.ConstructorDefinition;
import org.apache.tuscany.spi.implementation.java.JavaMappedProperty;
import org.apache.tuscany.spi.implementation.java.JavaMappedReference;
+import org.apache.tuscany.spi.implementation.java.JavaMappedService;
+import org.apache.tuscany.spi.implementation.java.PojoComponentType;
import org.apache.tuscany.spi.implementation.java.ProcessingException;
-import org.apache.tuscany.spi.implementation.java.PojoComponentType;
+import junit.framework.TestCase;
+import org.apache.tuscany.core.idl.java.InterfaceJavaIntrospectorImpl;
/**
* Verfies component type information is properly introspected from an unadorned POJO according to the SCA Java Client
@@ -45,7 +45,8 @@
*/
public class HeuristicPojoProcessorTestCase extends TestCase {
- private HeuristicPojoProcessor processor = new HeuristicPojoProcessor();
+ private HeuristicPojoProcessor processor =
+ new HeuristicPojoProcessor(new ImplementationProcessorServiceImpl(new InterfaceJavaIntrospectorImpl()));
/**
* Verifies a single service interface is computed when only one interface is implemented
@@ -54,7 +55,7 @@
public void testSingleInterface() throws Exception {
PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>> type =
new PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>>();
- Constructor ctor = SingleInterfaceImpl.class.getConstructor();
+ Constructor ctor = SingleInterfaceImpl.class.getConstructor();
type.setConstructorDefinition(new ConstructorDefinition(ctor));
processor.visitEnd(null, SingleInterfaceImpl.class, type, null);
assertEquals(1, type.getServices().size());
@@ -72,7 +73,7 @@
public void testPropertyReference() throws Exception {
PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>> type =
new PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>>();
- Constructor ctor = SingleInterfaceWithPropertyReferenceImpl.class.getConstructor();
+ Constructor ctor = SingleInterfaceWithPropertyReferenceImpl.class.getConstructor();
type.setConstructorDefinition(new ConstructorDefinition(ctor));
processor.visitEnd(null, SingleInterfaceWithPropertyReferenceImpl.class, type, null);
assertEquals(1, type.getServices().size());
@@ -92,7 +93,7 @@
public void testPropertySetterInInterface() throws Exception {
PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>> type =
new PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>>();
- Constructor ctor = SingleInterfaceImpl.class.getConstructor();
+ Constructor ctor = SingleInterfaceImpl.class.getConstructor();
type.setConstructorDefinition(new ConstructorDefinition(ctor));
processor.visitEnd(null, SingleInterfaceImpl.class, type, null);
assertEquals(0, type.getProperties().size());
@@ -105,7 +106,7 @@
public void testReferenceSetterInInterface() throws Exception {
PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>> type =
new PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>>();
- Constructor ctor = RefInterfaceImpl.class.getConstructor();
+ Constructor ctor = RefInterfaceImpl.class.getConstructor();
type.setConstructorDefinition(new ConstructorDefinition(ctor));
processor.visitEnd(null, RefInterfaceImpl.class, type, null);
assertEquals(0, type.getReferences().size());
@@ -118,7 +119,7 @@
public void testReferenceCollectionType() throws Exception {
PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>> type =
new PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>>();
- Constructor ctor = ReferenceCollectionImpl.class.getConstructor();
+ Constructor ctor = ReferenceCollectionImpl.class.getConstructor();
type.setConstructorDefinition(new ConstructorDefinition(ctor));
processor.visitEnd(null, ReferenceCollectionImpl.class, type, null);
assertEquals(0, type.getProperties().size());
@@ -132,7 +133,7 @@
public void testPropertyCollectionType() throws Exception {
PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>> type =
new PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>>();
- Constructor ctor = PropertyCollectionImpl.class.getConstructor();
+ Constructor ctor = PropertyCollectionImpl.class.getConstructor();
type.setConstructorDefinition(new ConstructorDefinition(ctor));
processor.visitEnd(null, PropertyCollectionImpl.class, type, null);
assertEquals(0, type.getReferences().size());
@@ -146,7 +147,7 @@
public void testRemotableRef() throws Exception {
PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>> type =
new PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>>();
- Constructor ctor = RemotableRefImpl.class.getConstructor();
+ Constructor ctor = RemotableRefImpl.class.getConstructor();
type.setConstructorDefinition(new ConstructorDefinition(ctor));
processor.visitEnd(null, RemotableRefImpl.class, type, null);
assertEquals(2, type.getReferences().size());
@@ -157,7 +158,7 @@
public void testParentInterface() throws ProcessingException, NoSuchMethodException {
PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>> type =
new PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>>();
- Constructor ctor = Child.class.getConstructor();
+ Constructor ctor = Child.class.getConstructor();
type.setConstructorDefinition(new ConstructorDefinition(ctor));
processor.visitEnd(null, Child.class, type, null);
assertTrue(type.getServices().containsKey("HeuristicPojoProcessorTestCase$Interface1"));
@@ -189,7 +190,7 @@
public void testProtectedRemotableRefField() throws ProcessingException, NoSuchMethodException {
PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>> type =
new PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>>();
- Constructor ctor = ProtectedRemotableRefFieldImpl.class.getConstructor();
+ Constructor ctor = ProtectedRemotableRefFieldImpl.class.getConstructor();
type.setConstructorDefinition(new ConstructorDefinition(ctor));
processor.visitEnd(null, ProtectedRemotableRefFieldImpl.class, type, null);
assertNotNull(type.getReferences().get("otherRef"));
@@ -199,7 +200,7 @@
public void testProtectedRemotableRefMethod() throws ProcessingException, NoSuchMethodException {
PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>> type =
new PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>>();
- Constructor ctor = ProtectedRemotableRefMethodImpl.class.getConstructor();
+ Constructor ctor = ProtectedRemotableRefMethodImpl.class.getConstructor();
type.setConstructorDefinition(new ConstructorDefinition(ctor));
processor.visitEnd(null, ProtectedRemotableRefMethodImpl.class, type, null);
assertNotNull(type.getReferences().get("otherRef"));
Modified: incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/HeutisticExtensibleConstructorTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/HeutisticExtensibleConstructorTestCase.java?rev=436652&r1=436651&r2=436652&view=diff
==============================================================================
--- incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/HeutisticExtensibleConstructorTestCase.java (original)
+++ incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/HeutisticExtensibleConstructorTestCase.java Thu Aug 24 21:51:28 2006
@@ -21,14 +21,15 @@
import java.lang.reflect.Constructor;
import java.util.List;
-import org.apache.tuscany.spi.implementation.java.JavaMappedService;
-
-import junit.framework.TestCase;
import org.apache.tuscany.spi.implementation.java.ConstructorDefinition;
import org.apache.tuscany.spi.implementation.java.JavaMappedProperty;
import org.apache.tuscany.spi.implementation.java.JavaMappedReference;
+import org.apache.tuscany.spi.implementation.java.JavaMappedService;
import org.apache.tuscany.spi.implementation.java.PojoComponentType;
+import junit.framework.TestCase;
+import org.apache.tuscany.core.idl.java.InterfaceJavaIntrospectorImpl;
+
/**
* Verifies constructors that have extensible annotation types, i.e. that have parameters marked by annotations which
* are themselves processed by some other implementation processor
@@ -37,7 +38,8 @@
*/
public class HeutisticExtensibleConstructorTestCase extends TestCase {
- private HeuristicPojoProcessor processor = new HeuristicPojoProcessor();
+ private HeuristicPojoProcessor processor =
+ new HeuristicPojoProcessor(new ImplementationProcessorServiceImpl(new InterfaceJavaIntrospectorImpl()));
/**
* Verifies heuristic processing can be called priot to an extension annotation processors being called.
Copied: incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/ImplementationProcessorServiceTestCase.java (from r434281, incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/ProcessorUtilsServiceTestCase.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/ImplementationProcessorServiceTestCase.java?p2=incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/ImplementationProcessorServiceTestCase.java&p1=incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/ProcessorUtilsServiceTestCase.java&r1=434281&r2=436652&rev=436652&view=diff
==============================================================================
--- incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/ProcessorUtilsServiceTestCase.java (original)
+++ incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/ImplementationProcessorServiceTestCase.java Thu Aug 24 21:51:28 2006
@@ -22,29 +22,33 @@
import org.osoa.sca.annotations.Remotable;
import org.osoa.sca.annotations.Scope;
+import org.apache.tuscany.spi.implementation.java.JavaMappedService;
import org.apache.tuscany.spi.model.InteractionScope;
import org.apache.tuscany.spi.model.ServiceContract;
-import org.apache.tuscany.spi.implementation.java.JavaMappedService;
import junit.framework.TestCase;
+import org.apache.tuscany.core.idl.java.InterfaceJavaIntrospectorImpl;
/**
* @version $Rev$ $Date$
*/
-public class ProcessorUtilsServiceTestCase extends TestCase {
+public class ImplementationProcessorServiceTestCase extends TestCase {
+
+ private ImplementationProcessorService implService =
+ new ImplementationProcessorServiceImpl(new InterfaceJavaIntrospectorImpl());
public void testCreateConversationalService() throws Exception {
- JavaMappedService service = ProcessorUtils.createService(Foo.class);
+ JavaMappedService service = implService.createService(Foo.class);
assertTrue(Foo.class.equals(service.getServiceContract().getInterfaceClass()));
assertTrue(service.isRemotable());
assertEquals(InteractionScope.CONVERSATIONAL, service.getServiceContract().getInteractionScope());
ServiceContract serviceContract = service.getServiceContract();
assertTrue(Bar.class.equals(serviceContract.getCallbackClass()));
- assertTrue("ProcessorUtilsServiceTestCase$Bar".equals(serviceContract.getCallbackName()));
+ assertTrue("ImplementationProcessorServiceTestCase$Bar".equals(serviceContract.getCallbackName()));
}
public void testCreateDefaultService() throws Exception {
- JavaMappedService service = ProcessorUtils.createService(Baz.class);
+ JavaMappedService service = implService.createService(Baz.class);
assertTrue(Baz.class.equals(service.getServiceContract().getInterfaceClass()));
assertTrue(!service.isRemotable());
assertEquals(InteractionScope.NONCONVERSATIONAL, service.getServiceContract().getInteractionScope());
Propchange: incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/ImplementationProcessorServiceTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/ImplementationProcessorServiceTestCase.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Copied: incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/ImplementationProcessorServiceUniqueTestCase.java (from r434280, incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/ProcessorUtilsUniqueTestCase.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/ImplementationProcessorServiceUniqueTestCase.java?p2=incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/ImplementationProcessorServiceUniqueTestCase.java&p1=incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/ProcessorUtilsUniqueTestCase.java&r1=434280&r2=436652&rev=436652&view=diff
==============================================================================
--- incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/ProcessorUtilsUniqueTestCase.java (original)
+++ incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/ImplementationProcessorServiceUniqueTestCase.java Thu Aug 24 21:51:28 2006
@@ -19,30 +19,34 @@
package org.apache.tuscany.core.implementation.processor;
import junit.framework.TestCase;
+import org.apache.tuscany.core.idl.java.InterfaceJavaIntrospectorImpl;
/**
* @version $Rev$ $Date$
*/
-public class ProcessorUtilsUniqueTestCase extends TestCase {
+public class ImplementationProcessorServiceUniqueTestCase extends TestCase {
+
+ private ImplementationProcessorService service =
+ new ImplementationProcessorServiceImpl(new InterfaceJavaIntrospectorImpl());
public void testUniquess1() throws Exception {
Class[] classes = new Class[2];
classes[0] = String.class;
classes[1] = Integer.class;
- assertTrue(ProcessorUtils.areUnique(classes));
+ assertTrue(service.areUnique(classes));
}
public void testUniquess2() throws Exception {
Class[] classes = new Class[2];
classes[0] = String.class;
classes[1] = String.class;
- assertFalse(ProcessorUtils.areUnique(classes));
+ assertFalse(service.areUnique(classes));
}
public void testUniquess3() throws Exception {
Class[] classes = new Class[1];
classes[0] = String.class;
- assertTrue(ProcessorUtils.areUnique(classes));
+ assertTrue(service.areUnique(classes));
}
public void testUniquess4() throws Exception {
@@ -50,12 +54,12 @@
classes[0] = String.class;
classes[1] = Integer.class;
classes[2] = String.class;
- assertFalse(ProcessorUtils.areUnique(classes));
+ assertFalse(service.areUnique(classes));
}
public void testUniquess5() throws Exception {
Class[] classes = new Class[0];
- assertTrue(ProcessorUtils.areUnique(classes));
+ assertTrue(service.areUnique(classes));
}
}
Propchange: incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/ImplementationProcessorServiceUniqueTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/ImplementationProcessorServiceUniqueTestCase.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/MonitorProcessorTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/MonitorProcessorTestCase.java?rev=436652&r1=436651&r2=436652&view=diff
==============================================================================
--- incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/MonitorProcessorTestCase.java (original)
+++ incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/MonitorProcessorTestCase.java Thu Aug 24 21:51:28 2006
@@ -23,17 +23,16 @@
import java.lang.reflect.Method;
import java.util.Map;
-import org.apache.tuscany.spi.implementation.java.JavaMappedService;
-
-import org.apache.tuscany.api.annotation.Monitor;
-import org.apache.tuscany.host.MonitorFactory;
-
import org.apache.tuscany.spi.implementation.java.ConstructorDefinition;
import org.apache.tuscany.spi.implementation.java.JavaMappedProperty;
import org.apache.tuscany.spi.implementation.java.JavaMappedReference;
+import org.apache.tuscany.spi.implementation.java.JavaMappedService;
import org.apache.tuscany.spi.implementation.java.PojoComponentType;
+import org.apache.tuscany.api.annotation.Monitor;
+import org.apache.tuscany.core.idl.java.InterfaceJavaIntrospectorImpl;
import org.apache.tuscany.core.injection.SingletonObjectFactory;
+import org.apache.tuscany.host.MonitorFactory;
import org.jmock.Mock;
import org.jmock.MockObjectTestCase;
@@ -132,7 +131,8 @@
protected void setUp() throws Exception {
super.setUp();
monitorFactory = mock(MonitorFactory.class);
- processor = new MonitorProcessor((MonitorFactory) monitorFactory.proxy());
+ processor = new MonitorProcessor((MonitorFactory) monitorFactory.proxy(),
+ new ImplementationProcessorServiceImpl(new InterfaceJavaIntrospectorImpl()));
}
private class Foo {
Modified: incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/PropertyProcessorTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/PropertyProcessorTestCase.java?rev=436652&r1=436651&r2=436652&view=diff
==============================================================================
--- incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/PropertyProcessorTestCase.java (original)
+++ incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/PropertyProcessorTestCase.java Thu Aug 24 21:51:28 2006
@@ -20,14 +20,14 @@
import org.osoa.sca.annotations.Property;
-import org.apache.tuscany.spi.implementation.java.JavaMappedService;
-
-import junit.framework.TestCase;
import org.apache.tuscany.spi.implementation.java.JavaMappedProperty;
import org.apache.tuscany.spi.implementation.java.JavaMappedReference;
-
+import org.apache.tuscany.spi.implementation.java.JavaMappedService;
import org.apache.tuscany.spi.implementation.java.PojoComponentType;
+import junit.framework.TestCase;
+import org.apache.tuscany.core.idl.java.InterfaceJavaIntrospectorImpl;
+
/**
* @version $Rev$ $Date$
*/
@@ -102,7 +102,7 @@
protected void setUp() throws Exception {
super.setUp();
type = new PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>>();
- processor = new PropertyProcessor();
+ processor = new PropertyProcessor(new ImplementationProcessorServiceImpl(new InterfaceJavaIntrospectorImpl()));
}
private class Foo {
Modified: incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/ReferenceProcessorTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/ReferenceProcessorTestCase.java?rev=436652&r1=436651&r2=436652&view=diff
==============================================================================
--- incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/ReferenceProcessorTestCase.java (original)
+++ incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/ReferenceProcessorTestCase.java Thu Aug 24 21:51:28 2006
@@ -20,14 +20,14 @@
import org.osoa.sca.annotations.Reference;
-import org.apache.tuscany.spi.model.ServiceContract;
-import org.apache.tuscany.spi.implementation.java.JavaMappedService;
-
-import junit.framework.TestCase;
import org.apache.tuscany.spi.implementation.java.JavaMappedProperty;
import org.apache.tuscany.spi.implementation.java.JavaMappedReference;
-
+import org.apache.tuscany.spi.implementation.java.JavaMappedService;
import org.apache.tuscany.spi.implementation.java.PojoComponentType;
+import org.apache.tuscany.spi.model.ServiceContract;
+
+import junit.framework.TestCase;
+import org.apache.tuscany.core.idl.java.InterfaceJavaIntrospectorImpl;
/**
* @version $Rev$ $Date$
@@ -36,7 +36,8 @@
PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>> type =
new PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>>();
- ReferenceProcessor processor = new ReferenceProcessor();
+ ReferenceProcessor processor =
+ new ReferenceProcessor(new InterfaceJavaIntrospectorImpl());
public void testMethodAnnotation() throws Exception {
processor.visitMethod(null, ReferenceProcessorTestCase.Foo.class.getMethod("setFoo", Ref.class), type, null);
@@ -116,7 +117,7 @@
protected void setUp() throws Exception {
super.setUp();
type = new PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>>();
- processor = new ReferenceProcessor();
+ processor = new ReferenceProcessor(new InterfaceJavaIntrospectorImpl());
}
private interface Ref {
Modified: incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/ServiceCallbackTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/ServiceCallbackTestCase.java?rev=436652&r1=436651&r2=436652&view=diff
==============================================================================
--- incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/ServiceCallbackTestCase.java (original)
+++ incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/ServiceCallbackTestCase.java Thu Aug 24 21:51:28 2006
@@ -24,19 +24,23 @@
import org.osoa.sca.annotations.Callback;
import org.osoa.sca.annotations.Service;
-import org.apache.tuscany.spi.implementation.java.JavaMappedService;
-
-import junit.framework.TestCase;
import org.apache.tuscany.spi.implementation.java.JavaMappedProperty;
import org.apache.tuscany.spi.implementation.java.JavaMappedReference;
+import org.apache.tuscany.spi.implementation.java.JavaMappedService;
import org.apache.tuscany.spi.implementation.java.PojoComponentType;
+import org.apache.tuscany.spi.implementation.java.ProcessingException;
+
+import junit.framework.TestCase;
+import org.apache.tuscany.core.idl.java.InterfaceJavaIntrospectorImpl;
+import org.apache.tuscany.core.idl.java.IllegalCallbackException;
/**
* @version $Rev$ $Date$
*/
public class ServiceCallbackTestCase extends TestCase {
- ServiceProcessor processor = new ServiceProcessor();
+ ServiceProcessor processor =
+ new ServiceProcessor(new ImplementationProcessorServiceImpl(new InterfaceJavaIntrospectorImpl()));
public void testMethodCallbackInterface() throws Exception {
PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>> type =
@@ -68,7 +72,7 @@
try {
processor.visitMethod(null, method, type, null);
fail();
- } catch (IllegalCallbackException e) {
+ } catch (IllegalCallbackReferenceException e) {
// expected
}
}
@@ -81,7 +85,7 @@
try {
processor.visitMethod(null, method, type, null);
fail();
- } catch (IllegalCallbackException e) {
+ } catch (IllegalCallbackReferenceException e) {
// expected
}
}
@@ -94,7 +98,7 @@
try {
processor.visitField(null, field, type, null);
fail();
- } catch (IllegalCallbackException e) {
+ } catch (IllegalCallbackReferenceException e) {
// expected
}
}
@@ -105,8 +109,9 @@
try {
processor.visitClass(null, BadFooImpl.class, type, null);
fail();
- } catch (IllegalCallbackException e) {
+ } catch (ProcessingException e) {
// expected
+ assertTrue(e.getCause() instanceof IllegalCallbackException);
}
}
Modified: incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/ServiceProcessorTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/ServiceProcessorTestCase.java?rev=436652&r1=436651&r2=436652&view=diff
==============================================================================
--- incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/ServiceProcessorTestCase.java (original)
+++ incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/processor/ServiceProcessorTestCase.java Thu Aug 24 21:51:28 2006
@@ -30,6 +30,8 @@
import org.apache.tuscany.spi.implementation.java.JavaMappedReference;
import org.apache.tuscany.spi.implementation.java.PojoComponentType;
+import org.apache.tuscany.core.idl.java.InterfaceJavaIntrospectorImpl;
+
/**
* @version $Rev$ $Date$
*/
@@ -88,7 +90,7 @@
protected void setUp() throws Exception {
super.setUp();
- processor = new ServiceProcessor();
+ processor = new ServiceProcessor(new ImplementationProcessorServiceImpl(new InterfaceJavaIntrospectorImpl()));
type = new PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>>();
}
Modified: incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/system/loader/SystemComponentTypeLoaderTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/system/loader/SystemComponentTypeLoaderTestCase.java?rev=436652&r1=436651&r2=436652&view=diff
==============================================================================
--- incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/system/loader/SystemComponentTypeLoaderTestCase.java (original)
+++ incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/implementation/system/loader/SystemComponentTypeLoaderTestCase.java Thu Aug 24 21:51:28 2006
@@ -19,22 +19,24 @@
package org.apache.tuscany.core.implementation.system.loader;
import org.apache.tuscany.spi.component.CompositeComponent;
+import org.apache.tuscany.spi.implementation.java.PojoComponentType;
+import org.apache.tuscany.spi.implementation.java.ProcessingException;
import org.apache.tuscany.spi.model.Property;
import org.apache.tuscany.spi.model.ReferenceDefinition;
import org.apache.tuscany.spi.model.ServiceDefinition;
+import org.apache.tuscany.core.idl.java.InterfaceJavaIntrospectorImpl;
import org.apache.tuscany.core.implementation.IntrospectionRegistryImpl;
-import org.apache.tuscany.spi.implementation.java.PojoComponentType;
-import org.apache.tuscany.spi.implementation.java.ProcessingException;
-
+import org.apache.tuscany.core.implementation.processor.ConstructorProcessor;
import org.apache.tuscany.core.implementation.processor.DestroyProcessor;
import org.apache.tuscany.core.implementation.processor.HeuristicPojoProcessor;
+import org.apache.tuscany.core.implementation.processor.ImplementationProcessorService;
+import org.apache.tuscany.core.implementation.processor.ImplementationProcessorServiceImpl;
import org.apache.tuscany.core.implementation.processor.InitProcessor;
import org.apache.tuscany.core.implementation.processor.PropertyProcessor;
import org.apache.tuscany.core.implementation.processor.ReferenceProcessor;
import org.apache.tuscany.core.implementation.processor.ScopeProcessor;
import org.apache.tuscany.core.implementation.processor.ServiceProcessor;
-import org.apache.tuscany.core.implementation.processor.ConstructorProcessor;
import org.apache.tuscany.core.implementation.system.model.SystemImplementation;
import org.apache.tuscany.core.mock.component.BasicInterface;
import org.apache.tuscany.core.mock.component.BasicInterfaceImpl;
@@ -63,16 +65,19 @@
protected void setUp() throws Exception {
super.setUp();
+ InterfaceJavaIntrospectorImpl introspector = new InterfaceJavaIntrospectorImpl();
+ ImplementationProcessorService service =
+ new ImplementationProcessorServiceImpl(introspector);
IntrospectionRegistryImpl registry = new IntrospectionRegistryImpl();
registry.setMonitor(new NullMonitorFactory().getMonitor(IntrospectionRegistryImpl.Monitor.class));
- registry.registerProcessor(new ConstructorProcessor());
+ registry.registerProcessor(new ConstructorProcessor(service));
registry.registerProcessor(new DestroyProcessor());
registry.registerProcessor(new InitProcessor());
registry.registerProcessor(new ScopeProcessor());
- registry.registerProcessor(new PropertyProcessor());
- registry.registerProcessor(new ReferenceProcessor());
- registry.registerProcessor(new ServiceProcessor());
- registry.registerProcessor(new HeuristicPojoProcessor());
+ registry.registerProcessor(new PropertyProcessor(service));
+ registry.registerProcessor(new ReferenceProcessor(introspector));
+ registry.registerProcessor(new ServiceProcessor(service));
+ registry.registerProcessor(new HeuristicPojoProcessor(service));
loader = new SystemComponentTypeLoader(registry);
}
}
Modified: incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/integration/implementation/IntrospectionRegistryIntegrationTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/integration/implementation/IntrospectionRegistryIntegrationTestCase.java?rev=436652&r1=436651&r2=436652&view=diff
==============================================================================
--- incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/integration/implementation/IntrospectionRegistryIntegrationTestCase.java (original)
+++ incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/integration/implementation/IntrospectionRegistryIntegrationTestCase.java Thu Aug 24 21:51:28 2006
@@ -24,17 +24,18 @@
import org.osoa.sca.annotations.Reference;
import org.osoa.sca.annotations.Scope;
-import static org.apache.tuscany.spi.model.Scope.MODULE;
-import org.apache.tuscany.spi.implementation.java.JavaMappedService;
-
-import junit.framework.TestCase;
-import org.apache.tuscany.core.implementation.IntrospectionRegistryImpl;
import org.apache.tuscany.spi.implementation.java.JavaMappedProperty;
import org.apache.tuscany.spi.implementation.java.JavaMappedReference;
-
+import org.apache.tuscany.spi.implementation.java.JavaMappedService;
import org.apache.tuscany.spi.implementation.java.PojoComponentType;
+import static org.apache.tuscany.spi.model.Scope.MODULE;
+import junit.framework.TestCase;
+import org.apache.tuscany.core.idl.java.InterfaceJavaIntrospectorImpl;
+import org.apache.tuscany.core.implementation.IntrospectionRegistryImpl;
import org.apache.tuscany.core.implementation.processor.DestroyProcessor;
+import org.apache.tuscany.core.implementation.processor.ImplementationProcessorService;
+import org.apache.tuscany.core.implementation.processor.ImplementationProcessorServiceImpl;
import org.apache.tuscany.core.implementation.processor.InitProcessor;
import org.apache.tuscany.core.implementation.processor.PropertyProcessor;
import org.apache.tuscany.core.implementation.processor.ReferenceProcessor;
@@ -68,8 +69,10 @@
registry.registerProcessor(new DestroyProcessor());
registry.registerProcessor(new InitProcessor());
registry.registerProcessor(new ScopeProcessor());
- registry.registerProcessor(new PropertyProcessor());
- registry.registerProcessor(new ReferenceProcessor());
+ InterfaceJavaIntrospectorImpl introspector = new InterfaceJavaIntrospectorImpl();
+ ImplementationProcessorService service = new ImplementationProcessorServiceImpl(introspector);
+ registry.registerProcessor(new PropertyProcessor(service));
+ registry.registerProcessor(new ReferenceProcessor(introspector));
}
@Scope("MODULE")
Modified: incubator/tuscany/java/sca/runtime/webapp-host/src/main/resources/META-INF/sca/implementation.scdl
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/runtime/webapp-host/src/main/resources/META-INF/sca/implementation.scdl?rev=436652&r1=436651&r2=436652&view=diff
==============================================================================
--- incubator/tuscany/java/sca/runtime/webapp-host/src/main/resources/META-INF/sca/implementation.scdl (original)
+++ incubator/tuscany/java/sca/runtime/webapp-host/src/main/resources/META-INF/sca/implementation.scdl Thu Aug 24 21:51:28 2006
@@ -24,9 +24,13 @@
-->
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
xmlns:system="http://tuscany.apache.org/xmlns/system/1.0-SNAPSHOT"
- name="org.apache.tuscany.test.Implementation">
+ name="org.apache.tuscany.webapp.Implementation">
<!-- Foundation implementation processors -->
+ <component name="implementation.ImplementationProcessorService">
+ <system:implementation.system
+ class="org.apache.tuscany.core.implementation.processor.ImplementationProcessorServiceImpl"/>
+ </component>
<component name="implementation.Constructor">
<system:implementation.system class="org.apache.tuscany.core.implementation.processor.ConstructorProcessor"/>
</component>
Modified: incubator/tuscany/java/sca/spi/src/main/java/org/apache/tuscany/spi/model/DataType.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/spi/src/main/java/org/apache/tuscany/spi/model/DataType.java?rev=436652&r1=436651&r2=436652&view=diff
==============================================================================
--- incubator/tuscany/java/sca/spi/src/main/java/org/apache/tuscany/spi/model/DataType.java (original)
+++ incubator/tuscany/java/sca/spi/src/main/java/org/apache/tuscany/spi/model/DataType.java Thu Aug 24 21:51:28 2006
@@ -18,19 +18,20 @@
*/
package org.apache.tuscany.spi.model;
-import java.util.Map;
-import java.util.HashMap;
import java.lang.reflect.Type;
+import java.util.HashMap;
+import java.util.Map;
/**
- * Representation of the type of data associated with an operation. Data is represented in two forms: the physical form used by the runtime and a
- * logical form used by the assembly. The physical form is a Java Type because the runtime is written in Java. This may be the same form used by the
- * application but it may not; for example, an application that is performing stream processing may want a physical form such as an
- * {@link java.io.InputStream InputStream} to semantially operate on application data such as a purchase order. The logical description is that used
- * by the assembly model and is an identifier into some well-known type space; examples may be a Java type represented by its Class or an XML type
- * represented by its QName. Every data type may also contain metadata describing the expected data; for example, it could specify a preferred data
- * binding technology or the size of a typical instance.
- *
+ * Representation of the type of data associated with an operation. Data is represented in two forms: the physical form
+ * used by the runtime and a logical form used by the assembly. The physical form is a Java Type because the runtime is
+ * written in Java. This may be the same form used by the application but it may not; for example, an application that
+ * is performing stream processing may want a physical form such as an {@link java.io.InputStream InputStream} to
+ * semantially operate on application data such as a purchase order. The logical description is that used by the
+ * assembly model and is an identifier into some well-known type space; examples may be a Java type represented by its
+ * Class or an XML type represented by its QName. Every data type may also contain metadata describing the expected
+ * data; for example, it could specify a preferred data binding technology or the size of a typical instance.
+ *
* @version $Rev$ $Date$
*/
public class DataType<L> extends ModelObject {
@@ -44,9 +45,9 @@
/**
* Construct a data type specifying the physical and logical types.
- *
+ *
* @param physical the physical class used by the runtime
- * @param logical the logical type
+ * @param logical the logical type
* @see #getLogical()
*/
public DataType(Type physical, L logical) {
@@ -65,7 +66,7 @@
/**
* Returns the physical type used by the runtime.
- *
+ *
* @return the physical type used by the runtime
*/
public Type getPhysical() {
@@ -73,12 +74,11 @@
}
/**
- * Returns the logical identifier used by the assembly. The type of this value identifies the logical type system in use. Known values are:
- * <ul>
- * <li>a java.lang.reflect.Type identifies a Java type by name and ClassLoader; this includes Java Classes as they are specializations of Type</li>
- * <li>a javax.xml.namespace.QName identifies an XML type by local name and namespace</li>
- * </ul>
- *
+ * Returns the logical identifier used by the assembly. The type of this value identifies the logical type system in
+ * use. Known values are: <ul> <li>a java.lang.reflect.Type identifies a Java type by name and ClassLoader; this
+ * includes Java Classes as they are specializations of Type</li> <li>a javax.xml.namespace.QName identifies an XML
+ * type by local name and namespace</li> </ul>
+ *
* @return the logical type name
*/
public L getLogical() {
@@ -87,7 +87,7 @@
/**
* Returns all metadata about this type.
- *
+ *
* @return all metadata about this type
*/
public Map<String, ?> getMetadata() {
@@ -96,7 +96,7 @@
/**
* Returns the specified metadata item or null if not present.
- *
+ *
* @param name the name of the metadata item
* @return the value, or null if not present
*/
@@ -106,8 +106,8 @@
/**
* Sets the specified metadata value. A null value undefines it.
- *
- * @param name the name of the metadata item
+ *
+ * @param name the name of the metadata item
* @param value the value, or null to undefine
* @return the old value for the item, or null if not present
*/
Modified: incubator/tuscany/java/sca/test/src/main/resources/META-INF/tuscany/implementation.scdl
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/test/src/main/resources/META-INF/tuscany/implementation.scdl?rev=436652&r1=436651&r2=436652&view=diff
==============================================================================
--- incubator/tuscany/java/sca/test/src/main/resources/META-INF/tuscany/implementation.scdl (original)
+++ incubator/tuscany/java/sca/test/src/main/resources/META-INF/tuscany/implementation.scdl Thu Aug 24 21:51:28 2006
@@ -24,9 +24,16 @@
-->
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
xmlns:system="http://tuscany.apache.org/xmlns/system/1.0-SNAPSHOT"
- name="org.apache.tuscany.launcher.Implementation">
+ name="org.apache.tuscany.test.Implementation">
<!-- Foundation implementation processors -->
+ <component name="implementation.ImplementationProcessorService">
+ <system:implementation.system
+ class="org.apache.tuscany.core.implementation.processor.ImplementationProcessorServiceImpl"/>
+ </component>
+ <component name="implementation.Constructor">
+ <system:implementation.system class="org.apache.tuscany.core.implementation.processor.ConstructorProcessor"/>
+ </component>
<component name="implementation.Destroy">
<system:implementation.system class="org.apache.tuscany.core.implementation.processor.DestroyProcessor"/>
</component>
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org