tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmar...@apache.org
Subject svn commit: r416333 [5/5] - in /incubator/tuscany/sandbox/jboynes/sca: containers/ containers/container.groovy/src/test/java/org/apache/tuscany/container/groovy/ containers/container.java/ core2/src/main/java/org/apache/tuscany/core/bootstrap/ core2/sr...
Date Thu, 22 Jun 2006 11:20:33 GMT
Added: incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/java/integration/component/ScopeReferenceTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/java/integration/component/ScopeReferenceTestCase.java?rev=416333&view=auto
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/java/integration/component/ScopeReferenceTestCase.java (added)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/java/integration/component/ScopeReferenceTestCase.java Thu Jun 22 04:20:25 2006
@@ -0,0 +1,757 @@
+/**
+ * 
+ * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ * 
+ * Licensed 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.implementation.java.integration.component;
+
+import java.lang.reflect.Member;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.Executor;
+import java.util.concurrent.Executors;
+import java.util.concurrent.FutureTask;
+
+import org.apache.tuscany.spi.component.AtomicComponent;
+import org.apache.tuscany.spi.component.ScopeContainer;
+import org.apache.tuscany.spi.component.WorkContext;
+
+import junit.framework.TestCase;
+import org.apache.tuscany.core.implementation.java.mock.MockFactory;
+import org.apache.tuscany.core.implementation.java.mock.components.Source;
+import org.apache.tuscany.core.implementation.java.mock.components.SourceImpl;
+import org.apache.tuscany.core.implementation.java.mock.components.Target;
+import org.apache.tuscany.core.implementation.java.mock.components.TargetImpl;
+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.HttpSessionEnd;
+import org.apache.tuscany.core.component.event.HttpSessionStart;
+import org.apache.tuscany.core.component.event.RequestEnd;
+import org.apache.tuscany.core.component.event.RequestStart;
+import org.apache.tuscany.core.component.scope.HttpSessionScopeContainer;
+import org.apache.tuscany.core.component.scope.ModuleScopeContainer;
+import org.apache.tuscany.core.component.scope.RequestScopeContainer;
+import org.apache.tuscany.core.component.scope.StatelessScopeContainer;
+import org.apache.tuscany.core.util.JavaIntrospectionHelper;
+
+/**
+ * Tests scoping is properly handled for service references
+ *
+ * @version $Rev: 415162 $ $Date: 2006-06-18 11:19:43 -0700 (Sun, 18 Jun 2006) $
+ */
+public class ScopeReferenceTestCase extends TestCase {
+
+    private Map<String, Member> members;
+
+    /**
+     * Tests a module-to-module scoped wire
+     */
+    @SuppressWarnings("unchecked")
+    public void testModuleToModule() throws Exception {
+        ScopeContainer scope = new ModuleScopeContainer(null);
+        scope.start();
+
+        Map<String, AtomicComponent> contexts = MockFactory.createWiredContexts("source", SourceImpl.class,
+            scope, members, "target", Target.class, TargetImpl.class, scope);
+        scope.onEvent(new CompositeStart(this, null));
+        AtomicComponent<Source> sourceComponent = (AtomicComponent<Source>) contexts.get("source");
+        AtomicComponent<Target> targetComponent = (AtomicComponent<Target>) contexts.get("target");
+        Source source = sourceComponent.getServiceInstance();
+        Target target = targetComponent.getServiceInstance();
+        assertNull(source.getTarget().getString());
+        assertNull(target.getString());
+        target.setString("foo");
+        assertTrue(Proxy.isProxyClass(source.getTarget().getClass()));
+        assertEquals("foo", source.getTarget().getString());
+        scope.onEvent(new CompositeStop(this, null));
+        scope.stop();
+    }
+
+    /**
+     * Tests a module-to-session scoped wire is setup properly by the runtime
+     */
+    @SuppressWarnings("unchecked")
+    public void testModuleToSession() throws Exception {
+        WorkContext ctx = new WorkContextImpl();
+        ScopeContainer moduleScope = new ModuleScopeContainer(ctx);
+        moduleScope.start();
+        ScopeContainer sessionScope = new HttpSessionScopeContainer(ctx);
+        sessionScope.start();
+
+        Map<String, AtomicComponent> contexts = MockFactory.createWiredContexts("source", SourceImpl.class,
+            moduleScope, members, "target", Target.class, TargetImpl.class, sessionScope);
+        moduleScope.onEvent(new CompositeStart(this, null));
+        Object session1 = new Object();
+        ctx.setIdentifier(HttpSessionScopeContainer.HTTP_IDENTIFIER, session1);
+        sessionScope.onEvent(new HttpSessionStart(this, session1));
+        AtomicComponent<Source> sourceComponent = (AtomicComponent<Source>) contexts.get("source");
+        AtomicComponent<Target> targetComponent = (AtomicComponent<Target>) contexts.get("target");
+        Source source = sourceComponent.getServiceInstance();
+        Target target = targetComponent.getServiceInstance();
+        assertNull(source.getTarget().getString());
+        assertNull(target.getString());
+        target.setString("foo");
+        assertTrue(Proxy.isProxyClass(source.getTarget().getClass()));
+        assertEquals("foo", source.getTarget().getString());
+        ctx.clearIdentifier(HttpSessionScopeContainer.HTTP_IDENTIFIER);
+        sessionScope.onEvent(new HttpSessionEnd(this, session1));
+
+        //second session
+        Object session2 = new Object();
+        ctx.setIdentifier(HttpSessionScopeContainer.HTTP_IDENTIFIER, session2);
+        sessionScope.onEvent(new HttpSessionStart(this, session2));
+
+        Target target2 = targetComponent.getServiceInstance();
+        assertFalse("foo".equals(target2.getString()));
+
+        assertFalse("foo".equals(source.getTarget().getString()));
+        source.getTarget().setString("bar");
+        assertEquals("bar", target2.getString());
+        assertEquals("bar", source.getTarget().getString());
+        sessionScope.onEvent(new HttpSessionEnd(this, session2));
+
+        ctx.clearIdentifier(HttpSessionScopeContainer.HTTP_IDENTIFIER);
+        moduleScope.onEvent(new CompositeStop(this, null));
+        sessionScope.stop();
+        moduleScope.stop();
+    }
+
+    /**
+     * Tests a module-to-request scoped wire
+     */
+    @SuppressWarnings("unchecked")
+    public void testModuleToRequest() throws Exception {
+        WorkContext ctx = new WorkContextImpl();
+        ScopeContainer moduleScope = new ModuleScopeContainer(ctx);
+        moduleScope.start();
+        final ScopeContainer requestScope = new RequestScopeContainer(ctx);
+        requestScope.start();
+
+        Map<String, AtomicComponent> contexts = MockFactory.createWiredContexts("source", SourceImpl.class,
+            moduleScope, members, "target", Target.class, TargetImpl.class, requestScope);
+        moduleScope.onEvent(new CompositeStart(this, null));
+        requestScope.onEvent(new RequestStart(this));
+
+        AtomicComponent<Source> sourceComponent = (AtomicComponent<Source>) contexts.get("source");
+        final AtomicComponent<Target> targetComponent = (AtomicComponent<Target>) contexts.get("target");
+        final Source source = sourceComponent.getServiceInstance();
+        Target target = targetComponent.getServiceInstance();
+        assertNull(source.getTarget().getString());
+        assertNull(target.getString());
+        target.setString("foo");
+        assertTrue(Proxy.isProxyClass(source.getTarget().getClass()));
+        assertEquals("foo", source.getTarget().getString());
+
+        // spin off another request
+        Executor executor = Executors.newSingleThreadExecutor();
+        FutureTask<Void> future = new FutureTask<Void>(new Runnable() {
+            public void run() {
+                requestScope.onEvent(new RequestStart(this));
+                Target target2 = targetComponent.getServiceInstance();
+                assertFalse("foo".equals(target2.getString()));
+                assertFalse("foo".equals(source.getTarget().getString()));
+                source.getTarget().setString("bar");
+                assertEquals("bar", target2.getString());
+                assertEquals("bar", source.getTarget().getString());
+                requestScope.onEvent(new RequestEnd(this));
+            }
+        }, null);
+        executor.execute(future);
+        future.get();
+        assertEquals("foo", source.getTarget().getString());
+        requestScope.onEvent(new RequestEnd(this));
+        moduleScope.onEvent(new CompositeStop(this, null));
+        requestScope.stop();
+        moduleScope.stop();
+    }
+
+    /**
+     * Tests a module-to-stateless scoped wire is setup properly by the runtime
+     */
+    @SuppressWarnings("unchecked")
+    public void testModuleToStateless() throws Exception {
+        WorkContext ctx = new WorkContextImpl();
+        ScopeContainer moduleScope = new ModuleScopeContainer(ctx);
+        moduleScope.start();
+        ScopeContainer statelessScope = new StatelessScopeContainer(ctx);
+        statelessScope.start();
+
+        Map<String, AtomicComponent> contexts = MockFactory.createWiredContexts("source", SourceImpl.class,
+            moduleScope, members, "target", Target.class, TargetImpl.class, statelessScope);
+        moduleScope.onEvent(new CompositeStart(this, null));
+
+        AtomicComponent<Source> sourceComponent = (AtomicComponent<Source>) contexts.get("source");
+        AtomicComponent<Target> targetComponent = (AtomicComponent<Target>) contexts.get("target");
+        Source source = sourceComponent.getServiceInstance();
+        Target target = targetComponent.getServiceInstance();
+        assertTrue(Proxy.isProxyClass(source.getTarget().getClass()));
+        assertNull(source.getTarget().getString());
+        assertNull(target.getString());
+        target.setString("foo");
+        assertFalse("foo".equals(source.getTarget().getString()));
+        Target target2 = targetComponent.getServiceInstance();
+        assertFalse("foo".equals(target2.getString()));
+        source.getTarget().setString("bar");
+        assertFalse("bar".equals(source.getTarget().getString()));
+        moduleScope.onEvent(new CompositeStop(this, null));
+        moduleScope.stop();
+        statelessScope.stop();
+    }
+
+
+    /**
+     * Tests a session-to-session scoped wire
+     */
+    @SuppressWarnings("unchecked")
+    public void testSessionToSession() throws Exception {
+        WorkContext ctx = new WorkContextImpl();
+        ScopeContainer sessionScope = new HttpSessionScopeContainer(ctx);
+        sessionScope.start();
+
+        Map<String, AtomicComponent> contexts = MockFactory.createWiredContexts("source", SourceImpl.class,
+            sessionScope, members, "target", Target.class, TargetImpl.class, sessionScope);
+
+        Object session1 = new Object();
+        ctx.setIdentifier(HttpSessionScopeContainer.HTTP_IDENTIFIER, session1);
+        sessionScope.onEvent(new HttpSessionStart(this, session1));
+        AtomicComponent<Source> sourceComponent = (AtomicComponent<Source>) contexts.get("source");
+        AtomicComponent<Target> targetComponent = (AtomicComponent<Target>) contexts.get("target");
+        Source source = sourceComponent.getServiceInstance();
+        Target target = targetComponent.getServiceInstance();
+        source.getTarget().setString("foo");
+        source.getTarget().setString("foo");
+        assertEquals("foo", target.getString());
+
+        ctx.clearIdentifier(HttpSessionScopeContainer.HTTP_IDENTIFIER);
+        sessionScope.onEvent(new HttpSessionEnd(this, session1));
+
+        //second session
+        Object session2 = new Object();
+        ctx.setIdentifier(HttpSessionScopeContainer.HTTP_IDENTIFIER, session2);
+        sessionScope.onEvent(new HttpSessionStart(this, session2));
+
+        Source source2 = sourceComponent.getServiceInstance();
+        assertNotNull(source2);
+        Target target2 = targetComponent.getServiceInstance();
+
+        assertNotNull(target2);
+        assertNull(target2.getString());
+        assertEquals(null, source2.getTarget().getString());
+        source2.getTarget().setString("baz");
+        assertEquals("baz", source2.getTarget().getString());
+        assertEquals("baz", target2.getString());
+        ctx.clearIdentifier(HttpSessionScopeContainer.HTTP_IDENTIFIER);
+        sessionScope.onEvent(new HttpSessionEnd(this, session2));
+        sessionScope.stop();
+    }
+
+
+    /**
+     * Tests a session-to-module scoped wire
+     */
+    @SuppressWarnings("unchecked")
+    public void testSessionToModule() throws Exception {
+        WorkContext ctx = new WorkContextImpl();
+        ScopeContainer moduleScope = new ModuleScopeContainer(ctx);
+        moduleScope.start();
+        ScopeContainer sessionScope = new HttpSessionScopeContainer(ctx);
+        sessionScope.start();
+
+        Map<String, AtomicComponent> contexts = MockFactory.createWiredContexts("source", SourceImpl.class,
+            sessionScope, members, "target", Target.class, TargetImpl.class, moduleScope);
+        moduleScope.onEvent(new CompositeStart(this, null));
+        Object session1 = new Object();
+        ctx.setIdentifier(HttpSessionScopeContainer.HTTP_IDENTIFIER, session1);
+        sessionScope.onEvent(new HttpSessionStart(this, session1));
+        AtomicComponent<Source> sourceComponent = (AtomicComponent<Source>) contexts.get("source");
+        AtomicComponent<Target> targetComponent = (AtomicComponent<Target>) contexts.get("target");
+        Source source = sourceComponent.getServiceInstance();
+        Target target = targetComponent.getServiceInstance();
+        assertNull(source.getTarget().getString());
+        assertNull(target.getString());
+        target.setString("foo");
+        assertTrue(Proxy.isProxyClass(source.getTarget().getClass()));
+        assertEquals("foo", source.getTarget().getString());
+        ctx.clearIdentifier(HttpSessionScopeContainer.HTTP_IDENTIFIER);
+        sessionScope.onEvent(new HttpSessionEnd(this, session1));
+
+        //second session
+        Object session2 = new Object();
+        ctx.setIdentifier(HttpSessionScopeContainer.HTTP_IDENTIFIER, session2);
+        sessionScope.onEvent(new HttpSessionStart(this, session2));
+
+        Target target2 = targetComponent.getServiceInstance();
+        Source source2 = sourceComponent.getServiceInstance();
+        assertEquals("foo", target2.getString());
+        assertEquals("foo", source2.getTarget().getString());
+        source2.getTarget().setString("baz");
+        assertEquals("baz", source2.getTarget().getString());
+        assertEquals("baz", target2.getString());
+        assertEquals("baz", target.getString());
+        ctx.clearIdentifier(HttpSessionScopeContainer.HTTP_IDENTIFIER);
+        sessionScope.onEvent(new HttpSessionEnd(this, session2));
+        moduleScope.stop();
+        sessionScope.stop();
+    }
+
+    /**
+     * Tests a session-to-request scoped wire is setup properly by the runtime
+     */
+    @SuppressWarnings("unchecked")
+    public void testSessionToRequest() throws Exception {
+        WorkContext ctx = new WorkContextImpl();
+        final ScopeContainer requestScope = new RequestScopeContainer(ctx);
+        requestScope.start();
+        ScopeContainer sessionScope = new HttpSessionScopeContainer(ctx);
+        sessionScope.start();
+
+        Map<String, AtomicComponent> contexts = MockFactory.createWiredContexts("source", SourceImpl.class,
+            sessionScope, members, "target", Target.class, TargetImpl.class, requestScope);
+        Object session1 = new Object();
+        ctx.setIdentifier(HttpSessionScopeContainer.HTTP_IDENTIFIER, session1);
+        sessionScope.onEvent(new HttpSessionStart(this, session1));
+        requestScope.onEvent(new RequestStart(this));
+        AtomicComponent<Source> sourceComponent = (AtomicComponent<Source>) contexts.get("source");
+        final AtomicComponent<Target> targetComponent = (AtomicComponent<Target>) contexts.get("target");
+        final Source source = sourceComponent.getServiceInstance();
+        Target target = targetComponent.getServiceInstance();
+        assertNull(source.getTarget().getString());
+        assertNull(target.getString());
+        target.setString("foo");
+        assertTrue(Proxy.isProxyClass(source.getTarget().getClass()));
+        assertEquals("foo", source.getTarget().getString());
+
+        // spin off another request
+        Executor executor = Executors.newSingleThreadExecutor();
+        FutureTask<Void> future = new FutureTask<Void>(new Runnable() {
+            public void run() {
+                requestScope.onEvent(new RequestStart(this));
+                Target target2 = targetComponent.getServiceInstance();
+                assertFalse("foo".equals(target2.getString()));
+                assertFalse("foo".equals(source.getTarget().getString()));
+                source.getTarget().setString("bar");
+                assertEquals("bar", target2.getString());
+                assertEquals("bar", source.getTarget().getString());
+                requestScope.onEvent(new RequestEnd(this));
+            }
+        }, null);
+        executor.execute(future);
+        future.get();
+        assertEquals("foo", source.getTarget().getString());
+        requestScope.onEvent(new RequestEnd(this));
+        ctx.clearIdentifier(HttpSessionScopeContainer.HTTP_IDENTIFIER);
+        sessionScope.onEvent(new HttpSessionEnd(this, session1));
+        requestScope.stop();
+        sessionScope.stop();
+    }
+
+
+    /**
+     * Tests a session-to-stateless scoped wire is setup properly by the runtime
+     */
+    @SuppressWarnings("unchecked")
+    public void testSessionToStateless() throws Exception {
+        WorkContext ctx = new WorkContextImpl();
+        ScopeContainer sessionScope = new HttpSessionScopeContainer(ctx);
+        sessionScope.start();
+        ScopeContainer statelessScope = new StatelessScopeContainer(ctx);
+        statelessScope.start();
+
+        Map<String, AtomicComponent> contexts = MockFactory.createWiredContexts("source", SourceImpl.class,
+            sessionScope, members, "target", Target.class, TargetImpl.class, statelessScope);
+
+        Object session1 = new Object();
+        ctx.setIdentifier(HttpSessionScopeContainer.HTTP_IDENTIFIER, session1);
+        sessionScope.onEvent(new HttpSessionStart(this, session1));
+
+        AtomicComponent<Source> sourceComponent = (AtomicComponent<Source>) contexts.get("source");
+        AtomicComponent<Target> targetComponent = (AtomicComponent<Target>) contexts.get("target");
+        Source source = sourceComponent.getServiceInstance();
+        Target target = targetComponent.getServiceInstance();
+        assertTrue(Proxy.isProxyClass(source.getTarget().getClass()));
+        assertNull(source.getTarget().getString());
+        assertNull(target.getString());
+        target.setString("foo");
+        assertFalse("foo".equals(source.getTarget().getString()));
+        Target target2 = targetComponent.getServiceInstance();
+        assertFalse("foo".equals(target2.getString()));
+        source.getTarget().setString("bar");
+        assertFalse("bar".equals(source.getTarget().getString()));
+
+        ctx.clearIdentifier(HttpSessionScopeContainer.HTTP_IDENTIFIER);
+        sessionScope.onEvent(new HttpSessionEnd(this, session1));
+        sessionScope.stop();
+        statelessScope.stop();
+    }
+
+    /**
+     * Tests a request-to-request scoped wire is setup properly by the runtime
+     */
+    @SuppressWarnings("unchecked")
+    public void testRequestToRequest() throws Exception {
+        WorkContext ctx = new WorkContextImpl();
+        final ScopeContainer requestScope = new RequestScopeContainer(ctx);
+        requestScope.start();
+
+        Map<String, AtomicComponent> contexts = MockFactory.createWiredContexts("source", SourceImpl.class,
+            requestScope, members, "target", Target.class, TargetImpl.class, requestScope);
+        requestScope.onEvent(new RequestStart(this));
+
+        final AtomicComponent<Source> sourceComponent = (AtomicComponent<Source>) contexts.get("source");
+        final AtomicComponent<Target> targetComponent = (AtomicComponent<Target>) contexts.get("target");
+        Source source = sourceComponent.getServiceInstance();
+        Target target = targetComponent.getServiceInstance();
+        assertNull(source.getTarget().getString());
+        assertNull(target.getString());
+        target.setString("foo");
+        assertTrue(Proxy.isProxyClass(source.getTarget().getClass()));
+        assertEquals("foo", source.getTarget().getString());
+
+        // spin off another request
+        Executor executor = Executors.newSingleThreadExecutor();
+        FutureTask<Void> future = new FutureTask<Void>(new Runnable() {
+            public void run() {
+                requestScope.onEvent(new RequestStart(this));
+                Source source2 = sourceComponent.getServiceInstance();
+                Target target2 = targetComponent.getServiceInstance();
+                assertFalse("foo".equals(target2.getString()));
+                assertFalse("foo".equals(source2.getTarget().getString()));
+                source2.getTarget().setString("bar");
+                assertEquals("bar", target2.getString());
+                assertEquals("bar", source2.getTarget().getString());
+                requestScope.onEvent(new RequestEnd(this));
+            }
+        }, null);
+        executor.execute(future);
+        future.get();
+        requestScope.onEvent(new RequestEnd(this));
+        requestScope.stop();
+    }
+
+    /**
+     * Tests a request-to-module scoped wire
+     */
+    @SuppressWarnings("unchecked")
+    public void testRequestToModule() throws Exception {
+        WorkContext ctx = new WorkContextImpl();
+        final ScopeContainer requestScope = new RequestScopeContainer(ctx);
+        final ScopeContainer moduleScope = new ModuleScopeContainer(ctx);
+        requestScope.start();
+        moduleScope.start();
+        moduleScope.onEvent(new CompositeStart(this, null));
+
+        Map<String, AtomicComponent> contexts = MockFactory.createWiredContexts("source", SourceImpl.class,
+            requestScope, members, "target", Target.class, TargetImpl.class, moduleScope);
+        requestScope.onEvent(new RequestStart(this));
+
+        final AtomicComponent<Source> sourceComponent = (AtomicComponent<Source>) contexts.get("source");
+        final AtomicComponent<Target> targetComponent = (AtomicComponent<Target>) contexts.get("target");
+        Source source = sourceComponent.getServiceInstance();
+        Target target = targetComponent.getServiceInstance();
+        assertNull(source.getTarget().getString());
+        assertNull(target.getString());
+        target.setString("foo");
+        assertTrue(Proxy.isProxyClass(source.getTarget().getClass()));
+        assertEquals("foo", source.getTarget().getString());
+
+        // spin off another request
+        Executor executor = Executors.newSingleThreadExecutor();
+        FutureTask<Void> future = new FutureTask<Void>(new Runnable() {
+            public void run() {
+                requestScope.onEvent(new RequestStart(this));
+                Source source2 = sourceComponent.getServiceInstance();
+                Target target2 = targetComponent.getServiceInstance();
+                assertEquals("foo", target2.getString());
+                assertEquals("foo", source2.getTarget().getString());
+                source2.getTarget().setString("bar");
+                assertEquals("bar", target2.getString());
+                assertEquals("bar", source2.getTarget().getString());
+                requestScope.onEvent(new RequestEnd(this));
+            }
+        }, null);
+        executor.execute(future);
+        future.get();
+        assertEquals("bar", target.getString());
+
+        requestScope.onEvent(new RequestEnd(this));
+        requestScope.stop();
+        moduleScope.onEvent(new CompositeStop(this, null));
+        moduleScope.stop();
+    }
+
+    /**
+     * Tests a request-to-session scoped wire is setup properly by the runtime
+     */
+    @SuppressWarnings("unchecked")
+    public void testRequestToSession() throws Exception {
+        WorkContext ctx = new WorkContextImpl();
+        final ScopeContainer requestScope = new RequestScopeContainer(ctx);
+        final ScopeContainer sessionScope = new HttpSessionScopeContainer(ctx);
+        requestScope.start();
+        sessionScope.start();
+
+        Object session1 = new Object();
+        ctx.setIdentifier(HttpSessionScopeContainer.HTTP_IDENTIFIER, session1);
+        sessionScope.onEvent(new HttpSessionStart(this, session1));
+        Map<String, AtomicComponent> contexts = MockFactory.createWiredContexts("source", SourceImpl.class,
+            requestScope, members, "target", Target.class, TargetImpl.class, sessionScope);
+
+        final AtomicComponent<Source> sourceComponent = (AtomicComponent<Source>) contexts.get("source");
+        final AtomicComponent<Target> targetComponent = (AtomicComponent<Target>) contexts.get("target");
+        requestScope.onEvent(new RequestStart(this));
+        Source source = sourceComponent.getServiceInstance();
+        Target target = targetComponent.getServiceInstance();
+        assertNull(source.getTarget().getString());
+        assertNull(target.getString());
+        target.setString("foo");
+        assertTrue(Proxy.isProxyClass(source.getTarget().getClass()));
+        assertEquals("foo", source.getTarget().getString());
+
+        // spin off another request
+        Executor executor = Executors.newSingleThreadExecutor();
+        FutureTask<Void> future = new FutureTask<Void>(new Runnable() {
+            public void run() {
+                requestScope.onEvent(new RequestStart(this));
+                Source source2 = sourceComponent.getServiceInstance();
+                Target target2 = targetComponent.getServiceInstance();
+                assertEquals("foo", target2.getString());
+                assertEquals("foo", source2.getTarget().getString());
+                source2.getTarget().setString("bar");
+                assertEquals("bar", target2.getString());
+                assertEquals("bar", source2.getTarget().getString());
+                requestScope.onEvent(new RequestEnd(this));
+            }
+        }, null);
+        executor.execute(future);
+        future.get();
+        assertEquals("bar", target.getString());
+
+        requestScope.onEvent(new RequestEnd(this));
+        requestScope.stop();
+        ctx.clearIdentifier(HttpSessionScopeContainer.HTTP_IDENTIFIER);
+        sessionScope.onEvent(new HttpSessionEnd(this, session1));
+        sessionScope.stop();
+    }
+
+
+    /**
+     * Tests a request-to-stateless scoped wire is setup properly by the runtime
+     */
+    @SuppressWarnings("unchecked")
+    public void testRequestToStateless() throws Exception {
+        WorkContext ctx = new WorkContextImpl();
+        ScopeContainer requestScope = new RequestScopeContainer(ctx);
+        requestScope.start();
+        ScopeContainer statelessScope = new StatelessScopeContainer(ctx);
+        statelessScope.start();
+
+        Map<String, AtomicComponent> contexts = MockFactory.createWiredContexts("source", SourceImpl.class,
+            requestScope, members, "target", Target.class, TargetImpl.class, statelessScope);
+
+        AtomicComponent<Source> sourceComponent = (AtomicComponent<Source>) contexts.get("source");
+        AtomicComponent<Target> targetComponent = (AtomicComponent<Target>) contexts.get("target");
+        requestScope.onEvent(new RequestStart(this));
+        Source source = sourceComponent.getServiceInstance();
+        Target target = targetComponent.getServiceInstance();
+        assertTrue(Proxy.isProxyClass(source.getTarget().getClass()));
+        assertNull(source.getTarget().getString());
+        assertNull(target.getString());
+        target.setString("foo");
+        assertFalse("foo".equals(source.getTarget().getString()));
+        Target target2 = targetComponent.getServiceInstance();
+        assertFalse("foo".equals(target2.getString()));
+        source.getTarget().setString("bar");
+        assertFalse("bar".equals(source.getTarget().getString()));
+        requestScope.onEvent(new RequestEnd(this));
+        requestScope.stop();
+        statelessScope.stop();
+    }
+
+
+    /**
+     * Tests a stateless-to-stateless scoped wire is setup properly by the runtime
+     */
+    @SuppressWarnings("unchecked")
+    public void testStatelessToStateless() throws Exception {
+        WorkContext ctx = new WorkContextImpl();
+        ScopeContainer statelessScope = new StatelessScopeContainer(ctx);
+        statelessScope.start();
+
+        Map<String, AtomicComponent> contexts = MockFactory.createWiredContexts("source", SourceImpl.class,
+            statelessScope, members, "target", Target.class, TargetImpl.class, statelessScope);
+
+        AtomicComponent<Source> sourceComponent = (AtomicComponent<Source>) contexts.get("source");
+        AtomicComponent<Target> targetComponent = (AtomicComponent<Target>) contexts.get("target");
+        Source source = sourceComponent.getServiceInstance();
+        Target target = targetComponent.getServiceInstance();
+        assertTrue(Proxy.isProxyClass(source.getTarget().getClass()));
+        assertNull(source.getTarget().getString());
+        assertNull(target.getString());
+        target.setString("foo");
+        assertFalse("foo".equals(source.getTarget().getString()));
+        Target target2 = targetComponent.getServiceInstance();
+        assertFalse("foo".equals(target2.getString()));
+        source.getTarget().setString("bar");
+        assertFalse("bar".equals(source.getTarget().getString()));
+        statelessScope.stop();
+    }
+
+    /**
+     * Tests a stateless-to-request scoped wire is setup properly by the runtime
+     */
+    @SuppressWarnings("unchecked")
+    public void testStatelessToRequest() throws Exception {
+        WorkContext ctx = new WorkContextImpl();
+        final ScopeContainer requestScope = new RequestScopeContainer(ctx);
+        requestScope.start();
+        ScopeContainer statelessScope = new StatelessScopeContainer(ctx);
+        statelessScope.start();
+
+        Map<String, AtomicComponent> contexts = MockFactory.createWiredContexts("source", SourceImpl.class,
+            statelessScope, members, "target", Target.class, TargetImpl.class, requestScope);
+        requestScope.onEvent(new RequestStart(this));
+        AtomicComponent<Source> sourceComponent = (AtomicComponent<Source>) contexts.get("source");
+        final AtomicComponent<Target> targetComponent = (AtomicComponent<Target>) contexts.get("target");
+        final Source source = sourceComponent.getServiceInstance();
+        Target target = targetComponent.getServiceInstance();
+        assertNull(source.getTarget().getString());
+        assertNull(target.getString());
+        target.setString("foo");
+        assertTrue(Proxy.isProxyClass(source.getTarget().getClass()));
+        assertEquals("foo", source.getTarget().getString());
+
+        // spin off another request
+        Executor executor = Executors.newSingleThreadExecutor();
+        FutureTask<Void> future = new FutureTask<Void>(new Runnable() {
+            public void run() {
+                requestScope.onEvent(new RequestStart(this));
+                Target target2 = targetComponent.getServiceInstance();
+                assertFalse("foo".equals(target2.getString()));
+                assertFalse("foo".equals(source.getTarget().getString()));
+                source.getTarget().setString("bar");
+                assertEquals("bar", target2.getString());
+                assertEquals("bar", source.getTarget().getString());
+                requestScope.onEvent(new RequestEnd(this));
+            }
+        }, null);
+        executor.execute(future);
+        future.get();
+        requestScope.stop();
+        statelessScope.stop();
+    }
+
+    /**
+     * Tests a stateless-to-session scoped wire is setup properly by the runtime
+     */
+    @SuppressWarnings("unchecked")
+    public void testStatelessToSession() throws Exception {
+        WorkContext ctx = new WorkContextImpl();
+        ScopeContainer statelessScope = new StatelessScopeContainer(ctx);
+        statelessScope.start();
+        ScopeContainer sessionScope = new HttpSessionScopeContainer(ctx);
+        sessionScope.start();
+
+        Map<String, AtomicComponent> contexts = MockFactory.createWiredContexts("source", SourceImpl.class,
+            statelessScope, members, "target", Target.class, TargetImpl.class, sessionScope);
+        Object session1 = new Object();
+        ctx.setIdentifier(HttpSessionScopeContainer.HTTP_IDENTIFIER, session1);
+        sessionScope.onEvent(new HttpSessionStart(this, session1));
+        AtomicComponent<Source> sourceComponent = (AtomicComponent<Source>) contexts.get("source");
+        AtomicComponent<Target> targetComponent = (AtomicComponent<Target>) contexts.get("target");
+        Source source = sourceComponent.getServiceInstance();
+        Target target = targetComponent.getServiceInstance();
+        assertNull(source.getTarget().getString());
+        assertNull(target.getString());
+        target.setString("foo");
+        assertTrue(Proxy.isProxyClass(source.getTarget().getClass()));
+        assertEquals("foo", source.getTarget().getString());
+        ctx.clearIdentifier(HttpSessionScopeContainer.HTTP_IDENTIFIER);
+        sessionScope.onEvent(new HttpSessionEnd(this, session1));
+
+        //second session
+        Object session2 = new Object();
+        ctx.setIdentifier(HttpSessionScopeContainer.HTTP_IDENTIFIER, session2);
+        sessionScope.onEvent(new HttpSessionStart(this, session2));
+
+        Target target2 = targetComponent.getServiceInstance();
+        assertFalse("foo".equals(target2.getString()));
+
+        assertFalse("foo".equals(source.getTarget().getString()));
+        source.getTarget().setString("bar");
+        assertEquals("bar", target2.getString());
+        assertEquals("bar", source.getTarget().getString());
+        sessionScope.onEvent(new HttpSessionEnd(this, session2));
+
+        ctx.clearIdentifier(HttpSessionScopeContainer.HTTP_IDENTIFIER);
+        sessionScope.stop();
+        statelessScope.stop();
+    }
+
+
+    /**
+     * Tests a stateless-to-module scoped wire is setup properly by the runtime
+     */
+    @SuppressWarnings("unchecked")
+    public void testStatelessToModule() throws Exception {
+        WorkContext ctx = new WorkContextImpl();
+        ScopeContainer statelessScope = new StatelessScopeContainer(ctx);
+        statelessScope.start();
+        ScopeContainer moduleScope = new ModuleScopeContainer(ctx);
+        moduleScope.start();
+
+        Map<String, AtomicComponent> contexts = MockFactory.createWiredContexts("source", SourceImpl.class,
+            statelessScope, members, "target", Target.class, TargetImpl.class, moduleScope);
+        moduleScope.onEvent(new CompositeStart(this, null));
+        AtomicComponent<Source> sourceComponent = (AtomicComponent<Source>) contexts.get("source");
+        AtomicComponent<Target> targetComponent = (AtomicComponent<Target>) contexts.get("target");
+        Source source = sourceComponent.getServiceInstance();
+        Target target = targetComponent.getServiceInstance();
+        assertNull(source.getTarget().getString());
+        assertNull(target.getString());
+        target.setString("foo");
+        assertTrue(Proxy.isProxyClass(source.getTarget().getClass()));
+        assertEquals("foo", source.getTarget().getString());
+
+        //second session
+        Object session2 = new Object();
+        ctx.setIdentifier(HttpSessionScopeContainer.HTTP_IDENTIFIER, session2);
+        moduleScope.onEvent(new HttpSessionStart(this, session2));
+
+        Target target2 = targetComponent.getServiceInstance();
+        assertEquals("foo", target2.getString());
+
+        assertEquals("foo", source.getTarget().getString());
+        source.getTarget().setString("bar");
+        assertEquals("bar", target2.getString());
+        assertEquals("bar", source.getTarget().getString());
+
+        moduleScope.onEvent(new CompositeStop(this, null));
+        moduleScope.stop();
+        statelessScope.stop();
+    }
+
+    protected void setUp() throws Exception {
+        super.setUp();
+        members = new HashMap<String, Member>();
+        Method[] methods = SourceImpl.class.getMethods();
+        for (Method method : methods) {
+            if (method.getName().startsWith("set")) {
+                members.put(JavaIntrospectionHelper.toPropertyName(method.getName()), method);
+            }
+        }
+    }
+
+
+}
+

