tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmar...@apache.org
Subject svn commit: r502853 [3/7] - in /incubator/tuscany/java/sca/kernel: core/src/main/java/org/apache/tuscany/core/binding/local/ core/src/main/java/org/apache/tuscany/core/bootstrap/ core/src/main/java/org/apache/tuscany/core/builder/ core/src/main/java/or...
Date Sat, 03 Feb 2007 03:16:22 GMT
Modified: incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/AbstractConnectorImplTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/AbstractConnectorImplTestCase.java?view=diff&rev=502853&r1=502852&r2=502853
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/AbstractConnectorImplTestCase.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/AbstractConnectorImplTestCase.java Fri Feb  2 19:16:15 2007
@@ -20,6 +20,7 @@
 
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Type;
+import java.net.URI;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -67,8 +68,8 @@
  * @version $Rev$ $Date$
  */
 public abstract class AbstractConnectorImplTestCase extends TestCase {
-    protected static final String TARGET = "target";
-    protected static final QualifiedName TARGET_NAME = new QualifiedName(TARGET);
+    protected static final URI TARGET = URI.create("target");
+    protected static final QualifiedName TARGET_NAME = new QualifiedName("target");
     protected static final String TARGET_SERVICE = "FooService";
     protected static final QualifiedName TARGET_SERVICE_NAME = new QualifiedName("target/FooService");
     protected static final String RESPONSE = "response";
@@ -80,7 +81,7 @@
     protected void setUp() throws Exception {
         super.setUp();
         WireService wireService = new JDKWireService(null, null);
-        connector = new ConnectorImpl(wireService, null, null, null);
+        connector = new ConnectorImpl(wireService, null, null, null, null);
         contract = new JavaServiceContract(Foo.class);
         operation = new Operation<Type>("bar", null, null, null);
     }
@@ -96,7 +97,7 @@
 
         // create the target
         AtomicComponent target = EasyMock.createMock(AtomicComponent.class);
-        EasyMock.expect(target.getName()).andReturn(TARGET).anyTimes();
+        EasyMock.expect(target.getUri()).andReturn(TARGET).anyTimes();
         EasyMock.expect(target.isOptimizable()).andReturn(false).anyTimes();
         EasyMock.expect(target.getScope()).andReturn(Scope.COMPOSITE).atLeastOnce();
         EasyMock.expect(target.isSystem()).andReturn(false).atLeastOnce();
@@ -141,7 +142,7 @@
 
     protected Service createServiceNonLocalBinding() throws WireConnectException {
         QName qName = new QName("foo", "bar");
-        ServiceBinding serviceBinding = new MockServiceBinding();
+        ServiceBinding serviceBinding = new MockServiceBinding(URI.create("foo"));
         InboundInvocationChain targetInboundChain = new InboundInvocationChainImpl(operation);
         targetInboundChain.addInterceptor(new SynchronousBridgingInterceptor());
         InboundWire serviceInboundWire = new InboundWireImpl(qName);
@@ -201,7 +202,7 @@
 
     protected ReferenceBinding createLocalReferenceBinding(QualifiedName target)
         throws TargetInvokerCreationException {
-        ReferenceBinding referenceBinding = new LocalReferenceBinding("local", null);
+        ReferenceBinding referenceBinding = new LocalReferenceBinding(URI.create("local"), null);
         InboundInvocationChain inboundChain = new InboundInvocationChainImpl(operation);
         InboundWire referenceInboundWire = new InboundWireImpl();
         referenceInboundWire.setServiceContract(contract);
@@ -228,7 +229,7 @@
         chain.addInterceptor(new SynchronousBridgingInterceptor());
         InboundWire wire = new InboundWireImpl();
         wire.setServiceContract(contract);
-        LocalReferenceBinding referenceBinding = new LocalReferenceBinding("", parent);
+        LocalReferenceBinding referenceBinding = new LocalReferenceBinding(URI.create("baz"), parent);
         wire.setContainer(referenceBinding);
         wire.addInvocationChain(operation, chain);
 

Modified: incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/AtomicConnectorTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/AtomicConnectorTestCase.java?view=diff&rev=502853&r1=502852&r2=502853
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/AtomicConnectorTestCase.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/AtomicConnectorTestCase.java Fri Feb  2 19:16:15 2007
@@ -20,6 +20,7 @@
 
 import java.util.List;
 import java.util.Map;
+import java.net.URI;
 
 import org.apache.tuscany.spi.component.AtomicComponent;
 import org.apache.tuscany.spi.component.CompositeComponent;
@@ -77,7 +78,7 @@
         outboundWire.setContainer(binding);
         inboundWire.setContainer(binding);
 
-        Service service = new ServiceImpl("foo", parent, null);
+        Service service = new ServiceImpl(URI.create("foo"), parent, null);
         service.addServiceBinding(binding);
 
         connector.connect(service);

Modified: incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/BuilderRegistryNoBindingsTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/BuilderRegistryNoBindingsTestCase.java?view=diff&rev=502853&r1=502852&r2=502853
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/BuilderRegistryNoBindingsTestCase.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/BuilderRegistryNoBindingsTestCase.java Fri Feb  2 19:16:15 2007
@@ -50,7 +50,7 @@
     public void testNoServiceBindings() throws Exception {
         ServiceBinding binding = EasyMock.createNiceMock(ServiceBinding.class);
         EasyMock.replay(binding);
-        ServiceDefinition definition = new ServiceDefinition("foo", null, false);
+        ServiceDefinition definition = new ServiceDefinition(URI.create("#foo"), null, false);
         definition.setTarget(new URI("foo"));
         Service service = registry.build(parent, definition, deploymentContext);
         assertEquals(1, service.getServiceBindings().size());
@@ -60,7 +60,7 @@
     public void testReferenceBindingBuilderDispatch() throws Exception {
         ReferenceBinding binding = EasyMock.createNiceMock(ReferenceBinding.class);
         EasyMock.replay(binding);
-        ReferenceDefinition definition = new ReferenceDefinition("foo", null, Multiplicity.ONE_ONE);
+        ReferenceDefinition definition = new ReferenceDefinition(URI.create("#foo"), null, Multiplicity.ONE_ONE);
         Reference reference = registry.build(parent, definition, deploymentContext);
         assertEquals(1, reference.getReferenceBindings().size());
         assertTrue(reference.getReferenceBindings().get(0) instanceof LocalReferenceBinding);
@@ -71,7 +71,7 @@
         deploymentContext = new RootDeploymentContext(null, null, null, null);
         parent = EasyMock.createNiceMock(CompositeComponent.class);
         EasyMock.replay(parent);
-        registry = new BuilderRegistryImpl(null, null);
+        registry = new BuilderRegistryImpl(null, null, null);
         registry.register(LocalBindingDefinition.class, new LocalBindingBuilder());
     }
 

Modified: incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/BuilderRegistryTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/BuilderRegistryTestCase.java?view=diff&rev=502853&r1=502852&r2=502853
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/BuilderRegistryTestCase.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/BuilderRegistryTestCase.java Fri Feb  2 19:16:15 2007
@@ -49,6 +49,7 @@
 import org.apache.tuscany.spi.wire.WireService;
 
 import junit.framework.TestCase;
+import org.apache.tuscany.core.component.ComponentManager;
 import org.apache.tuscany.core.deployer.RootDeploymentContext;
 import org.easymock.EasyMock;
 
@@ -62,7 +63,8 @@
 
     public void testRegistration() throws Exception {
         MockBuilder builder = new MockBuilder();
-        BuilderRegistry registry = new BuilderRegistryImpl(null, null);
+        ComponentManager componentManager = EasyMock.createNiceMock(ComponentManager.class);
+        BuilderRegistry registry = new BuilderRegistryImpl(null, null, componentManager);
         registry.register(CompositeImplementation.class, builder);
         CompositeImplementation implementation = new CompositeImplementation();
         ComponentDefinition<CompositeImplementation> componentDefinition =
@@ -79,7 +81,7 @@
         );
         EasyMock.expectLastCall().times(2);
         EasyMock.replay(wireService);
-        BuilderRegistry registry = new BuilderRegistryImpl(null, wireService);
+        BuilderRegistry registry = new BuilderRegistryImpl(null, wireService, null);
         ServiceBinding binding = EasyMock.createNiceMock(ServiceBinding.class);
         EasyMock.replay(binding);
         BindingBuilder<MockBindingDefinition> builder = EasyMock.createMock(BindingBuilder.class);
@@ -89,7 +91,7 @@
             EasyMock.isA(DeploymentContext.class))).andReturn(binding).times(2);
         EasyMock.replay(builder);
         registry.register(MockBindingDefinition.class, builder);
-        ServiceDefinition definition = new ServiceDefinition("foo", null, false);
+        ServiceDefinition definition = new ServiceDefinition(URI.create("#foo"), null, false);
         definition.addBinding(new MockBindingDefinition());
         definition.addBinding(new MockBindingDefinition());
         definition.setTarget(new URI("foo"));
@@ -106,7 +108,7 @@
         );
         EasyMock.expectLastCall().times(2);
         EasyMock.replay(wireService);
-        BuilderRegistry registry = new BuilderRegistryImpl(null, wireService);
+        BuilderRegistry registry = new BuilderRegistryImpl(null, wireService, null);
         ReferenceBinding binding = EasyMock.createNiceMock(ReferenceBinding.class);
         EasyMock.replay(binding);
         BindingBuilder<MockBindingDefinition> builder = EasyMock.createMock(BindingBuilder.class);
@@ -116,7 +118,7 @@
             EasyMock.isA(DeploymentContext.class))).andReturn(binding).times(2);
         EasyMock.replay(builder);
         registry.register(MockBindingDefinition.class, builder);
