You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by jm...@apache.org on 2006/11/26 06:32:52 UTC

svn commit: r479280 [2/2] - in /incubator/tuscany/java/sca/kernel: core/src/main/java/org/apache/tuscany/core/component/scope/ core/src/main/java/org/apache/tuscany/core/implementation/java/ core/src/main/java/org/apache/tuscany/core/implementation/sys...

Modified: incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/ConversationalScopeComponentImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/ConversationalScopeComponentImpl.java?view=diff&rev=479280&r1=479279&r2=479280
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/ConversationalScopeComponentImpl.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/ConversationalScopeComponentImpl.java Sat Nov 25 21:32:49 2006
@@ -24,7 +24,6 @@
  * @version $Rev: 430937 $ $Date: 2006-08-11 21:17:56 -0400 (Fri, 11 Aug 2006) $
  */
 @Scope("CONVERSATION")
-public class ConversationalScopeComponentImpl
-            implements ConversationalScopeComponent {
+public class ConversationalScopeComponentImpl implements ConversationalScopeComponent {
 
 }

Modified: incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/ConversationalScopeDestroyOnlyComponent.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/ConversationalScopeDestroyOnlyComponent.java?view=diff&rev=479280&r1=479279&r2=479280
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/ConversationalScopeDestroyOnlyComponent.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/ConversationalScopeDestroyOnlyComponent.java Sat Nov 25 21:32:49 2006
@@ -22,8 +22,7 @@
 import org.osoa.sca.annotations.Scope;
 
 @Scope("CONVERSATION")
-public class ConversationalScopeDestroyOnlyComponent
-            extends ConversationalScopeComponentImpl {
+public class ConversationalScopeDestroyOnlyComponent extends ConversationalScopeComponentImpl {
 
     boolean destroyed;
 

Added: incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/OtherTarget.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/OtherTarget.java?view=auto&rev=479280
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/OtherTarget.java (added)
+++ incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/OtherTarget.java Sat Nov 25 21:32:49 2006
@@ -0,0 +1,31 @@
+/*
+ * 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.mock.component;
+
+/**
+ * Implementations are used in wiring tests
+ *
+ * @version $Rev$ $Date$
+ */
+public interface OtherTarget {
+
+    String getString();
+
+    void setString(String val);
+}

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

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

Added: incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/OtherTargetImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/OtherTargetImpl.java?view=auto&rev=479280
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/OtherTargetImpl.java (added)
+++ incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/OtherTargetImpl.java Sat Nov 25 21:32:49 2006
@@ -0,0 +1,39 @@
+/*
+ * 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.mock.component;
+
+/**
+ * A target used for testing wires with a different source and target interface
+ *
+ * @version $Rev$ $Date$
+ */
+public class OtherTargetImpl implements OtherTarget {
+
+    private String theString;
+
+    public String getString() {
+        return theString;
+    }
+
+    public void setString(String val) {
+        theString = val;
+    }
+
+
+}

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

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

Modified: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/AtomicComponent.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/AtomicComponent.java?view=diff&rev=479280&r1=479279&r2=479280
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/AtomicComponent.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/AtomicComponent.java Sat Nov 25 21:32:49 2006
@@ -65,6 +65,6 @@
     /**
      * Removes an implementation instance associated with the current invocation context
      */
-    void destroyInstance();
+    void removeInstance();
 
 }

Modified: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/extension/AtomicComponentExtension.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/extension/AtomicComponentExtension.java?view=diff&rev=479280&r1=479279&r2=479280
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/extension/AtomicComponentExtension.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/extension/AtomicComponentExtension.java Sat Nov 25 21:32:49 2006
@@ -134,7 +134,7 @@
         onReferenceWires(multiplicityClass, wires);
     }
 
-    public void destroyInstance() {
+    public void removeInstance() {
         scopeContainer.remove(this);
     }
 

Modified: incubator/tuscany/java/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/extension/AtomicComponentExtensionTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/extension/AtomicComponentExtensionTestCase.java?view=diff&rev=479280&r1=479279&r2=479280
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/extension/AtomicComponentExtensionTestCase.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/extension/AtomicComponentExtensionTestCase.java Sat Nov 25 21:32:49 2006
@@ -21,12 +21,14 @@
 import java.util.List;
 
 import org.apache.tuscany.spi.ObjectCreationException;
+import org.apache.tuscany.spi.component.ScopeContainer;
 import org.apache.tuscany.spi.component.TargetException;
 import org.apache.tuscany.spi.model.Operation;
-import org.apache.tuscany.spi.wire.TargetInvoker;
 import org.apache.tuscany.spi.wire.InboundWire;
+import org.apache.tuscany.spi.wire.TargetInvoker;
 
 import junit.framework.TestCase;
+import org.easymock.EasyMock;
 
 /**
  * @version $Rev$ $Date$
@@ -58,9 +60,22 @@
         ext.getInboundWire(null);
     }
 
+    public void testRemoveInstance() throws Exception {
+        ScopeContainer container = EasyMock.createMock(ScopeContainer.class);
+        container.remove(EasyMock.isA(AtomicComponentExtension.class));
+        EasyMock.replay(container);
+        TestExtension ext = new TestExtension(container);
+        ext.removeInstance();
+        EasyMock.verify(container);
+    }
+
     private class TestExtension extends AtomicComponentExtension {
         public TestExtension() {
             super(null, null, null, null, null, null, null, 0);
+        }
+
+        public TestExtension(ScopeContainer scopeContainer) {
+            super(null, null, scopeContainer, null, null, null, null, 0);
         }
 
         public Object getServiceInstance() throws TargetException {



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