Propchange: incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/java/integration/component/ScopeReferenceTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/java/integration/component/ScopeReferenceTestCase.java
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/java/mock/MockFactory.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/java/mock/MockFactory.java?rev=416333&view=auto
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/java/mock/MockFactory.java (added)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/java/mock/MockFactory.java Thu Jun 22 04:20:25 2006
@@ -0,0 +1,346 @@
+package org.apache.tuscany.core.implementation.java.mock;
+
+import java.lang.reflect.Member;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.tuscany.spi.builder.BuilderConfigException;
+import org.apache.tuscany.spi.component.AtomicComponent;
+import org.apache.tuscany.core.implementation.PojoConfiguration;
+import org.apache.tuscany.spi.component.ScopeContainer;
+import org.apache.tuscany.core.injection.PojoObjectFactory;
+import org.apache.tuscany.spi.model.Scope;
+import org.apache.tuscany.spi.wire.InboundInvocationChain;
+import org.apache.tuscany.spi.wire.InboundWire;
+import org.apache.tuscany.spi.wire.Interceptor;
+import org.apache.tuscany.spi.wire.MessageHandler;
+import org.apache.tuscany.spi.wire.OutboundInvocationChain;
+import org.apache.tuscany.spi.wire.OutboundWire;
+import org.apache.tuscany.spi.wire.TargetInvoker;
+import org.apache.tuscany.spi.wire.WireService;
+
+import org.apache.tuscany.core.implementation.java.JavaAtomicComponent;
+import org.apache.tuscany.core.implementation.java.JavaTargetInvoker;
+import org.apache.tuscany.core.util.MethodHashMap;
+import org.apache.tuscany.core.wire.InboundInvocationChainImpl;
+import org.apache.tuscany.core.wire.InboundWireImpl;
+import org.apache.tuscany.core.wire.InvokerInterceptor;
+import org.apache.tuscany.core.wire.MessageChannelImpl;
+import org.apache.tuscany.core.wire.OutboundInvocationChainImpl;
+import org.apache.tuscany.core.wire.OutboundWireImpl;
+import org.apache.tuscany.core.wire.jdk.JDKWireService;
+
+/**
+ * @version $$Rev: 415162 $$ $$Date: 2006-06-18 11:19:43 -0700 (Sun, 18 Jun 2006) $$
+ */
+public final class MockFactory {
+
+    private static final WireService WIRE_SERVICE = new JDKWireService();
+
+    private MockFactory() {
+    }
+
+    @SuppressWarnings("unchecked")
+    public static JavaAtomicComponent<?> createJavaAtomicContext(String name,
+                                                                 ScopeContainer scopeContainer,
+                                                                 Class<?> clazz,
+                                                                 Scope scope)
+        throws NoSuchMethodException {
+        scope.compareTo(scope); //FXIME
+        PojoConfiguration configuration = new PojoConfiguration();
+        configuration.setScopeContainer(scopeContainer);
+        configuration.setObjectFactory(new PojoObjectFactory(clazz.getConstructor()));
+        configuration.addServiceInterface(clazz);
+        configuration.setWireService(WIRE_SERVICE);
+        return new JavaAtomicComponent(name, configuration);
+
+    }
+
+    /**
+     * Wires two contexts together where the reference interface is the same as target service
+     *
+     * @param sourceName
+     * @param sourceClass
+     * @param sourceScope
+     * @param members
+     * @param targetName
+     * @param targetService
+     * @param targetClass
+     * @param targetScope
+     * @return
+     * @throws Exception
+     */
+    public static Map<String, AtomicComponent> createWiredContexts(String sourceName,
+                                                                   Class<?> sourceClass,
+                                                                   ScopeContainer sourceScope,
+                                                                   Map<String, Member> members,
+                                                                   String targetName,
+                                                                   Class<?> targetService,
+                                                                   Class<?> targetClass,
+                                                                   ScopeContainer targetScope) throws Exception {
+        return createWiredComponents(sourceName, sourceClass, targetService, sourceScope, members, targetName,
+            targetService, targetClass, targetScope);
+
+    }
+
+    /**
+     * Wires two contexts together where the reference interface may be different from the target service
+     */
+    public static Map<String, AtomicComponent> createWiredComponents(String sourceName, Class<?> sourceClass,
+                                                                     Class<?> sourceReferenceClass,
+                                                                     ScopeContainer sourceScope,
+                                                                     Map<String, Member> members,
+                                                                     String targetName,
+                                                                     Class<?> targetService,
+                                                                     Class<?> targetClass,
+                                                                     ScopeContainer targetScope) throws Exception {
+        return createWiredComponents(sourceName, sourceClass, sourceReferenceClass, sourceScope, null, null, null,
+            members, targetName, targetService,
+            targetClass, targetScope, null, null, null);
+    }
+
+    @SuppressWarnings("unchecked")
+    public static Map<String, AtomicComponent> createWiredComponents(String sourceName, Class<?> sourceClass,
+                                                                     Class<?> sourceReferenceClass,
+                                                                     ScopeContainer sourceScope,
+                                                                     Interceptor sourceHeadInterceptor,
+                                                                     MessageHandler sourceHeadRequestHandler,
+                                                                     MessageHandler sourceHeadResponseHandler,
+                                                                     Map<String, Member> members,
+                                                                     String targetName, Class<?> targetService,
+                                                                     Class<?> targetClass,
+                                                                     ScopeContainer targetScope,
+                                                                     Interceptor targetHeadInterceptor,
+                                                                     MessageHandler targetRequestHeadHandler,
+                                                                     MessageHandler targetResponseHeadHandler)
+        throws Exception {
+        JavaAtomicComponent targetContext =
+            createJavaAtomicContext(targetName, targetScope, targetClass, targetScope.getScope());
+        InboundWire inboundWire = createServiceWire(targetService.getName().substring(
+            targetService.getName().lastIndexOf('.') + 1), targetService, targetHeadInterceptor,
+            targetRequestHeadHandler, targetResponseHeadHandler);
+        targetContext.addInboundWire(inboundWire);
+
+        PojoConfiguration configuration = new PojoConfiguration();
+        configuration.setScopeContainer(sourceScope);
+        configuration.setObjectFactory(new PojoObjectFactory(sourceClass.getConstructor()));
+        configuration.addServiceInterface(sourceClass);
+        configuration.setWireService(WIRE_SERVICE);
+        for (Map.Entry<String, Member> entry : members.entrySet()) {
+            configuration.addMember(entry.getKey(), entry.getValue());
+        }
+        JavaAtomicComponent sourceContext = new JavaAtomicComponent(sourceName, configuration);
+        OutboundWire outboundWire = createReferenceWire(targetName, sourceReferenceClass, sourceHeadInterceptor,
+            sourceHeadRequestHandler, sourceHeadResponseHandler);
+        sourceContext.addOutboundWire(outboundWire);
+        targetScope.register(targetContext);
+        sourceScope.register(sourceContext);
+        connect(outboundWire, inboundWire, targetContext, false);
+        Map<String, AtomicComponent> contexts = new HashMap<String, AtomicComponent>();
+        contexts.put(sourceName, sourceContext);
+        contexts.put(targetName, targetContext);
+        return contexts;
+    }
+
+
+    /**
+     * Wires two contexts using a multiplicity reference
+     *
+     * @param sourceName
+     * @param sourceClass
+     * @param sourceReferenceClass
+     * @param sourceScope
+     * @param targetName
+     * @param targetService
+     * @param targetClass
+     * @param members
+     * @param targetScope
+     * @return
+     * @throws Exception
+     */
+    @SuppressWarnings("unchecked")
+    public static Map<String, AtomicComponent> createWiredMultiplicity(String sourceName, Class<?> sourceClass,
+                                                                       Class<?> sourceReferenceClass,
+                                                                       ScopeContainer sourceScope,
+                                                                       String targetName, Class<?> targetService,
+                                                                       Class<?> targetClass,
+                                                                       Map<String, Member> members,
+                                                                       ScopeContainer targetScope) throws Exception {
+        JavaAtomicComponent targetContext =
+            createJavaAtomicContext(targetName, targetScope, targetClass, targetScope.getScope());
+        InboundWire inboundWire = createServiceWire(targetService.getName().substring(
+            targetService.getName().lastIndexOf('.') + 1), targetService, null, null, null);
+        targetContext.addInboundWire(inboundWire);
+
+        PojoConfiguration configuration = new PojoConfiguration();
+        configuration.setScopeContainer(sourceScope);
+        configuration.setObjectFactory(new PojoObjectFactory(sourceClass.getConstructor()));
+        configuration.addServiceInterface(sourceClass);
+        configuration.setWireService(WIRE_SERVICE);
+        for (Map.Entry<String, Member> entry : members.entrySet()) {
+            configuration.addMember(entry.getKey(), entry.getValue());
+        }
+        JavaAtomicComponent sourceContext = new JavaAtomicComponent(sourceName, configuration);
+        OutboundWire outboundWire = createReferenceWire(targetName, sourceReferenceClass, null, null, null);
+        List<OutboundWire> factories = new ArrayList<OutboundWire>();
+        factories.add(outboundWire);
+        sourceContext.addOutboundWires(sourceReferenceClass, factories);
+        targetScope.register(targetContext);
+        sourceScope.register(sourceContext);
+        connect(outboundWire, inboundWire, targetContext, false);
+        Map<String, AtomicComponent> contexts = new HashMap<String, AtomicComponent>();
+        contexts.put(sourceName, sourceContext);
+        contexts.put(targetName, targetContext);
+        return contexts;
+    }
+
+    public static <T> InboundWire<T> createTargetWire(String serviceName, Class<T> interfaze) {
+        return createServiceWire(serviceName, interfaze, null, null, null);
+    }
+
+
+    public static <T> InboundWire<T> createServiceWire(String serviceName, Class<T> interfaze,
+                                                       Interceptor headInterceptor,
+                                                       MessageHandler headRequestHandler,
+                                                       MessageHandler headResponseHandler) {
+        InboundWire<T> wire = new InboundWireImpl<T>();
+        wire.setBusinessInterface(interfaze);
+        wire.setServiceName(serviceName);
+        wire.addInvocationChains(
+            createInboundChains(interfaze, headInterceptor, headRequestHandler, headResponseHandler));
+        return wire;
+    }
+
+    public static <T> OutboundWire<T> createReferenceWire(String refName, Class<T> interfaze,
+                                                          Interceptor headInterceptor,
+                                                          MessageHandler headRequestHandler,
+                                                          MessageHandler headResponseHandler) {
+
+        OutboundWire<T> wire = new OutboundWireImpl<T>();
+        wire.setReferenceName(refName);
+        wire.addInvocationChains(
+            createOutboundChains(interfaze, headInterceptor, headRequestHandler, headResponseHandler));
+        wire.setBusinessInterface(interfaze);
+        return wire;
+    }
+
+    public static <T> OutboundWire<T> createReferenceWire(String refName, Class<T> interfaze) {
+        OutboundWire<T> wire = new OutboundWireImpl<T>();
+        wire.setReferenceName(refName);
+        wire.addInvocationChains(createOutboundChains(interfaze));
+        wire.setBusinessInterface(interfaze);
+        return wire;
+    }
+
+
+    /**
+     * @param outboundWire
+     * @param inboundWire
+     * @param targetContext
+     * @param cacheable
+     * @throws Exception
+     */
+    public static void connect(OutboundWire<?> outboundWire,
+                               InboundWire<?> inboundWire,
+                               JavaAtomicComponent targetContext,
+                               boolean cacheable) throws Exception {
+        if (inboundWire != null) {
+            // if null, the target side has no interceptors or handlers
+            Map<Method, InboundInvocationChain> targetInvocationConfigs = inboundWire.getInvocationChains();
+            for (OutboundInvocationChain outboundInvocationConfig : outboundWire.getInvocationChains().values()) {
+                // match wire chains
+                InboundInvocationChain inboundInvocationConfig =
+                    targetInvocationConfigs.get(outboundInvocationConfig.getMethod());
+                if (inboundInvocationConfig == null) {
+                    BuilderConfigException e =
+                        new BuilderConfigException("Incompatible source and target interface types for reference");
+                    e.setIdentifier(outboundWire.getReferenceName());
+                    throw e;
+                }
+                // if handler is configured, add that
+                if (inboundInvocationConfig.getRequestHandlers() != null) {
+                    outboundInvocationConfig.setTargetRequestChannel(new MessageChannelImpl(inboundInvocationConfig
+                        .getRequestHandlers()));
+                    outboundInvocationConfig.setTargetResponseChannel(new MessageChannelImpl(inboundInvocationConfig
+                        .getResponseHandlers()));
+                } else {
+                    // no handlers, just connect interceptors
+                    if (inboundInvocationConfig.getHeadInterceptor() == null) {
+                        BuilderConfigException e =
+                            new BuilderConfigException("No target handler or interceptor for operation");
+                        e.setIdentifier(inboundInvocationConfig.getMethod().getName());
+                        throw e;
+                    }
+                    if (!(outboundInvocationConfig.getTailInterceptor() instanceof InvokerInterceptor
+                        && inboundInvocationConfig.getHeadInterceptor() instanceof InvokerInterceptor)) {
+                        // check that we do not have the case where the only interceptors are invokers since we just
+                        // need one
+                        outboundInvocationConfig.setTargetInterceptor(inboundInvocationConfig.getHeadInterceptor());
+                    }
+                }
+            }
+
+            for (OutboundInvocationChain outboundInvocationConfig : outboundWire.getInvocationChains()
+                .values()) {
+                //FIXME should use target method, not outboundInvocationConfig.getMethod()
+                TargetInvoker invoker = new JavaTargetInvoker(outboundInvocationConfig.getMethod(), targetContext);
+                invoker.setCacheable(cacheable);
+                outboundInvocationConfig.setTargetInvoker(invoker);
+            }
+        }
+    }
+
+    private static Map<Method, OutboundInvocationChain> createOutboundChains(Class<?> interfaze) {
+        return createOutboundChains(interfaze, null, null, null);
+    }
+
+    private static Map<Method, OutboundInvocationChain> createOutboundChains(Class<?> interfaze,
+                                                                             Interceptor headInterceptor,
+                                                                             MessageHandler headRequestHandler,
+                                                                             MessageHandler headResponseHandler) {
+        Map<Method, OutboundInvocationChain> invocations = new HashMap<Method, OutboundInvocationChain>();
+        Method[] methods = interfaze.getMethods();
+        for (Method method : methods) {
+            OutboundInvocationChain chain = new OutboundInvocationChainImpl(method);
+            if (headInterceptor != null) {
+                chain.addInterceptor(headInterceptor);
+            }
+            if (headRequestHandler != null) {
+                chain.addRequestHandler(headRequestHandler);
+            }
+            if (headResponseHandler != null) {
+                chain.addRequestHandler(headResponseHandler);
+            }
+            invocations.put(method, chain);
+        }
+        return invocations;
+    }
+
+    private static Map<Method, InboundInvocationChain> createInboundChains(Class<?> interfaze,
+                                                                           Interceptor headInterceptor,
+                                                                           MessageHandler headRequestHandler,
+                                                                           MessageHandler headResponseHandler) {
+        Map<Method, InboundInvocationChain> invocations = new MethodHashMap<InboundInvocationChain>();
+        Method[] methods = interfaze.getMethods();
+        for (Method method : methods) {
+            InboundInvocationChain chain = new InboundInvocationChainImpl(method);
+            if (headInterceptor != null) {
+                chain.addInterceptor(headInterceptor);
+            }
+            if (headRequestHandler != null) {
+                chain.addRequestHandler(headRequestHandler);
+            }
+            if (headResponseHandler != null) {
+                chain.addRequestHandler(headResponseHandler);
+            }
+            // add tail interceptor
+            chain.addInterceptor(new InvokerInterceptor());
+            invocations.put(method, chain);
+        }
+        return invocations;
+    }
+
+}