-        ReferenceDefinition definition = new ReferenceDefinition("foo", null, ONE_ONE);
+        ReferenceDefinition definition = new ReferenceDefinition(URI.create("#foo"), null, ONE_ONE);
         definition.addBinding(new MockBindingDefinition());
         definition.addBinding(new MockBindingDefinition());
         Reference reference = registry.build(parent, definition, deploymentContext);
@@ -134,7 +136,8 @@
         wireService.createWires(EasyMock.isA(AtomicComponent.class),
             EasyMock.isA(ComponentDefinition.class));
         EasyMock.replay(wireService);
-        BuilderRegistry registry = new BuilderRegistryImpl(scopeRegistry, wireService);
+        ComponentManager componentManager = EasyMock.createNiceMock(ComponentManager.class);
+        BuilderRegistry registry = new BuilderRegistryImpl(scopeRegistry, wireService, componentManager);
 
         AtomicComponent component = EasyMock.createNiceMock(AtomicComponent.class);
         EasyMock.replay(component);
@@ -147,7 +150,8 @@
 
         FooImplementation impl = new FooImplementation();
         impl.setComponentType(new ComponentType());
-        ComponentDefinition<FooImplementation> definition = new ComponentDefinition<FooImplementation>("foo", impl);
+        URI uri = URI.create("foo");
+        ComponentDefinition<FooImplementation> definition = new ComponentDefinition<FooImplementation>(uri, impl);
         Component ret = registry.build(parent, definition, deploymentContext);
         assertNotNull(ret);
         EasyMock.verify(wireService);
@@ -163,7 +167,7 @@
         wireService.createWires(EasyMock.isA(AtomicComponent.class),
             EasyMock.isA(ComponentDefinition.class));
         EasyMock.replay(wireService);
-        BuilderRegistry registry = new BuilderRegistryImpl(scopeRegistry, wireService);
+        BuilderRegistry registry = new BuilderRegistryImpl(scopeRegistry, wireService, null);
 
         AtomicComponent component = EasyMock.createNiceMock(AtomicComponent.class);
         EasyMock.replay(component);
@@ -178,7 +182,8 @@
         ComponentType componentType = new ComponentType();
         componentType.setImplementationScope(Scope.CONVERSATION);
         impl.setComponentType(componentType);
-        ComponentDefinition<FooImplementation> definition = new ComponentDefinition<FooImplementation>("foo", impl);
+        URI uri = URI.create("foo");
+        ComponentDefinition<FooImplementation> definition = new ComponentDefinition<FooImplementation>(uri, impl);
         try {
             registry.build(parent, definition, deploymentContext);
             fail("Should throw NoConversationalContractException");

Modified: incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/ConnectorPostProcessTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/ConnectorPostProcessTestCase.java?view=diff&rev=502853&r1=502852&r2=502853
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/ConnectorPostProcessTestCase.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/ConnectorPostProcessTestCase.java Fri Feb  2 19:16:15 2007
@@ -60,7 +60,7 @@
             (ServiceContract<?>) EasyMock.anyObject(), EasyMock.eq(false));
         expectLastCall().anyTimes();
         replay(wireService);
-        ConnectorImpl connector = new ConnectorImpl(wireService, registry, null, null);
+        ConnectorImpl connector = new ConnectorImpl(wireService, registry, null, null, null);
         connector.connect(iwire, owire, false);
         verify(registry);
     }
@@ -94,7 +94,7 @@
             (ServiceContract<?>) EasyMock.anyObject(), EasyMock.eq(false));
         expectLastCall().anyTimes();
         replay(wireService);
-        ConnectorImpl connector = new ConnectorImpl(wireService, registry, null, null);
+        ConnectorImpl connector = new ConnectorImpl(wireService, registry, null, null, null);
 
         connector.connect(owire, iwire, false);
         verify(registry);

Modified: incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/IllegalCallbackExceptionTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/IllegalCallbackExceptionTestCase.java?view=diff&rev=502853&r1=502852&r2=502853
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/IllegalCallbackExceptionTestCase.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/IllegalCallbackExceptionTestCase.java Fri Feb  2 19:16:15 2007
@@ -18,6 +18,8 @@
  */
 package org.apache.tuscany.core.builder;
 
+import java.net.URI;
+
 import junit.framework.TestCase;
 
 /**
@@ -26,18 +28,13 @@
 public class IllegalCallbackExceptionTestCase extends TestCase {
 
     public void testInstantiation() throws Exception {
-        IllegalCallbackException e = new IllegalCallbackException("message",
-            "identifier",
-            "source name",
-            "ref name",
-            "target name",
-            "service name");
+        URI sourceUri = URI.create("source");
+        URI targetUri = URI.create("target");
+        IllegalCallbackException e = new IllegalCallbackException("message", "identifier", sourceUri, targetUri);
         assertEquals("message", e.getMessage());
         assertEquals("identifier", e.getIdentifier());
-        assertEquals("source name", e.getSourceName());
-        assertEquals("ref name", e.getReferenceName());
-        assertEquals("target name", e.getTargetName());
-        assertEquals("service name", e.getTargetServiceName());
+        assertEquals(sourceUri, e.getSourceUri());
+        assertEquals(targetUri, e.getTargetUri());
 
     }
 }

Modified: incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/IncompatibleInterfacesExceptionTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/IncompatibleInterfacesExceptionTestCase.java?view=diff&rev=502853&r1=502852&r2=502853
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/IncompatibleInterfacesExceptionTestCase.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/IncompatibleInterfacesExceptionTestCase.java Fri Feb  2 19:16:15 2007
@@ -18,6 +18,8 @@
  */
 package org.apache.tuscany.core.builder;
 
+import java.net.URI;
+
 import junit.framework.TestCase;
 
 /**
@@ -26,16 +28,11 @@
 public class IncompatibleInterfacesExceptionTestCase extends TestCase {
 
     public void testInstantiation() throws Exception {
-        IncompatibleInterfacesException e = new IncompatibleInterfacesException("message",
-            "source name",
-            "ref name",
-            "target name",
-            "service name");
-        assertEquals("message", e.getMessage());
-        assertEquals("source name", e.getSourceName());
-        assertEquals("ref name", e.getReferenceName());
-        assertEquals("target name", e.getTargetName());
-        assertEquals("service name", e.getTargetServiceName());
-
+        URI sourceUri = URI.create("source");
+        URI targetUri = URI.create("target");
+        IncompatibleInterfacesException e = new IncompatibleInterfacesException(sourceUri, targetUri);
+        assertNotNull(e.getMessage());
+        assertEquals("source", e.getSourceUri().toString());
+        assertEquals("target", e.getTargetUri().toString());
     }
 }

Modified: incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/InvalidTargetTypeExceptionTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/InvalidTargetTypeExceptionTestCase.java?view=diff&rev=502853&r1=502852&r2=502853
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/InvalidTargetTypeExceptionTestCase.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/InvalidTargetTypeExceptionTestCase.java Fri Feb  2 19:16:15 2007
@@ -18,6 +18,8 @@
  */
 package org.apache.tuscany.core.builder;
 
+import java.net.URI;
+
 import junit.framework.TestCase;
 
 /**
@@ -26,16 +28,12 @@
 public class InvalidTargetTypeExceptionTestCase extends TestCase {
 
     public void testInstantiation() throws Exception {
-        InvalidTargetTypeException e = new InvalidTargetTypeException("message",
-            "source name",
-            "ref name",
-            "target name",
-            "service name");
+        URI sourceUri = URI.create("source");
+        URI targetUri = URI.create("target");
+        InvalidTargetTypeException e = new InvalidTargetTypeException("message", sourceUri, targetUri);
         assertEquals("message", e.getMessage());
-        assertEquals("source name", e.getSourceName());
-        assertEquals("ref name", e.getReferenceName());
-        assertEquals("target name", e.getTargetName());
-        assertEquals("service name", e.getTargetServiceName());
+        assertEquals(sourceUri, e.getSourceUri());
+        assertEquals(targetUri, e.getTargetUri());
 
     }
 }

Modified: incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/LocalReferenceWiringTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/LocalReferenceWiringTestCase.java?view=diff&rev=502853&r1=502852&r2=502853
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/LocalReferenceWiringTestCase.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/LocalReferenceWiringTestCase.java Fri Feb  2 19:16:15 2007
@@ -18,6 +18,7 @@
  */
 package org.apache.tuscany.core.builder;
 
+import java.net.URI;
 import java.util.Collections;
 
 import org.apache.tuscany.spi.QualifiedName;