Propchange: incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/java/mock/MockFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/java/mock/MockFactory.java
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/java/mock/components/OtherTarget.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/java/mock/components/OtherTarget.java?rev=416333&view=auto
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/java/mock/components/OtherTarget.java (added)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/java/mock/components/OtherTarget.java Thu Jun 22 04:20:25 2006
@@ -0,0 +1,13 @@
+package org.apache.tuscany.core.implementation.java.mock.components;
+
+/**
+ * Implementations are used in wiring tests
+ *
+ * @version $Rev: 415107 $ $Date: 2006-06-18 01:37:39 -0700 (Sun, 18 Jun 2006) $
+ */
+public interface OtherTarget {
+
+    String getString();
+
+    void setString(String val);
+}

Propchange: incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/java/mock/components/OtherTarget.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/java/mock/components/OtherTarget.java
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/java/mock/components/OtherTargetImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/java/mock/components/OtherTargetImpl.java?rev=416333&view=auto
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/java/mock/components/OtherTargetImpl.java (added)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/java/mock/components/OtherTargetImpl.java Thu Jun 22 04:20:25 2006
@@ -0,0 +1,21 @@
+package org.apache.tuscany.core.implementation.java.mock.components;
+
+/**
+ * A target used for testing wires with a different source and target interface
+ *
+ * @version $Rev: 411441 $ $Date: 2006-06-03 07:52:56 -0700 (Sat, 03 Jun 2006) $
+ */
+public class OtherTargetImpl implements OtherTarget {
+
+    private String theString;
+
+    public String getString() {
+        return theString;
+    }
+
+    public void setString(String val) {
+        theString = val;
+    }
+
+
+}

Propchange: incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/java/mock/components/OtherTargetImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/java/mock/components/OtherTargetImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/java/mock/components/Source.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/java/mock/components/Source.java?rev=416333&view=auto
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/java/mock/components/Source.java (added)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/java/mock/components/Source.java Thu Jun 22 04:20:25 2006
@@ -0,0 +1,19 @@
+package org.apache.tuscany.core.implementation.java.mock.components;
+
+import java.util.List;
+
+
+/**
+ * Implementations are used in wiring tests
+ *
+ * @version $Rev: 415107 $ $Date: 2006-06-18 01:37:39 -0700 (Sun, 18 Jun 2006) $
+ */
+public interface Source {
+
+    Target getTarget();
+
+    List<Target> getTargets();
+
+    List<Target> getTargetsThroughField();
+
+}

Propchange: incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/java/mock/components/Source.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/java/mock/components/Source.java
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/java/mock/components/SourceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/java/mock/components/SourceImpl.java?rev=416333&view=auto
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/java/mock/components/SourceImpl.java (added)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/java/mock/components/SourceImpl.java Thu Jun 22 04:20:25 2006
@@ -0,0 +1,48 @@
+package org.apache.tuscany.core.implementation.java.mock.components;
+
+import java.util.List;
+
+
+/**
+ * Mock system component implementation used in wiring tests
+ *
+ * @version $Rev: 415107 $ $Date: 2006-06-18 01:37:39 -0700 (Sun, 18 Jun 2006) $
+ */
+public class SourceImpl implements Source {
+
+    private Target target;
+    private List<Target> targets;
+    private Target[] targetsArray;
+    private List<Target> targetsThroughField;
+
+    public void setTarget(Target target) {
+        this.target = target;
+    }
+
+    public Target getTarget() {
+        return target;
+    }
+
+    public List<Target> getTargets() {
+        return targets;
+    }
+
+    public void setTargets(List<Target> targets) {
+        this.targets = targets;
+    }
+
+    public List<Target> getTargetsThroughField() {
+        return targetsThroughField;
+    }
+
+
+    public Target[] getArrayOfTargets() {
+        return targetsArray;
+    }
+
+    public void setArrayOfTargets(Target[] targets) {
+        targetsArray = targets;
+    }
+
+
+}