@@ -55,14 +56,14 @@
     public void testConnectLocalReferenceBindingToAtomicComponentService() throws Exception {
         final AtomicComponent atomicComponent = createAtomicTarget();
         CompositeComponent topComposite = EasyMock.createMock(CompositeComponent.class);
-        topComposite.getChild(TARGET);
+        topComposite.getChild(TARGET.toString());
         EasyMock.expectLastCall().andStubAnswer(new IAnswer<Object>() {
             public Object answer() throws Throwable {
                 return atomicComponent;
             }
         });
         EasyMock.replay(topComposite);
-        CompositeComponent parent = new CompositeComponentImpl("parent", topComposite, connector, null);
+        CompositeComponent parent = new CompositeComponentImpl(URI.create("parent"), topComposite, connector, null);
         reference = createLocalReference(parent, TARGET_SERVICE_NAME);
         parent.register(reference);
         // connect to the target
@@ -85,14 +86,14 @@
     public void testConnectLocalReferenceBindingToCompositeService() throws Exception {
         final CompositeComponent topComposite = EasyMock.createMock(CompositeComponent.class);
 
-        topComposite.getInboundWire(TARGET);
+        topComposite.getInboundWire(TARGET.toString());
         EasyMock.expectLastCall().andStubAnswer(new IAnswer<Object>() {
             public Object answer() throws Throwable {
                 return createLocalInboundWire(topComposite);
             }
         });
         final Service service = createLocalService(topComposite);
-        topComposite.getChild(TARGET);
+        topComposite.getChild(TARGET.toString());
         EasyMock.expectLastCall().andStubAnswer(new IAnswer<Object>() {
             public Object answer() throws Throwable {
                 return service;
@@ -100,7 +101,7 @@
         });
         EasyMock.replay(topComposite);
 
-        CompositeComponent parent = new CompositeComponentImpl("parent", topComposite, connector, null);
+        CompositeComponent parent = new CompositeComponentImpl(URI.create("parent"), topComposite, connector, null);
         reference = createLocalReference(parent, TARGET_NAME);
         parent.register(reference);
         connector.connect(parent);
@@ -121,7 +122,7 @@
         final Service service = createServiceNonLocalBinding();
         CompositeComponent topComposite = EasyMock.createMock(CompositeComponent.class);
         EasyMock.expect(topComposite.getName()).andReturn("foo");
-        topComposite.getChild(TARGET);
+        topComposite.getChild(TARGET.toString());
         EasyMock.expectLastCall().andStubAnswer(new IAnswer<Object>() {
             public Object answer() throws Throwable {
                 return service;
@@ -129,7 +130,7 @@
         });
         EasyMock.replay(topComposite);
 
-        CompositeComponent parent = new CompositeComponentImpl("parent", topComposite, connector, null);
+        CompositeComponent parent = new CompositeComponentImpl(URI.create("parent"), topComposite, connector, null);
         reference = createLocalReference(parent, TARGET_NAME);
         parent.register(reference);
         try {
@@ -163,7 +164,7 @@
 
         CompositeComponent topComposite = EasyMock.createMock(CompositeComponent.class);
         EasyMock.expect(topComposite.getName()).andReturn("foo").atLeastOnce();
-        topComposite.getChild(TARGET);
+        topComposite.getChild(TARGET.toString());
         EasyMock.expectLastCall().andStubAnswer(new IAnswer<Object>() {
             public Object answer() throws Throwable {
                 return sibling;
@@ -171,7 +172,7 @@
         });
         EasyMock.replay(topComposite);
 
-        CompositeComponent parent = new CompositeComponentImpl("parent", topComposite, connector, null);
+        CompositeComponent parent = new CompositeComponentImpl(URI.create("parent"), topComposite, connector, null);
         reference = createLocalReference(parent, TARGET_SERVICE_NAME);
         parent.register(reference);
         parent.register(sibling);
@@ -200,7 +201,7 @@
             EasyMock.replay(sibling);
 
             CompositeComponent topComposite = EasyMock.createMock(CompositeComponent.class);
-            topComposite.getChild(TARGET);
+            topComposite.getChild(TARGET.toString());
             EasyMock.expectLastCall().andStubAnswer(new IAnswer<Object>() {
                 public Object answer() throws Throwable {
                     return sibling;
@@ -209,7 +210,7 @@
             EasyMock.expect(topComposite.getName()).andReturn("top").atLeastOnce();
             EasyMock.replay(topComposite);
 
-            CompositeComponent parent = new CompositeComponentImpl("parent", topComposite, connector, null);
+            CompositeComponent parent = new CompositeComponentImpl(URI.create("parent"), topComposite, connector, null);
 
             reference = createLocalReference(parent, TARGET_SERVICE_NAME);
             parent.register(reference);
@@ -227,7 +228,7 @@
 
     private Reference createLocalReference(CompositeComponent parent, QualifiedName target) throws Exception {
         referenceBinding = createLocalReferenceBinding(target);
-        Reference reference = new ReferenceImpl("foo", parent, contract);
+        Reference reference = new ReferenceImpl(URI.create("foo"), parent, contract);
         reference.addReferenceBinding(referenceBinding);
         return reference;
     }

Modified: incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/NonBlockingForwardNonBlockingCallbackConnectionTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/NonBlockingForwardNonBlockingCallbackConnectionTestCase.java?view=diff&rev=502853&r1=502852&r2=502853
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/NonBlockingForwardNonBlockingCallbackConnectionTestCase.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/NonBlockingForwardNonBlockingCallbackConnectionTestCase.java Fri Feb  2 19:16:15 2007
@@ -117,7 +117,7 @@
         WorkContext context = new WorkContextImpl();
         WireService wireService = new JDKWireService(null, null);
         WorkScheduler scheduler = new MockWorkScheduler();
-        connector = new ConnectorImpl(wireService, null, scheduler, context);
+        connector = new ConnectorImpl(wireService, null, null, scheduler, context);
         operation = new Operation<Type>("bar", null, null, null);
         operation.setNonBlocking(true);
         callbackOperation = new Operation<Type>("callback", null, null, null);

Modified: incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/NonBlockingForwardSyncCallbackConnectionTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/NonBlockingForwardSyncCallbackConnectionTestCase.java?view=diff&rev=502853&r1=502852&r2=502853
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/NonBlockingForwardSyncCallbackConnectionTestCase.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/NonBlockingForwardSyncCallbackConnectionTestCase.java Fri Feb  2 19:16:15 2007
@@ -117,7 +117,7 @@
         WorkContext context = new WorkContextImpl();
         WireService wireService = new JDKWireService(null, null);
         WorkScheduler scheduler = new NonBlockingForwardSyncCallbackConnectionTestCase.MockWorkScheduler();
-        connector = new ConnectorImpl(wireService, null, scheduler, context);
+        connector = new ConnectorImpl(wireService, null, null, scheduler, context);
         operation = new Operation<Type>("bar", null, null, null);
         operation.setNonBlocking(true);
         callbackOperation = new Operation<Type>("callback", null, null, null);

Modified: incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/ReferenceConnectorTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/ReferenceConnectorTestCase.java?view=diff&rev=502853&r1=502852&r2=502853
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/ReferenceConnectorTestCase.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/ReferenceConnectorTestCase.java Fri Feb  2 19:16:15 2007
@@ -18,6 +18,8 @@
  */
 package org.apache.tuscany.core.builder;
 
+import java.net.URI;
+
 import org.apache.tuscany.spi.component.AtomicComponent;
 import org.apache.tuscany.spi.component.CompositeComponent;
 import org.apache.tuscany.spi.component.Reference;
@@ -71,7 +73,7 @@
         inboundWire.setContainer(referenceBinding);
         outboundWire.setContainer(referenceBinding);
 
-        Reference reference = new ReferenceImpl("foo", parent, contract);
+        Reference reference = new ReferenceImpl(URI.create("foo"), parent, contract);
         reference.addReferenceBinding(referenceBinding);
 
         connector.connect(reference);
@@ -110,7 +112,7 @@
         inboundWire.setContainer(referenceBinding);
         outboundWire.setContainer(referenceBinding);
 
-        Reference reference = new ReferenceImpl("foo", parent, contract);
+        Reference reference = new ReferenceImpl(URI.create("foo"), parent, contract);
         reference.addReferenceBinding(referenceBinding);
 
         connector.connect(reference);

Modified: incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/ServiceConnectorTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/ServiceConnectorTestCase.java?view=diff&rev=502853&r1=502852&r2=502853
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/ServiceConnectorTestCase.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/ServiceConnectorTestCase.java Fri Feb  2 19:16:15 2007
@@ -18,6 +18,8 @@
  */
 package org.apache.tuscany.core.builder;
 
+import java.net.URI;
+
 import org.apache.tuscany.spi.component.AtomicComponent;
 import org.apache.tuscany.spi.component.CompositeComponent;
 import org.apache.tuscany.spi.component.Reference;
@@ -55,7 +57,7 @@
 
     public void testConnectServiceToAtomicComponent() throws Exception {
         configureAtomicTarget();
-        Service sourceService = new ServiceImpl("foo", parent, contract);
+        Service sourceService = new ServiceImpl(URI.create("foo"), parent, contract);
         sourceService.addServiceBinding(sourceServiceBinding);
         connector.connect(sourceService);
         Interceptor interceptor = inboundChain.getHeadInterceptor();
@@ -67,7 +69,7 @@
 
     public void testConnectServiceToChildCompositeService() throws Exception {
         configureChildCompositeServiceTarget();
-        Service sourceService = new ServiceImpl("foo", parent, contract);
+        Service sourceService = new ServiceImpl(URI.create("foo"), parent, contract);
         sourceService.addServiceBinding(sourceServiceBinding);
         connector.connect(sourceService);
         Interceptor interceptor = inboundChain.getHeadInterceptor();
@@ -79,7 +81,7 @@
 
     public void testConnectServiceToReference() throws Exception {
         configureReferenceTarget();
-        Service sourceService = new ServiceImpl("foo", parent, contract);
+        Service sourceService = new ServiceImpl(URI.create("foo"), parent, contract);
         sourceService.addServiceBinding(sourceServiceBinding);
         connector.connect(sourceService);
         Interceptor interceptor = inboundChain.getHeadInterceptor();
@@ -104,7 +106,7 @@
         outboundWire.setTargetName(TARGET_SERVICE_NAME);
         outboundWire.addInvocationChain(operation, outboundChain);
 
-        sourceServiceBinding = new MockServiceBinding();
+        sourceServiceBinding = new MockServiceBinding(URI.create("foo"));
         sourceServiceBinding.setInboundWire(inboundWire);
         sourceServiceBinding.setOutboundWire(outboundWire);
         inboundWire.setContainer(sourceServiceBinding);
@@ -130,7 +132,7 @@
         inboundWire.setContainer(atomicTarget);
 
         parent = EasyMock.createNiceMock(CompositeComponent.class);
-        EasyMock.expect(parent.getChild(TARGET)).andReturn(atomicTarget);
+        EasyMock.expect(parent.getChild(TARGET.toString())).andReturn(atomicTarget);
         EasyMock.replay(parent);
     }
 
@@ -151,7 +153,7 @@
         inboundWire.setContainer(compositeTarget);
 
         parent = EasyMock.createNiceMock(CompositeComponent.class);
-        EasyMock.expect(parent.getChild(TARGET)).andReturn(compositeTarget);
+        EasyMock.expect(parent.getChild(TARGET.toString())).andReturn(compositeTarget);
         EasyMock.replay(parent);
     }
 
@@ -164,7 +166,7 @@
         binding.getOutboundWire().getInvocationChains().get(operation).addInterceptor(new InvokerInterceptor());
         connector.connect(binding.getInboundWire(), binding.getOutboundWire(), true);
         parent = EasyMock.createNiceMock(CompositeComponent.class);
-        EasyMock.expect(parent.getChild(TARGET)).andReturn(referenceTarget);
+        EasyMock.expect(parent.getChild(TARGET.toString())).andReturn(referenceTarget);
         EasyMock.replay(parent);
     }
 

Modified: incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/SynchronousForwardCallbackConnectionTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/SynchronousForwardCallbackConnectionTestCase.java?view=diff&rev=502853&r1=502852&r2=502853
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/SynchronousForwardCallbackConnectionTestCase.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/SynchronousForwardCallbackConnectionTestCase.java Fri Feb  2 19:16:15 2007
@@ -214,7 +214,7 @@
     protected void setUp() throws Exception {
         super.setUp();
         WireService wireService = new JDKWireService(null, null);
-        connector = new ConnectorImpl(wireService, null, null, null);
+        connector = new ConnectorImpl(wireService, null, null, null, null);
         operation = new Operation<Type>("bar", null, null, null);
         callbackOperation = new Operation<Type>("callback", null, null, null);
         contract = new JavaServiceContract();

Modified: incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/TargetServiceNotFoundExceptionTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/TargetServiceNotFoundExceptionTestCase.java?view=diff&rev=502853&r1=502852&r2=502853
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/TargetServiceNotFoundExceptionTestCase.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/TargetServiceNotFoundExceptionTestCase.java Fri Feb  2 19:16:15 2007
@@ -18,6 +18,8 @@
  */
 package org.apache.tuscany.core.builder;
 
+import java.net.URI;
+
 import junit.framework.TestCase;
 
 /**
@@ -26,16 +28,11 @@
 public class TargetServiceNotFoundExceptionTestCase extends TestCase {
 
     public void testInstantiation() throws Exception {
-        TargetServiceNotFoundException e = new TargetServiceNotFoundException("message",
-            "source name",
-            "ref name",
-            "target name",
-            "service name");
+        URI sourceUri = URI.create("source");
+        URI targetUri = URI.create("target");
+        TargetServiceNotFoundException e = new TargetServiceNotFoundException("message", sourceUri, targetUri);
         assertEquals("message", e.getMessage());
-        assertEquals("source name", e.getSourceName());
-        assertEquals("ref name", e.getReferenceName());
-        assertEquals("target name", e.getTargetName());
-        assertEquals("service name", e.getTargetServiceName());
-
+        assertEquals(sourceUri, e.getSourceUri());
+        assertEquals(targetUri, e.getTargetUri());
     }
 }

Modified: incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/WiringExceptionFormatterTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/WiringExceptionFormatterTestCase.java?view=diff&rev=502853&r1=502852&r2=502853
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/WiringExceptionFormatterTestCase.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/WiringExceptionFormatterTestCase.java Fri Feb  2 19:16:15 2007
@@ -20,6 +20,7 @@
 
 import java.io.PrintWriter;
 import java.io.StringWriter;
+import java.net.URI;
 
 import org.apache.tuscany.spi.builder.WiringException;
 
@@ -34,31 +35,23 @@
     WiringExceptionFormatter formatter = new WiringExceptionFormatter(EasyMock.createNiceMock(FormatterRegistry.class));
 
     public void testFormat() throws Exception {
-        WiringException e = new MockWiringException("message",
-            "identifier",
-            "source name",
-            "ref name",
-            "target name",
-            "service name");
+        WiringException e =
+            new MockWiringException("message", "identifier", URI.create("source"), URI.create("target"));
         StringWriter writer = new StringWriter();
         PrintWriter pw = new PrintWriter(writer);
         formatter.write(pw, e);
         String buffer = writer.toString();
         assertTrue(buffer.indexOf("message") >= 0);
         assertTrue(buffer.indexOf("identifier") >= 0);
-        assertTrue(buffer.indexOf("source name") >= 0);
-        assertTrue(buffer.indexOf("ref name") >= 0);
-        assertTrue(buffer.indexOf("target name") >= 0);
-        assertTrue(buffer.indexOf("service name") >= 0);
+        assertTrue(buffer.indexOf("source") >= 0);
+        assertTrue(buffer.indexOf("target") >= 0);
     }
 
 
     public void testFormatNulls() throws Exception {
         WiringException e = new MockWiringException("message",
             "identifier",
-            "source name",
             null,
-            "target name",
             null);
         StringWriter writer = new StringWriter();
         PrintWriter pw = new PrintWriter(writer);
@@ -66,23 +59,12 @@
         String buffer = writer.toString();
         assertTrue(buffer.indexOf("message") >= 0);
         assertTrue(buffer.indexOf("identifier") >= 0);
-        assertTrue(buffer.indexOf("source name") >= 0);
-        assertTrue(buffer.indexOf("target name") >= 0);
     }
 
     private class MockWiringException extends WiringException {
 
-        public MockWiringException(String message, String
-            identifier,
-                                   String sourceName,
-                                   String referenceName,
-                                   String targetName,
-                                   String serviceName) {
-            super(message, identifier);
-            setSourceName(sourceName);
-            setReferenceName(referenceName);
-            setTargetName(targetName);
-            setTargetServiceName(serviceName);
+        public MockWiringException(String message, String identifier, URI source, URI reference) {
+            super(message, identifier, source, reference);
         }
     }
 }

Added: incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/ComponentManagerImplTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/ComponentManagerImplTestCase.java?view=auto&rev=502853
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/ComponentManagerImplTestCase.java (added)
+++ incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/ComponentManagerImplTestCase.java Fri Feb  2 19:16:15 2007
@@ -0,0 +1,135 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.core.component;
+
+import java.net.URI;
+
+import org.apache.tuscany.spi.component.Component;
+import org.apache.tuscany.spi.component.DuplicateNameException;
+
+import junit.framework.TestCase;
+import org.easymock.EasyMock;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class ComponentManagerImplTestCase extends TestCase {
+    private ComponentManager manager;
+
+    public void testRegister() throws Exception {
+        Component child = EasyMock.createMock(Component.class);
+        URI name = new URI("child");
+        EasyMock.expect(child.getUri()).andReturn(name).atLeastOnce();
+        EasyMock.replay(child);
+        manager.register(child);
+        assertEquals(child, manager.getComponent(name));
+    }
+
+    public void testRegisterDuplicate() throws Exception {
+        Component component1 = EasyMock.createMock(Component.class);
+        URI name = new URI("child");
+        EasyMock.expect(component1.getUri()).andReturn(name).atLeastOnce();
+        EasyMock.replay(component1);
+
+        Component component2 = EasyMock.createMock(Component.class);
+        EasyMock.expect(component2.getUri()).andReturn(name).atLeastOnce();
+        EasyMock.replay(component2);
+
+        manager.register(component1);
+        try {
+            manager.register(component2);
+            fail();
+        } catch (DuplicateNameException e) {
+            // expected
+        }
+    }
+
+    public void testRegisterSameNameDifferentSchemes() throws Exception {
+        Component component1 = EasyMock.createMock(Component.class);
+        URI name = new URI("foo://component");
+        EasyMock.expect(component1.getUri()).andReturn(name).atLeastOnce();
+        EasyMock.replay(component1);
+
+        Component component2 = EasyMock.createMock(Component.class);
+        URI name2 = new URI("bar://component");
+        EasyMock.expect(component2.getUri()).andReturn(name2).atLeastOnce();
+        EasyMock.replay(component2);
+
+        manager.register(component1);
+        manager.register(component2);
+    }
+
+    public void testUnRegister() throws Exception {
+        Component component = EasyMock.createMock(Component.class);
+        URI name = new URI("component");
+        EasyMock.expect(component.getUri()).andReturn(name).atLeastOnce();
+        component.removeListener(EasyMock.isA(ComponentManager.class));
+        EasyMock.replay(component);
+        manager.register(component);
+        manager.unregister(component);
+        assertNull(manager.getComponent(name));
+    }
+
+    public void testCompositeStartNotification() throws Exception {
+//        Component child1 = EasyMock.createMock(Component.class);
+//        URI name1 = new URI("sca://foo/child1");
+//        EasyMock.expect(child1.getUri()).andReturn(name1).atLeastOnce();
+//        child1.start();
+//        EasyMock.replay(child1);
+//
+//        Component child2 = EasyMock.createMock(Component.class);
+//        URI name2 = new URI("sca://foo/child2");
+//        EasyMock.expect(child2.getUri()).andReturn(name2).atLeastOnce();
+//        child2.start();
+//        EasyMock.replay(child2);
+//
+//        manager.register(child1);
+//        manager.register(child2);
+//        ComponentStart event = new ComponentStart(this, new URI("sca://foo"));
+//        manager.onEvent(event);
+//        EasyMock.verify(child1);
+//        EasyMock.verify(child2);
+    }
+
+    public void testCompositeStopNotification() throws Exception {
+//        Component child1 = EasyMock.createMock(Component.class);
+//        URI name = new URI("foo://foo/child1");
+//        EasyMock.expect(child1.getUri()).andReturn(name).atLeastOnce();
+//        child1.stop();
+//        EasyMock.replay(child1);
+//
+//        Component child2 = EasyMock.createMock(Component.class);
+//        URI name2 = new URI("foo://foo/child2");
+//        EasyMock.expect(child2.getUri()).andReturn(name2).atLeastOnce();
+//        child2.stop();
+//        EasyMock.replay(child2);
+//
+//        manager.register(child1);
+//        manager.register(child2);
+//        ComponentStop event = new ComponentStop(this, URI.create("foo://foo"));
+//        manager.onEvent(event);
+//        EasyMock.verify(child1);
+//        EasyMock.verify(child2);
+    }
+
+    protected void setUp() throws Exception {
+        super.setUp();
+        manager = new ComponentManagerImpl();
+    }
+}

Propchange: incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/ComponentManagerImplTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/ComponentManagerImplTestCase.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/event/EventTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/event/EventTestCase.java?view=diff&rev=502853&r1=502852&r2=502853
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/event/EventTestCase.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/event/EventTestCase.java Fri Feb  2 19:16:15 2007
@@ -18,26 +18,24 @@
  */
 package org.apache.tuscany.core.component.event;
 
-import org.apache.tuscany.spi.component.CompositeComponent;
+import java.net.URI;
 
 import junit.framework.TestCase;
-import org.easymock.EasyMock;
 
 /**
  * @version $Rev$ $Date$
  */
 public class EventTestCase extends TestCase {
-
-    private CompositeComponent component;
+    private URI uri = URI.create("foo");
 
     public void testCompositeStart() {
-        CompositeStart event = new CompositeStart(this, component);
-        assertEquals(component, event.getComposite());
+        ComponentStart event = new ComponentStart(this, uri);
+        assertEquals(uri, event.getComponentUri());
     }
 
     public void testCompositeStop() {
-        CompositeStop event = new CompositeStop(this, component);
-        assertEquals(component, event.getComposite());
+        ComponentStop event = new ComponentStop(this, uri);
+        assertEquals(uri, event.getComponentUri());
     }
 
     public void testHttpSessionStart() {
@@ -67,6 +65,5 @@
 
     protected void setUp() throws Exception {
         super.setUp();
-        component = EasyMock.createNiceMock(CompositeComponent.class);
     }
 }

Modified: incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/BasicCompositeScopeTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/BasicCompositeScopeTestCase.java?view=diff&rev=502853&r1=502852&r2=502853
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/BasicCompositeScopeTestCase.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/BasicCompositeScopeTestCase.java Fri Feb  2 19:16:15 2007
@@ -18,12 +18,15 @@
  */
 package org.apache.tuscany.core.component.scope;
 
+import java.net.URI;
+import java.net.URISyntaxException;
+
 import org.apache.tuscany.spi.component.AtomicComponent;
 import org.apache.tuscany.spi.component.ScopeContainer;
 import org.apache.tuscany.spi.component.TargetNotFoundException;
 
 import junit.framework.TestCase;
-import org.apache.tuscany.core.component.event.CompositeStop;
+import org.apache.tuscany.core.component.event.ComponentStop;
 import org.apache.tuscany.core.implementation.PojoConfiguration;
 import org.apache.tuscany.core.implementation.system.component.SystemAtomicComponentImpl;
 import org.apache.tuscany.core.injection.EventInvoker;
@@ -52,7 +55,7 @@
         CompositeScopeInitDestroyComponent o2 =
             (CompositeScopeInitDestroyComponent) scopeContext.getInstance(component);
         assertEquals(o1, o2);
-        scopeContext.onEvent(new CompositeStop(this, null));
+        scopeContext.onEvent(new ComponentStop(this, null));
         assertTrue(o1.isDestroyed());
         scopeContext.stop();
     }
@@ -94,7 +97,7 @@
         CompositeScopeInitDestroyComponent o2 =
             (CompositeScopeInitDestroyComponent) scopeContext.getInstance(component);
         assertSame(o1, o2);
-        scopeContext.onEvent(new CompositeStop(this, null));
+        scopeContext.onEvent(new ComponentStop(this, null));
         assertTrue(o1.isDestroyed());
         scopeContext.stop();
     }
@@ -118,7 +121,11 @@
         configuration.setInstanceFactory(factory);
         configuration.setInitInvoker(initInvoker);
         configuration.setDestroyInvoker(destroyInvoker);
-        configuration.setName("foo");
+        try {
+            configuration.setName(new URI("foo"));
+        } catch (URISyntaxException e) {
+            // will not happen
+        }
         SystemAtomicComponentImpl component = new SystemAtomicComponentImpl(configuration);
         component.setScopeContainer(scopeContainer);
         component.start();

Modified: incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/BasicConversationalScopeTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/BasicConversationalScopeTestCase.java?view=diff&rev=502853&r1=502852&r2=502853
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/BasicConversationalScopeTestCase.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/BasicConversationalScopeTestCase.java Fri Feb  2 19:16:15 2007
@@ -18,6 +18,9 @@
  */
 package org.apache.tuscany.core.component.scope;
 
+import java.net.URI;
+import java.net.URISyntaxException;
+
 import org.apache.tuscany.spi.component.AtomicComponent;
 import org.apache.tuscany.spi.component.ScopeContainer;
 import org.apache.tuscany.spi.component.WorkContext;
@@ -120,7 +123,11 @@
         configuration.setInstanceFactory(factory);
         configuration.setInitInvoker(initInvoker);
         configuration.setDestroyInvoker(destroyInvoker);
-        configuration.setName("foo");
+        try {
+            configuration.setName(new URI("foo"));
+        } catch (URISyntaxException e) {
+            // will not happen
+        }
         SystemAtomicComponentImpl component = new SystemAtomicComponentImpl(configuration);
         component.setScopeContainer(scopeContainer);
         component.start();

Modified: incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/BasicHttpSessionScopeTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/BasicHttpSessionScopeTestCase.java?view=diff&rev=502853&r1=502852&r2=502853
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/BasicHttpSessionScopeTestCase.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/BasicHttpSessionScopeTestCase.java Fri Feb  2 19:16:15 2007
@@ -18,6 +18,9 @@
  */
 package org.apache.tuscany.core.component.scope;
 
+import java.net.URI;
+import java.net.URISyntaxException;
+
 import org.apache.tuscany.spi.component.AtomicComponent;
 import org.apache.tuscany.spi.component.ScopeContainer;
 import org.apache.tuscany.spi.component.TargetNotFoundException;
@@ -136,7 +139,11 @@
         configuration.setInstanceFactory(factory);
         configuration.setInitInvoker(initInvoker);
         configuration.setDestroyInvoker(destroyInvoker);
-        configuration.setName("foo");
+        try {
+            configuration.setName(new URI("foo"));
+        } catch (URISyntaxException e) {
+            // will not happen
+        }
         SystemAtomicComponentImpl component = new SystemAtomicComponentImpl(configuration);
         component.setScopeContainer(scopeContainer);
         component.start();

Modified: incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/BasicRequestScopeTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/BasicRequestScopeTestCase.java?view=diff&rev=502853&r1=502852&r2=502853
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/BasicRequestScopeTestCase.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/BasicRequestScopeTestCase.java Fri Feb  2 19:16:15 2007
@@ -18,6 +18,9 @@
  */
 package org.apache.tuscany.core.component.scope;
 
+import java.net.URI;
+import java.net.URISyntaxException;
+
 import org.apache.tuscany.spi.component.AtomicComponent;
 import org.apache.tuscany.spi.component.ScopeContainer;
 import org.apache.tuscany.spi.component.TargetNotFoundException;
@@ -119,7 +122,11 @@
         configuration.setInstanceFactory(factory);
         configuration.setInitInvoker(initInvoker);
         configuration.setDestroyInvoker(destroyInvoker);
-        configuration.setName("foo");
+        try {
+            configuration.setName(new URI("foo"));
+        } catch (URISyntaxException e) {
+            // will not happen
+        }
         SystemAtomicComponentImpl component = new SystemAtomicComponentImpl(configuration);
         component.setScopeContainer(scopeContainer);
         component.start();

Modified: incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/BasicStatelessScopeTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/BasicStatelessScopeTestCase.java?view=diff&rev=502853&r1=502852&r2=502853
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/BasicStatelessScopeTestCase.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/BasicStatelessScopeTestCase.java Fri Feb  2 19:16:15 2007
@@ -18,6 +18,9 @@
  */
 package org.apache.tuscany.core.component.scope;
 
+import java.net.URI;
+import java.net.URISyntaxException;
+
 import org.apache.tuscany.spi.component.AtomicComponent;
 import org.apache.tuscany.spi.component.ScopeContainer;
 import org.apache.tuscany.spi.component.TargetNotFoundException;
@@ -112,7 +115,11 @@
     private AtomicComponent createComponent(ScopeContainer scopeContainer) {
         PojoConfiguration configuration = new PojoConfiguration();
         configuration.setInstanceFactory(factory);
-        configuration.setName("foo");
+        try {
+            configuration.setName(new URI("foo"));
+        } catch (URISyntaxException e) {
+            // will not happen
+        }
         AtomicComponent component = new SystemAtomicComponentImpl(configuration);
         component.setScopeContainer(scopeContainer);
         return component;

Modified: incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/CompositeScopeInitDestroyErrorTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/CompositeScopeInitDestroyErrorTestCase.java?view=diff&rev=502853&r1=502852&r2=502853
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/CompositeScopeInitDestroyErrorTestCase.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/CompositeScopeInitDestroyErrorTestCase.java Fri Feb  2 19:16:15 2007
@@ -24,8 +24,8 @@
 import org.apache.tuscany.spi.component.TargetDestructionException;
 
 import junit.framework.TestCase;
-import org.apache.tuscany.core.component.event.CompositeStart;
-import org.apache.tuscany.core.component.event.CompositeStop;
+import org.apache.tuscany.core.component.event.ComponentStart;
+import org.apache.tuscany.core.component.event.ComponentStop;
 import org.easymock.EasyMock;
 
 /**
@@ -46,7 +46,7 @@
         EasyMock.expect(component.getInitLevel()).andReturn(1);
         EasyMock.replay(component);
         scope.register(component);
-        scope.onEvent(new CompositeStart(this, null));
+        scope.onEvent(new ComponentStart(this, null));
         EasyMock.verify(monitor);
     }
 
@@ -66,8 +66,8 @@
         EasyMock.expectLastCall().andThrow(new TargetDestructionException("", ""));
         EasyMock.replay(component);
         scope.register(component);
-        scope.onEvent(new CompositeStart(this, null));
-        scope.onEvent(new CompositeStop(this, null));
+        scope.onEvent(new ComponentStart(this, null));
+        scope.onEvent(new ComponentStop(this, null));
         EasyMock.verify(monitor);
     }
 

Modified: incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/CompositeScopeInstanceLifecycleTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/CompositeScopeInstanceLifecycleTestCase.java?view=diff&rev=502853&r1=502852&r2=502853
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/CompositeScopeInstanceLifecycleTestCase.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/CompositeScopeInstanceLifecycleTestCase.java Fri Feb  2 19:16:15 2007
@@ -23,8 +23,8 @@
 import org.apache.tuscany.spi.component.TargetException;
 
 import junit.framework.TestCase;
-import org.apache.tuscany.core.component.event.CompositeStart;
-import org.apache.tuscany.core.component.event.CompositeStop;
+import org.apache.tuscany.core.component.event.ComponentStart;
+import org.apache.tuscany.core.component.event.ComponentStop;
 import org.apache.tuscany.core.mock.component.OrderedInitPojo;
 import org.apache.tuscany.core.mock.component.OrderedInitPojoImpl;
 import org.easymock.EasyMock;
@@ -53,10 +53,10 @@
         component.destroy(EasyMock.eq(comp));
         EasyMock.replay(component);
         scope.register(component);
-        scope.onEvent(new CompositeStart(this, null));
+        scope.onEvent(new ComponentStart(this, null));
         assertNotNull(scope.getInstance(component));
         // expire composite
-        scope.onEvent(new CompositeStop(this, null));
+        scope.onEvent(new ComponentStop(this, null));
         scope.stop();
         EasyMock.verify(component);
     }
@@ -77,9 +77,9 @@
         initDestroyComponent.destroy(EasyMock.eq(comp));
         EasyMock.replay(initDestroyComponent);
         scope.register(initDestroyComponent);
-        scope.onEvent(new CompositeStart(this, null));
+        scope.onEvent(new ComponentStart(this, null));
         // expire composite
-        scope.onEvent(new CompositeStop(this, null));
+        scope.onEvent(new ComponentStop(this, null));
         scope.stop();
         EasyMock.verify(initDestroyComponent);
     }
@@ -96,7 +96,7 @@
         AtomicComponent threeComponent = createComponent(0);
         scope.register(threeComponent);
 
-        scope.onEvent(new CompositeStart(this, null));
+        scope.onEvent(new ComponentStart(this, null));
         OrderedInitPojo one = (OrderedInitPojo) scope.getInstance(oneComponent);
         assertNotNull(one);
         assertEquals(1, one.getNumberInstantiated());
@@ -113,7 +113,7 @@
         assertEquals(3, three.getInitOrder());
 
         // expire composite
-        scope.onEvent(new CompositeStop(this, null));
+        scope.onEvent(new ComponentStop(this, null));
         assertEquals(0, one.getNumberInstantiated());
         scope.stop();
         EasyMock.verify(oneComponent);
@@ -132,7 +132,7 @@
         AtomicComponent threeComponent = createComponent(1);
         scope.register(threeComponent);
 
-        scope.onEvent(new CompositeStart(this, null));
+        scope.onEvent(new ComponentStart(this, null));
         OrderedInitPojo one = (OrderedInitPojo) scope.getInstance(oneComponent);
         assertNotNull(one);
 
@@ -143,7 +143,7 @@
         assertNotNull(three);
 
         // expire composite
-        scope.onEvent(new CompositeStop(this, null));
+        scope.onEvent(new ComponentStop(this, null));
         assertEquals(0, one.getNumberInstantiated());
         scope.stop();
         EasyMock.verify(oneComponent);

Modified: incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/CompositeScopeRestartTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/CompositeScopeRestartTestCase.java?view=diff&rev=502853&r1=502852&r2=502853
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/CompositeScopeRestartTestCase.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/CompositeScopeRestartTestCase.java Fri Feb  2 19:16:15 2007
@@ -19,12 +19,13 @@
 package org.apache.tuscany.core.component.scope;
 
 import java.lang.reflect.Constructor;
+import java.net.URI;
 
 import org.apache.tuscany.spi.component.AtomicComponent;
 
 import junit.framework.TestCase;
-import org.apache.tuscany.core.component.event.CompositeStart;
-import org.apache.tuscany.core.component.event.CompositeStop;
+import org.apache.tuscany.core.component.event.ComponentStart;
+import org.apache.tuscany.core.component.event.ComponentStop;
 import org.apache.tuscany.core.implementation.PojoConfiguration;
 import org.apache.tuscany.core.implementation.system.component.SystemAtomicComponentImpl;
 import org.apache.tuscany.core.injection.MethodEventInvoker;
@@ -49,24 +50,24 @@
         configuration.setDestroyInvoker(destroyInvoker);
         Constructor<InitDestroyOnce> ctr = InitDestroyOnce.class.getConstructor((Class<?>[]) null);
         configuration.setInstanceFactory(new PojoObjectFactory<InitDestroyOnce>(ctr));
-        configuration.setName("InitDestroy");
+        configuration.setName(new URI("InitDestroy"));
         AtomicComponent component = new SystemAtomicComponentImpl(configuration);
         component.setScopeContainer(scope);
         component.start();
 
-        scope.onEvent(new CompositeStart(this, null));
+        scope.onEvent(new ComponentStart(this, null));
         Object instance = component.getTargetInstance();
         assertSame(instance, component.getTargetInstance());
 
-        scope.onEvent(new CompositeStop(this, null));
+        scope.onEvent(new ComponentStop(this, null));
         scope.stop();
         component.stop();
 
         scope.start();
-        scope.onEvent(new CompositeStart(this, null));
+        scope.onEvent(new ComponentStart(this, null));
         component.start();
         assertNotSame(instance, component.getTargetInstance());
-        scope.onEvent(new CompositeStop(this, null));
+        scope.onEvent(new ComponentStop(this, null));
         scope.stop();
         component.stop();
     }

Modified: incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/ConversationalScopeRestartTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/ConversationalScopeRestartTestCase.java?view=diff&rev=502853&r1=502852&r2=502853
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/ConversationalScopeRestartTestCase.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/ConversationalScopeRestartTestCase.java Fri Feb  2 19:16:15 2007
@@ -19,6 +19,7 @@
 package org.apache.tuscany.core.component.scope;
 
 import java.lang.reflect.Constructor;
+import java.net.URI;
 
 import org.apache.tuscany.spi.component.AtomicComponent;
 import org.apache.tuscany.spi.component.WorkContext;
@@ -60,7 +61,7 @@
         configuration.setDestroyInvoker(destroyInvoker);
         Constructor<InitDestroyOnce> ctr = InitDestroyOnce.class.getConstructor((Class<?>[]) null);
         configuration.setInstanceFactory(new PojoObjectFactory<InitDestroyOnce>(ctr));
-        configuration.setName("InitDestroy");
+        configuration.setName(new URI("InitDestroy"));
         AtomicComponent component = new SystemAtomicComponentImpl(configuration);
         component.setScopeContainer(scope);
         component.start();

Modified: incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/DependencyLifecycleTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/DependencyLifecycleTestCase.java?view=diff&rev=502853&r1=502852&r2=502853
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/DependencyLifecycleTestCase.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/DependencyLifecycleTestCase.java Fri Feb  2 19:16:15 2007
@@ -26,8 +26,8 @@
 
 import junit.framework.TestCase;
 import org.apache.tuscany.core.component.WorkContextImpl;
-import org.apache.tuscany.core.component.event.CompositeStart;
-import org.apache.tuscany.core.component.event.CompositeStop;
+import org.apache.tuscany.core.component.event.ComponentStart;
+import org.apache.tuscany.core.component.event.ComponentStop;
 import org.apache.tuscany.core.component.event.HttpSessionEnd;
 import org.apache.tuscany.core.component.event.RequestEnd;
 import org.apache.tuscany.core.component.event.RequestStart;
@@ -46,26 +46,26 @@
     public void testInitDestroyOrderCompositeScope() throws Exception {
         CompositeScopeContainer scopeCtx = new CompositeScopeContainer(null);
         scopeCtx.start();
-        Map<String, AtomicComponent> contexts = MockFactory.createWiredComponents("source",
+        Map<String, AtomicComponent> components = MockFactory.createWiredComponents("source",
             OrderedDependentPojoImpl.class,
             scopeCtx,
             "target",
             OrderedInitPojoImpl.class,
             scopeCtx);
-        for (AtomicComponent component : contexts.values()) {
+        for (AtomicComponent component : components.values()) {
             scopeCtx.register(component);
         }
-        AtomicComponent sourceComponent = contexts.get("source");
-        AtomicComponent targetComponent = contexts.get("target");
+        AtomicComponent sourceComponent = components.get("source");
+        AtomicComponent targetComponent = components.get("target");
         scopeCtx.register(sourceComponent);
         scopeCtx.register(targetComponent);
-        scopeCtx.onEvent(new CompositeStart(this, null));
+        scopeCtx.onEvent(new ComponentStart(this, null));
         OrderedDependentPojo source = (OrderedDependentPojo) scopeCtx.getInstance(sourceComponent);
         OrderedInitPojo target = (OrderedInitPojo) scopeCtx.getInstance(targetComponent);
         assertNotNull(source.getPojo());
         assertNotNull(target);
         assertEquals(2, source.getNumberInstantiated());
-        scopeCtx.onEvent(new CompositeStop(this, null));
+        scopeCtx.onEvent(new ComponentStop(this, null));
         assertEquals(0, source.getNumberInstantiated());
         scopeCtx.stop();
     }
@@ -81,7 +81,7 @@
             scopeCtx);
         AtomicComponent sourceComponent = contexts.get("source");
         AtomicComponent targetComponent = contexts.get("target");
-        scopeCtx.onEvent(new CompositeStart(this, null));
+        scopeCtx.onEvent(new ComponentStart(this, null));
         scopeCtx.register(sourceComponent);
         scopeCtx.register(targetComponent);
         OrderedDependentPojo source = (OrderedDependentPojo) scopeCtx.getInstance(sourceComponent);
@@ -89,7 +89,7 @@
         assertNotNull(source.getPojo());
         assertNotNull(target);
         assertEquals(2, source.getNumberInstantiated());
-        scopeCtx.onEvent(new CompositeStop(this, null));
+        scopeCtx.onEvent(new ComponentStop(this, null));
         assertEquals(0, source.getNumberInstantiated());
         scopeCtx.stop();
     }

Modified: incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/HttpSessionScopeRestartTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/HttpSessionScopeRestartTestCase.java?view=diff&rev=502853&r1=502852&r2=502853
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/HttpSessionScopeRestartTestCase.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/HttpSessionScopeRestartTestCase.java Fri Feb  2 19:16:15 2007
@@ -19,6 +19,7 @@
 package org.apache.tuscany.core.component.scope;
 
 import java.lang.reflect.Constructor;
+import java.net.URI;
 
 import org.apache.tuscany.spi.component.AtomicComponent;
 import org.apache.tuscany.spi.component.WorkContext;
@@ -53,7 +54,7 @@
         configuration.setDestroyInvoker(destroyInvoker);
         Constructor<InitDestroyOnce> ctr = InitDestroyOnce.class.getConstructor((Class<?>[]) null);
         configuration.setInstanceFactory(new PojoObjectFactory<InitDestroyOnce>(ctr));
-        configuration.setName("InitDestroy");
+        configuration.setName(new URI("InitDestroy"));
         AtomicComponent component = new SystemAtomicComponentImpl(configuration);
         component.setScopeContainer(scope);
         component.start();

Modified: incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/MockFactory.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/MockFactory.java?view=diff&rev=502853&r1=502852&r2=502853
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/MockFactory.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/MockFactory.java Fri Feb  2 19:16:15 2007
@@ -19,6 +19,8 @@
 package org.apache.tuscany.core.component.scope;
 
 import java.lang.reflect.Method;
+import java.net.URI;
+import java.net.URISyntaxException;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -26,7 +28,6 @@
 import org.osoa.sca.annotations.EagerInit;
 import org.osoa.sca.annotations.Init;
 
-import org.apache.tuscany.spi.QualifiedName;
 import org.apache.tuscany.spi.component.AtomicComponent;
 import org.apache.tuscany.spi.component.ScopeContainer;
 import org.apache.tuscany.spi.idl.java.JavaServiceContract;
@@ -55,7 +56,7 @@
                                                                      String target,
                                                                      Class<?> targetClass,
                                                                      ScopeContainer targetScopeContainer)
-        throws NoSuchMethodException {
+        throws NoSuchMethodException, URISyntaxException {
 
         Map<String, AtomicComponent> components = new HashMap<String, AtomicComponent>();
         AtomicComponent targetComponent = createAtomicComponent(target, targetScopeContainer, targetClass);
@@ -93,17 +94,16 @@
         }
 
         sourceConfig.addReferenceSite(setter.getName(), setter);
-        sourceConfig.setName(source);
+        sourceConfig.setName(new URI(source));
         AtomicComponent sourceComponent = new SystemAtomicComponentImpl(sourceConfig);
         sourceComponent.setScopeContainer(sourceScopeContainer);
-        QualifiedName targetName = new QualifiedName(target);
         OutboundWire wire = new OutboundWireImpl();
-        wire.setReferenceName(setter.getName());
+        wire.setUri(URI.create("#" + setter.getName()));
         wire.setServiceContract(new JavaServiceContract(targetClass));
         InboundWire inboundWire = new InboundWireImpl();
         inboundWire.setContainer(targetComponent);
         inboundWire.setServiceContract(new JavaServiceContract(targetClass));
-        inboundWire.setServiceName(targetName.getPortName());
+        inboundWire.setUri(URI.create("#" + target));
         wire.setTargetWire(inboundWire);
         sourceComponent.addOutboundWire(wire);
         components.put(source, sourceComponent);
@@ -113,7 +113,7 @@
 
     @SuppressWarnings("unchecked")
     public static AtomicComponent createAtomicComponent(String name, ScopeContainer container, Class<?> clazz)
-        throws NoSuchMethodException {
+        throws NoSuchMethodException, URISyntaxException {
         PojoConfiguration configuration = new PojoConfiguration();
         configuration.setInstanceFactory(new PojoObjectFactory(clazz.getConstructor()));
         EagerInit eager = clazz.getAnnotation(EagerInit.class);
@@ -128,7 +128,7 @@
                 configuration.setDestroyInvoker(new MethodEventInvoker<Object>(method));
             }
         }
-        configuration.setName(name);
+        configuration.setName(new URI(name));
         AtomicComponent component = new SystemAtomicComponentImpl(configuration);
         component.setScopeContainer(container);
         return component;

Modified: incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/RequestScopeRestartTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/RequestScopeRestartTestCase.java?view=diff&rev=502853&r1=502852&r2=502853
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/RequestScopeRestartTestCase.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/RequestScopeRestartTestCase.java Fri Feb  2 19:16:15 2007
@@ -19,6 +19,7 @@
 package org.apache.tuscany.core.component.scope;
 
 import java.lang.reflect.Constructor;
+import java.net.URI;
 
 import org.apache.tuscany.spi.component.AtomicComponent;
 import org.apache.tuscany.spi.component.WorkContext;
@@ -51,7 +52,7 @@
         configuration.setDestroyInvoker(destroyInvoker);
         Constructor<InitDestroyOnce> ctr = InitDestroyOnce.class.getConstructor((Class<?>[]) null);
         configuration.setInstanceFactory(new PojoObjectFactory<InitDestroyOnce>(ctr));
-        configuration.setName("InitDestroy");
+        configuration.setName(new URI("InitDestroy"));
         AtomicComponent component = new SystemAtomicComponentImpl(configuration);
         component.setScopeContainer(scope);
         component.start();

Modified: incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/databinding/impl/PassByValueWirePostProcessorTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/databinding/impl/PassByValueWirePostProcessorTestCase.java?view=diff&rev=502853&r1=502852&r2=502853
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/databinding/impl/PassByValueWirePostProcessorTestCase.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/databinding/impl/PassByValueWirePostProcessorTestCase.java Fri Feb  2 19:16:15 2007
@@ -22,6 +22,7 @@
 import java.lang.reflect.Type;
 import java.util.Hashtable;
 import java.util.Map;
+import java.net.URI;
 
 import org.apache.tuscany.spi.ObjectCreationException;
 import org.apache.tuscany.spi.component.TargetResolutionException;
@@ -158,7 +159,7 @@
     private class FooComponent extends AtomicComponentExtension {
 
         public FooComponent() {
-            super(null, null, null, null, null, null, 0);
+            super(URI.create("foo"), null, null, null, null, null, 0);
         }
 
         public Object createInstance() throws ObjectCreationException {

Modified: incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/deployer/BootstrapDeployerTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/deployer/BootstrapDeployerTestCase.java?view=diff&rev=502853&r1=502852&r2=502853
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/deployer/BootstrapDeployerTestCase.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/deployer/BootstrapDeployerTestCase.java Fri Feb  2 19:16:15 2007
@@ -19,6 +19,7 @@
 package org.apache.tuscany.core.deployer;
 
 import java.net.URL;
+import java.net.URI;
 import java.util.Collection;
 import java.util.Map;
 import javax.xml.stream.XMLInputFactory;
@@ -46,10 +47,13 @@
 import org.apache.tuscany.core.implementation.system.model.SystemCompositeImplementation;
 import org.apache.tuscany.core.mock.component.BasicInterface;
 import org.apache.tuscany.core.monitor.NullMonitorFactory;
+import org.apache.tuscany.core.component.ComponentManager;
+import org.apache.tuscany.core.component.ComponentManagerImpl;
 import static org.easymock.EasyMock.createNiceMock;
 import static org.easymock.EasyMock.isA;
 import static org.easymock.EasyMock.replay;
 import static org.easymock.EasyMock.verify;
+import org.easymock.EasyMock;
 
 /**
  * Verifies the default boostrap deployer
@@ -65,6 +69,9 @@
     @SuppressWarnings("unchecked")
     public void testBoot1Load() throws LoaderException {
         CompositeComponent parent = createNiceMock(CompositeComponent.class);
+        URI uri = URI.create("parent");
+        EasyMock.expect(parent.getUri()).andReturn(uri).atLeastOnce();
+        EasyMock.replay(parent);
         URL scdl = BootstrapDeployerTestCase.class.getResource("boot1.scdl");
         implementation.setScdlLocation(scdl);
         deployer.load(parent, componentDefinition, deploymentContext);
@@ -80,7 +87,7 @@
         assertEquals(2, services.size()); // included counts
         ServiceDefinition serviceDefinition = services.get("service");
         assertNotNull(serviceDefinition);
-        assertEquals("service", serviceDefinition.getName());
+        assertEquals("parent#service", serviceDefinition.getUri().toString());
         assertEquals(BasicInterface.class, serviceDefinition.getServiceContract().getInterfaceClass());
         Collection<BindingDefinition> bindings = serviceDefinition.getBindings();
         assertTrue(bindings.isEmpty());
@@ -113,10 +120,12 @@
         URL scdl = BootstrapDeployerTestCase.class.getResource("boot1.scdl");
         implementation.setScdlLocation(scdl);
         CompositeComponent parent = createNiceMock(CompositeComponent.class);
+        URI uri = URI.create("parent");
+        EasyMock.expect(parent.getUri()).andReturn(uri).atLeastOnce();
         parent.register(isA(SCAObject.class));
         replay(parent);
         // load the boot1 file using the bootstrap deployer
-        componentDefinition.setName("simple");
+        componentDefinition.setName(new URI("simple"));
         Component component = deployer.deploy(parent, componentDefinition);
         assertNotNull(component);
         verify(parent);
@@ -126,11 +135,13 @@
         URL scdl = BootstrapDeployerTestCase.class.getResource("boot2.scdl");
         implementation.setScdlLocation(scdl);
         CompositeComponent parent = createNiceMock(CompositeComponent.class);
+        URI uri = URI.create("parent");
+        EasyMock.expect(parent.getUri()).andReturn(uri).atLeastOnce();
         parent.register(isA(SCAObject.class));
         replay(parent);
 
         // load the boot2 file using the bootstrap deployer
-        componentDefinition.setName("newDeployer");
+        componentDefinition.setName(new URI("newDeployer"));
         CompositeComponent component = (CompositeComponent) deployer.deploy(parent, componentDefinition);
         assertNotNull(component);
         verify(parent);
@@ -157,7 +168,8 @@
     protected void setUp() throws Exception {
         super.setUp();
         XMLInputFactory xmlFactory = XMLInputFactory.newInstance();
-        Bootstrapper bootstrapper = new DefaultBootstrapper(new NullMonitorFactory(), xmlFactory, null);
+        ComponentManager manager = new ComponentManagerImpl();
+        Bootstrapper bootstrapper = new DefaultBootstrapper(new NullMonitorFactory(), xmlFactory, manager, null);
         deployer = (DeployerImpl) bootstrapper.createDeployer();
         deploymentContext = new RootDeploymentContext(null, xmlFactory, null, null);
         implementation = new SystemCompositeImplementation();

Modified: incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/PojoAtomicComponentTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/PojoAtomicComponentTestCase.java?view=diff&rev=502853&r1=502852&r2=502853
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/PojoAtomicComponentTestCase.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/PojoAtomicComponentTestCase.java Fri Feb  2 19:16:15 2007
@@ -18,6 +18,8 @@
  */
 package org.apache.tuscany.core.implementation;
 
+import java.net.URI;
+
 import org.apache.tuscany.spi.ObjectFactory;
 import org.apache.tuscany.spi.component.AtomicComponent;
 import org.apache.tuscany.spi.component.TargetInvokerCreationException;
@@ -41,6 +43,7 @@
     @SuppressWarnings({"unchecked"})
     public void testDestroy() throws Exception {
         PojoConfiguration config = new PojoConfiguration();
+        config.setName(URI.create("foo"));
         config.setInstanceFactory(factory);
         EventInvoker<Object> invoker = EasyMock.createMock(EventInvoker.class);
         invoker.invokeEvent(EasyMock.notNull());
@@ -55,6 +58,7 @@
     @SuppressWarnings({"unchecked"})
     public void testInit() throws Exception {
         PojoConfiguration config = new PojoConfiguration();
+        config.setName(URI.create("foo"));
         config.setInstanceFactory(factory);
         EventInvoker<Object> invoker = EasyMock.createMock(EventInvoker.class);
         invoker.invokeEvent(EasyMock.notNull());
@@ -67,6 +71,7 @@
 
     public void testOptimizable() throws Exception {
         PojoConfiguration config = new PojoConfiguration();
+        config.setName(URI.create("foo"));
         config.setInstanceFactory(factory);
         TestAtomicComponent component = new TestAtomicComponent(config);
         assertTrue(component.isOptimizable());
@@ -76,6 +81,7 @@
     public void testDestroyableButOptimizable() throws Exception {
         PojoConfiguration config = new PojoConfiguration();
         config.setInstanceFactory(factory);
+        config.setName(URI.create("foo"));
         EventInvoker<Object> invoker = EasyMock.createMock(EventInvoker.class);
         invoker.invokeEvent(EasyMock.notNull());
         EasyMock.replay(invoker);
@@ -87,6 +93,7 @@
     @SuppressWarnings({"unchecked"})
     public void testStatelessOptimizable() throws Exception {
         PojoConfiguration config = new PojoConfiguration();
+        config.setName(URI.create("foo"));
         config.setInstanceFactory(factory);
         TestStatelessAtomicComponent component = new TestStatelessAtomicComponent(config);
         assertTrue(component.isOptimizable());
@@ -96,6 +103,7 @@
     public void testNotOptimizable() throws Exception {
         PojoConfiguration config = new PojoConfiguration();
         config.setInstanceFactory(factory);
+        config.setName(URI.create("foo"));
         EventInvoker<Object> invoker = EasyMock.createMock(EventInvoker.class);
         invoker.invokeEvent(EasyMock.notNull());
         EasyMock.replay(invoker);



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org


Mime
View raw message