Propchange: incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/java/mock/components/SourceImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/java/mock/components/SourceImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/java/mock/components/Target.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/java/mock/components/Target.java?rev=416333&view=auto
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/java/mock/components/Target.java (added)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/java/mock/components/Target.java Thu Jun 22 04:20:25 2006
@@ -0,0 +1,13 @@
+package org.apache.tuscany.core.implementation.java.mock.components;
+
+/**
+ * Implementations are used in wiring tests
+ *
+ * @version $Rev: 415107 $ $Date: 2006-06-18 01:37:39 -0700 (Sun, 18 Jun 2006) $
+ */
+public interface Target {
+
+    String getString();
+
+    void setString(String val);
+}

Propchange: incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/java/mock/components/Target.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/java/mock/components/Target.java
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/java/mock/components/TargetImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/java/mock/components/TargetImpl.java?rev=416333&view=auto
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/java/mock/components/TargetImpl.java (added)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/java/mock/components/TargetImpl.java Thu Jun 22 04:20:25 2006
@@ -0,0 +1,20 @@
+package org.apache.tuscany.core.implementation.java.mock.components;
+
+/**
+ * Mock system component implementation used in wiring tests
+ *
+ * @version $Rev: 411441 $ $Date: 2006-06-03 07:52:56 -0700 (Sat, 03 Jun 2006) $
+ */
+public class TargetImpl implements Target {
+
+    private String theString;
+
+    public String getString() {
+        return theString;
+    }
+
+    public void setString(String val) {
+        theString = val;
+    }
+
+}

Propchange: incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/java/mock/components/TargetImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/java/mock/components/TargetImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Modified: incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/system/component/AutowireResolutionTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/system/component/AutowireResolutionTestCase.java?rev=416333&r1=416331&r2=416333&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/system/component/AutowireResolutionTestCase.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/system/component/AutowireResolutionTestCase.java Thu Jun 22 04:20:25 2006
@@ -14,7 +14,7 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-package org.apache.tuscany.core.system.component;
+package org.apache.tuscany.core.implementation.system.component;
 
 import org.apache.tuscany.spi.component.CompositeComponent;
 

Modified: incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/system/component/AutowireTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/system/component/AutowireTestCase.java?rev=416333&r1=416331&r2=416333&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/system/component/AutowireTestCase.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/system/component/AutowireTestCase.java Thu Jun 22 04:20:25 2006
@@ -1,4 +1,4 @@
-package org.apache.tuscany.core.system.component;
+package org.apache.tuscany.core.implementation.system.component;
 
 import java.util.ArrayList;
 import java.util.List;

Modified: incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/system/component/CompositePropagationTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/system/component/CompositePropagationTestCase.java?rev=416333&r1=416331&r2=416333&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/system/component/CompositePropagationTestCase.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/system/component/CompositePropagationTestCase.java Thu Jun 22 04:20:25 2006
@@ -1,4 +1,4 @@
-package org.apache.tuscany.core.system.component;
+package org.apache.tuscany.core.implementation.system.component;
 
 import java.util.ArrayList;
 import java.util.List;

Modified: incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/system/component/DuplicateRegistrationTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/system/component/DuplicateRegistrationTestCase.java?rev=416333&r1=416331&r2=416333&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/system/component/DuplicateRegistrationTestCase.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/system/component/DuplicateRegistrationTestCase.java Thu Jun 22 04:20:25 2006
@@ -1,4 +1,4 @@
-package org.apache.tuscany.core.system.component;
+package org.apache.tuscany.core.implementation.system.component;
 
 import java.util.ArrayList;
 import java.util.List;

Modified: incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/system/component/SystemAtomicComponentTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/system/component/SystemAtomicComponentTestCase.java?rev=416333&r1=416331&r2=416333&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/system/component/SystemAtomicComponentTestCase.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/system/component/SystemAtomicComponentTestCase.java Thu Jun 22 04:20:25 2006
@@ -1,12 +1,12 @@
-package org.apache.tuscany.core.system.component;
+package org.apache.tuscany.core.implementation.system.component;
 
 import org.apache.tuscany.spi.ObjectFactory;
-import org.apache.tuscany.spi.component.PojoConfiguration;
-import org.apache.tuscany.spi.injection.EventInvoker;
-import org.apache.tuscany.spi.injection.PojoObjectFactory;
 
 import junit.framework.TestCase;
+import org.apache.tuscany.core.implementation.PojoConfiguration;
+import org.apache.tuscany.core.injection.EventInvoker;
 import org.apache.tuscany.core.injection.MethodEventInvoker;
+import org.apache.tuscany.core.injection.PojoObjectFactory;
 
 /**
  * Verifies a system atomic component can be started and initialized

Modified: incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/system/component/SystemCompositeComponentResolutionTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/system/component/SystemCompositeComponentResolutionTestCase.java?rev=416333&r1=416331&r2=416333&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/system/component/SystemCompositeComponentResolutionTestCase.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/system/component/SystemCompositeComponentResolutionTestCase.java Thu Jun 22 04:20:25 2006
@@ -1,4 +1,4 @@
-package org.apache.tuscany.core.system.component;
+package org.apache.tuscany.core.implementation.system.component;
 
 import java.util.ArrayList;
 import java.util.List;

Modified: incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/system/component/SystemCompositeLifecycleTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/system/component/SystemCompositeLifecycleTestCase.java?rev=416333&r1=416331&r2=416333&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/system/component/SystemCompositeLifecycleTestCase.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/system/component/SystemCompositeLifecycleTestCase.java Thu Jun 22 04:20:25 2006
@@ -1,4 +1,4 @@
-package org.apache.tuscany.core.system.component;
+package org.apache.tuscany.core.implementation.system.component;
 
 import java.util.ArrayList;
 import java.util.List;

Modified: incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/system/component/SystemObjectRegistrationTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/system/component/SystemObjectRegistrationTestCase.java?rev=416333&r1=416331&r2=416333&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/system/component/SystemObjectRegistrationTestCase.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/system/component/SystemObjectRegistrationTestCase.java Thu Jun 22 04:20:25 2006
@@ -1,4 +1,4 @@
-package org.apache.tuscany.core.system.component;
+package org.apache.tuscany.core.implementation.system.component;
 
 import javax.naming.ConfigurationException;
 

Modified: incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/system/wire/AtomicComponentWireInvocationTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/system/wire/AtomicComponentWireInvocationTestCase.java?rev=416333&r1=416331&r2=416333&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/system/wire/AtomicComponentWireInvocationTestCase.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/system/wire/AtomicComponentWireInvocationTestCase.java Thu Jun 22 04:20:25 2006
@@ -1,8 +1,8 @@
-package org.apache.tuscany.core.system.wire;
+package org.apache.tuscany.core.implementation.system.wire;
 
 import org.apache.tuscany.spi.QualifiedName;
-import org.apache.tuscany.spi.component.PojoConfiguration;
-import org.apache.tuscany.spi.injection.PojoObjectFactory;
+import org.apache.tuscany.core.implementation.PojoConfiguration;
+import org.apache.tuscany.core.injection.PojoObjectFactory;
 import org.apache.tuscany.spi.wire.OutboundWire;
 
 import org.apache.tuscany.core.component.scope.ModuleScopeContainer;
@@ -10,8 +10,8 @@
 import org.apache.tuscany.core.mock.component.SourceImpl;
 import org.apache.tuscany.core.mock.component.Target;
 import org.apache.tuscany.core.mock.component.TargetImpl;
-import org.apache.tuscany.core.system.component.SystemAtomicComponent;
-import org.apache.tuscany.core.system.component.SystemAtomicComponentImpl;
+import org.apache.tuscany.core.implementation.system.component.SystemAtomicComponent;
+import org.apache.tuscany.core.implementation.system.component.SystemAtomicComponentImpl;
 import org.jmock.Mock;
 import org.jmock.MockObjectTestCase;
 

Modified: incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/system/wire/SystemInboundtoOutboundTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/system/wire/SystemInboundtoOutboundTestCase.java?rev=416333&r1=416331&r2=416333&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/system/wire/SystemInboundtoOutboundTestCase.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/system/wire/SystemInboundtoOutboundTestCase.java Thu Jun 22 04:20:25 2006
@@ -1,4 +1,4 @@
-package org.apache.tuscany.core.system.wire;
+package org.apache.tuscany.core.implementation.system.wire;
 
 import org.apache.tuscany.core.mock.component.Target;
 import org.apache.tuscany.core.mock.component.TargetImpl;

Modified: incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/system/wire/SystemOutboundToInboundTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/system/wire/SystemOutboundToInboundTestCase.java?rev=416333&r1=416331&r2=416333&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/system/wire/SystemOutboundToInboundTestCase.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/system/wire/SystemOutboundToInboundTestCase.java Thu Jun 22 04:20:25 2006
@@ -1,4 +1,4 @@
-package org.apache.tuscany.core.system.wire;
+package org.apache.tuscany.core.implementation.system.wire;
 
 import org.apache.tuscany.spi.QualifiedName;
 

Modified: incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/system/wire/SystemServiceComponentWireTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/system/wire/SystemServiceComponentWireTestCase.java?rev=416333&r1=416331&r2=416333&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/system/wire/SystemServiceComponentWireTestCase.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/implementation/system/wire/SystemServiceComponentWireTestCase.java Thu Jun 22 04:20:25 2006
@@ -1,9 +1,9 @@
-package org.apache.tuscany.core.system.wire;
+package org.apache.tuscany.core.implementation.system.wire;
 
 import org.apache.tuscany.core.mock.component.Target;
 import org.apache.tuscany.core.mock.component.TargetImpl;
-import org.apache.tuscany.core.system.component.SystemService;
-import org.apache.tuscany.core.system.component.SystemServiceImpl;
+import org.apache.tuscany.core.implementation.system.component.SystemService;
+import org.apache.tuscany.core.implementation.system.component.SystemServiceImpl;
 import org.jmock.Mock;
 import org.jmock.MockObjectTestCase;
 

Modified: incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/integration/system/builder/SystemBuildersTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/integration/system/builder/SystemBuildersTestCase.java?rev=416333&r1=416332&r2=416333&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/integration/system/builder/SystemBuildersTestCase.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/integration/system/builder/SystemBuildersTestCase.java Thu Jun 22 04:20:25 2006
@@ -20,12 +20,12 @@
 import org.apache.tuscany.core.mock.component.Source;
 import org.apache.tuscany.core.mock.component.Target;
 import org.apache.tuscany.core.mock.factories.MockComponentFactory;
-import org.apache.tuscany.core.system.builder.SystemBindingBuilder;
-import org.apache.tuscany.core.system.builder.SystemComponentBuilder;
-import org.apache.tuscany.core.system.component.SystemCompositeComponent;
-import org.apache.tuscany.core.system.component.SystemCompositeComponentImpl;
-import org.apache.tuscany.core.system.model.SystemBinding;
-import org.apache.tuscany.core.system.model.SystemImplementation;
+import org.apache.tuscany.core.implementation.system.builder.SystemBindingBuilder;
+import org.apache.tuscany.core.implementation.system.builder.SystemComponentBuilder;
+import org.apache.tuscany.core.implementation.system.component.SystemCompositeComponent;
+import org.apache.tuscany.core.implementation.system.component.SystemCompositeComponentImpl;
+import org.apache.tuscany.core.implementation.system.model.SystemBinding;
+import org.apache.tuscany.core.implementation.system.model.SystemImplementation;
 
 /**
  * Validates that system builders and the default connector create properly wired contexts

Modified: incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/mock/factories/MockComponentFactory.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/mock/factories/MockComponentFactory.java?rev=416333&r1=416332&r2=416333&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/mock/factories/MockComponentFactory.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/mock/factories/MockComponentFactory.java Thu Jun 22 04:20:25 2006
@@ -7,7 +7,7 @@
 import org.apache.tuscany.spi.model.BoundServiceDefinition;
 import org.apache.tuscany.spi.model.ComponentDefinition;
 import org.apache.tuscany.spi.model.JavaServiceContract;
-import org.apache.tuscany.spi.model.PojoComponentType;
+import org.apache.tuscany.core.implementation.PojoComponentType;
 import org.apache.tuscany.spi.model.ReferenceDefinition;
 import org.apache.tuscany.spi.model.ReferenceTarget;
 import org.apache.tuscany.spi.model.Scope;
@@ -17,8 +17,8 @@
 import org.apache.tuscany.core.mock.component.SourceImpl;
 import org.apache.tuscany.core.mock.component.Target;
 import org.apache.tuscany.core.mock.component.TargetImpl;
-import org.apache.tuscany.core.system.model.SystemBinding;
-import org.apache.tuscany.core.system.model.SystemImplementation;
+import org.apache.tuscany.core.implementation.system.model.SystemBinding;
+import org.apache.tuscany.core.implementation.system.model.SystemImplementation;
 
 /**
  * @version $$Rev$$ $$Date$$

Modified: incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/mock/factories/MockFactory.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/mock/factories/MockFactory.java?rev=416333&r1=416332&r2=416333&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/mock/factories/MockFactory.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/mock/factories/MockFactory.java Thu Jun 22 04:20:25 2006
@@ -11,18 +11,18 @@
 
 import org.apache.tuscany.spi.QualifiedName;
 import org.apache.tuscany.spi.component.AtomicComponent;
-import org.apache.tuscany.spi.component.PojoConfiguration;
+import org.apache.tuscany.core.implementation.PojoConfiguration;
 import org.apache.tuscany.spi.component.ScopeContainer;
-import org.apache.tuscany.spi.injection.PojoObjectFactory;
+import org.apache.tuscany.core.injection.PojoObjectFactory;
 import org.apache.tuscany.spi.wire.InboundInvocationChain;
 import org.apache.tuscany.spi.wire.InboundWire;
 
 import org.apache.tuscany.core.injection.MethodEventInvoker;
-import org.apache.tuscany.core.system.component.SystemAtomicComponent;
-import org.apache.tuscany.core.system.component.SystemAtomicComponentImpl;
-import org.apache.tuscany.core.system.wire.SystemInboundWireImpl;
-import org.apache.tuscany.core.system.wire.SystemOutboundWire;
-import org.apache.tuscany.core.system.wire.SystemOutboundWireImpl;
+import org.apache.tuscany.core.implementation.system.component.SystemAtomicComponent;
+import org.apache.tuscany.core.implementation.system.component.SystemAtomicComponentImpl;
+import org.apache.tuscany.core.implementation.system.wire.SystemInboundWireImpl;
+import org.apache.tuscany.core.implementation.system.wire.SystemOutboundWire;
+import org.apache.tuscany.core.implementation.system.wire.SystemOutboundWireImpl;
 import org.apache.tuscany.core.util.MethodHashMap;
 import org.apache.tuscany.core.wire.InboundInvocationChainImpl;
 import org.apache.tuscany.core.wire.InboundWireImpl;



---------------------------------------------------------------------
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