gammaRef = componentContext.getServiceReference(Gamma.class, "gamma");
- gammaRef.getService().start();
- return gammaRef;
- }
-
-}
diff --git a/branches/sca-equinox/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callablerefreturn/Gamma.java b/branches/sca-equinox/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callablerefreturn/Gamma.java
deleted file mode 100644
index e32051373f..0000000000
--- a/branches/sca-equinox/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callablerefreturn/Gamma.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * 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.sca.itest.callablerefreturn;
-
-import org.osoa.sca.annotations.Conversational;
-import org.osoa.sca.annotations.EndsConversation;
-import org.osoa.sca.annotations.Remotable;
-
-@Remotable
-@Conversational
-public interface Gamma
-{
- void start();
-
- void doSomething();
-
- @EndsConversation
- void stop();
-}
diff --git a/branches/sca-equinox/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callablerefreturn/GammaImpl.java b/branches/sca-equinox/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callablerefreturn/GammaImpl.java
deleted file mode 100644
index adf5a1c1ce..0000000000
--- a/branches/sca-equinox/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callablerefreturn/GammaImpl.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * 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.sca.itest.callablerefreturn;
-
-import org.osoa.sca.annotations.ConversationID;
-import org.osoa.sca.annotations.Scope;
-
-@Scope("CONVERSATION")
-public class GammaImpl implements Gamma
-{
- @ConversationID
- protected String conversationId;
-
-
- public void start()
- {
- System.out.println("Gamma:start(), conversationId=" + conversationId);
- }
-
-
- public void doSomething()
- {
- System.out.println("Gamma:doSomething(), conversationId=" + conversationId);
- }
-
-
- public void stop()
- {
- System.out.println("Gamma:stop(), conversationId=" + conversationId);
- }
-}
diff --git a/branches/sca-equinox/itest/callablereferences/src/main/resources/CallableReferenceConversationalTest.composite b/branches/sca-equinox/itest/callablereferences/src/main/resources/CallableReferenceConversationalTest.composite
deleted file mode 100644
index 0bf8f7ef1e..0000000000
--- a/branches/sca-equinox/itest/callablereferences/src/main/resources/CallableReferenceConversationalTest.composite
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/branches/sca-equinox/itest/callablereferences/src/main/resources/CallableReferenceReturnTest.composite b/branches/sca-equinox/itest/callablereferences/src/main/resources/CallableReferenceReturnTest.composite
deleted file mode 100644
index 5b3add1e61..0000000000
--- a/branches/sca-equinox/itest/callablereferences/src/main/resources/CallableReferenceReturnTest.composite
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/branches/sca-equinox/itest/callablereferences/src/main/resources/CallableReferenceTest.composite b/branches/sca-equinox/itest/callablereferences/src/main/resources/CallableReferenceTest.composite
deleted file mode 100644
index 49b75f56e4..0000000000
--- a/branches/sca-equinox/itest/callablereferences/src/main/resources/CallableReferenceTest.composite
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/branches/sca-equinox/itest/callablereferences/src/main/resources/nodeA/CompositeA.composite b/branches/sca-equinox/itest/callablereferences/src/main/resources/nodeA/CompositeA.composite
deleted file mode 100644
index 9216f44191..0000000000
--- a/branches/sca-equinox/itest/callablereferences/src/main/resources/nodeA/CompositeA.composite
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/branches/sca-equinox/itest/callablereferences/src/main/resources/nodeA/META-INF/sca-contribution.xml b/branches/sca-equinox/itest/callablereferences/src/main/resources/nodeA/META-INF/sca-contribution.xml
deleted file mode 100644
index 95021f72a4..0000000000
--- a/branches/sca-equinox/itest/callablereferences/src/main/resources/nodeA/META-INF/sca-contribution.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/branches/sca-equinox/itest/callablereferences/src/main/resources/nodeB/CompositeB.composite b/branches/sca-equinox/itest/callablereferences/src/main/resources/nodeB/CompositeB.composite
deleted file mode 100644
index 42d739564c..0000000000
--- a/branches/sca-equinox/itest/callablereferences/src/main/resources/nodeB/CompositeB.composite
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/branches/sca-equinox/itest/callablereferences/src/main/resources/nodeB/META-INF/sca-contribution.xml b/branches/sca-equinox/itest/callablereferences/src/main/resources/nodeB/META-INF/sca-contribution.xml
deleted file mode 100644
index 2edda61601..0000000000
--- a/branches/sca-equinox/itest/callablereferences/src/main/resources/nodeB/META-INF/sca-contribution.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/branches/sca-equinox/itest/callablereferences/src/test/java/org/apache/tuscany/sca/itest/callableref/CallableReferenceConversationalTestCase.java b/branches/sca-equinox/itest/callablereferences/src/test/java/org/apache/tuscany/sca/itest/callableref/CallableReferenceConversationalTestCase.java
deleted file mode 100644
index a9cbb5d0a1..0000000000
--- a/branches/sca-equinox/itest/callablereferences/src/test/java/org/apache/tuscany/sca/itest/callableref/CallableReferenceConversationalTestCase.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * 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.sca.itest.callableref;
-
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-import org.apache.tuscany.sca.itest.callablerefconversational.ConversationalService;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.osoa.sca.ServiceReference;
-
-/**
- * Simple test case that creates a ServiceReference to a Conversational Component
- * using ComponentContext.createSelfReference()
- *
- * This test case is for TUSCANY-2208
- *
- * @version $Date$ $Revision$
- */
-public class CallableReferenceConversationalTestCase {
- private static SCADomain domain;
- private static ConversationalService acomponent;
-
- @BeforeClass
- public static void init() throws Exception {
- domain = SCADomain.newInstance("CallableReferenceConversationalTest.composite");
- Assert.assertNotNull(domain);
- acomponent = domain.getService(ConversationalService.class, "ConversationalComponent");
- }
-
- @AfterClass
- public static void destroy() throws Exception {
- if (domain != null) {
- domain.close();
- }
- }
-
- /**
- * This is a dummy test so that this Unit Test has a test so it will build.
- * Once TUSCANY-2208 is fixed, this dummy test method can be removed
- */
- @Test
- public void dummyTestRemoveWhenTuscany2208IsFixed() {
- }
-
- /**
- * Tests creating Self References and validate them with Conversation IDs
- */
- // Disabled until TUSCANY-2208 is fixed
- // @Test
- public void testCreateSelfRefUsingConvID() {
- Assert.assertNotNull(acomponent);
-
- final Object origConvID = acomponent.getConversationID();
- Assert.assertNotNull(origConvID);
- final ServiceReference ref = acomponent.createSelfRef();
- Assert.assertNotNull(ref);
-
- final ConversationalService resolvedRef = ref.getService();
- Assert.assertNotNull(resolvedRef);
- final Object newConvID = resolvedRef.getConversationID();
- Assert.assertNotNull(newConvID);
-
- Assert.assertEquals(origConvID, newConvID);
- }
-
- /**
- * Tests creating Self References and validate them with user specified data
- */
- // Disabled until TUSCANY-2208 is fixed
- // @Test
- public void testCreateSelfRefUsingUserData() {
- Assert.assertNotNull(acomponent);
-
- final String origUserData = acomponent.getUserData();
- Assert.assertEquals(ConversationalService.DEFAULT_USER_DATA, origUserData);
-
- final String userData = "Some new user data set at " + System.currentTimeMillis();
- acomponent.setUserData(userData);
-
- final ServiceReference ref = acomponent.createSelfRef();
- Assert.assertNotNull(ref);
-
- final ConversationalService resolvedRef = ref.getService();
- Assert.assertNotNull(resolvedRef);
- final String newUserData = resolvedRef.getUserData();
- Assert.assertNotNull(newUserData);
-
- Assert.assertEquals(userData, newUserData);
- }
-}
diff --git a/branches/sca-equinox/itest/callablereferences/src/test/java/org/apache/tuscany/sca/itest/callableref/CallableReferenceRemoteTestCase.java b/branches/sca-equinox/itest/callablereferences/src/test/java/org/apache/tuscany/sca/itest/callableref/CallableReferenceRemoteTestCase.java
deleted file mode 100644
index 927e91a8bc..0000000000
--- a/branches/sca-equinox/itest/callablereferences/src/test/java/org/apache/tuscany/sca/itest/callableref/CallableReferenceRemoteTestCase.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * 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.sca.itest.callableref;
-
-
-import static junit.framework.Assert.assertEquals;
-
-import java.io.File;
-
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.node.Client;
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-
-/**
- * Runs a distributed domain in a single VM by using and in memory
- * implementation of the distributed domain
- */
-public class CallableReferenceRemoteTestCase {
-
- private static Node nodeA;
- private static Node nodeB;
-
- private static AComponent acomponent;
-
- @BeforeClass
- public static void init() throws Exception {
-
- try {
-
- System.out.println("Setting up nodes");
-
- NodeFactory nodeFactory = NodeFactory.newInstance();
- nodeA = nodeFactory.createNode(new File("src/main/resources/nodeA/CompositeA.composite").toURL().toString(),
- new Contribution("TestContribution",
- new File("src/main/resources/nodeA").toURL().toString()));
-
-
- nodeB = nodeFactory.createNode(new File("src/main/resources/nodeB/CompositeB.composite").toURL().toString(),
- new Contribution("TestContribution",
- new File("src/main/resources/nodeB").toURL().toString()));
-
-
- nodeA.start();
- nodeB.start();
-
- acomponent = ((Client)nodeA).getService(AComponent.class, "AComponent/AComponent");
-
- } catch (Throwable ex) {
- System.out.println(ex.toString());
- // Print detailed cause information.
- ex.printStackTrace();
- StringBuffer sb = new StringBuffer();
- Throwable cause = ex.getCause();
- while ( cause != null ) {
- sb.append( " " );
- System.out.println( sb.toString() + "Cause: " + cause );
- if (cause instanceof java.lang.reflect.InvocationTargetException)
- System.out.println( sb.toString() + "Target Exception: " + ((java.lang.reflect.InvocationTargetException)cause).getTargetException() );
- cause = cause.getCause();
- }
- }
- }
-
- @AfterClass
- public static void destroy() throws Exception {
- // stop the nodes and hence the domains they contain
- nodeA.stop();
- nodeB.stop();
- }
-
- //@Test
- public void testKeepServerRunning1() throws Exception {
- System.out.println("press enter to continue");
- System.in.read();
- }
-
- @Test
- public void testBReference() {
- assertEquals("BComponent", acomponent.fooB());
- }
-
- @Test
- public void testBCast() {
- assertEquals("BComponent", acomponent.fooB1());
- }
-
- @Test
- public void testCReference() {
- assertEquals("CComponent", acomponent.fooC());
- }
-
- @Test
- public void testCServiceReference() {
- assertEquals("CComponent", acomponent.fooC1());
- }
-
- @Test
- public void testDReferenceString() {
- assertEquals("DAComponent", acomponent.fooStringD());
- }
-
- @Test
- public void testDReference() {
- assertEquals("DAComponent", acomponent.fooD());
- }
-
-
- @Test
- public void testBCReference() {
- assertEquals("BCComponent", acomponent.fooBC());
- }
-
- @Test
- public void testRequiredFalseReference() {
- try {
- acomponent.invokeDReference();
- } catch (Exception e) {
- Assert.assertTrue(true);
- }
- }
-
-}
diff --git a/branches/sca-equinox/itest/callablereferences/src/test/java/org/apache/tuscany/sca/itest/callableref/CallableReferenceReturnTestCase.java b/branches/sca-equinox/itest/callablereferences/src/test/java/org/apache/tuscany/sca/itest/callableref/CallableReferenceReturnTestCase.java
deleted file mode 100644
index f2d8fe5d64..0000000000
--- a/branches/sca-equinox/itest/callablereferences/src/test/java/org/apache/tuscany/sca/itest/callableref/CallableReferenceReturnTestCase.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * 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.sca.itest.callableref;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-import org.apache.tuscany.sca.itest.callablerefreturn.Alpha;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-public class CallableReferenceReturnTestCase {
- private static SCADomain domain;
- private static Alpha alpha;
-
- @BeforeClass
- public static void init() throws Exception {
- domain = SCADomain.newInstance("CallableReferenceReturnTest.composite");
- alpha = domain.getService(Alpha.class, "Alpha");
- }
-
- @AfterClass
- public static void destroy() throws Exception {
- domain.close();
- }
-
- @Test
- public void testCallableReferenceReturn() {
- Assert.assertTrue(alpha.run());
- }
-
-}
diff --git a/branches/sca-equinox/itest/callablereferences/src/test/java/org/apache/tuscany/sca/itest/callableref/CallableReferenceTestCase.java b/branches/sca-equinox/itest/callablereferences/src/test/java/org/apache/tuscany/sca/itest/callableref/CallableReferenceTestCase.java
deleted file mode 100644
index d785a6a397..0000000000
--- a/branches/sca-equinox/itest/callablereferences/src/test/java/org/apache/tuscany/sca/itest/callableref/CallableReferenceTestCase.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * 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.sca.itest.callableref;
-
-import static junit.framework.Assert.assertEquals;
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-public class CallableReferenceTestCase {
- private static SCADomain domain;
- private static AComponent acomponent;
-
- @BeforeClass
- public static void init() throws Exception {
- domain = SCADomain.newInstance("CallableReferenceTest.composite");
- acomponent = domain.getService(AComponent.class, "AComponent");
- }
-
- @AfterClass
- public static void destroy() throws Exception {
- domain.close();
- }
-
- @Test
- public void testBReference() {
- assertEquals("BComponent", acomponent.fooB());
- }
-
- @Test
- public void testBCast() {
- assertEquals("BComponent", acomponent.fooB1());
- }
-
- @Test
- public void testCReference() {
- assertEquals("CComponent", acomponent.fooC());
- }
-
- @Test
- public void testCServiceReference() {
- assertEquals("CComponent", acomponent.fooC1());
- }
-
- @Test
- public void testDReference() {
- assertEquals("DAComponent", acomponent.fooD());
- }
-
- @Test
- public void testBCReference() {
- assertEquals("BCComponent", acomponent.fooBC());
- }
-
- @Test
- public void testRequiredFalseReference() {
- try {
- acomponent.invokeDReference();
- } catch (Exception e) {
- Assert.assertTrue(true);
- }
- }
-
-}
diff --git a/branches/sca-equinox/itest/callback-api/pom.xml b/branches/sca-equinox/itest/callback-api/pom.xml
deleted file mode 100644
index da93a9e6fe..0000000000
--- a/branches/sca-equinox/itest/callback-api/pom.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
- 4.0.0
-
- org.apache.tuscany.sca
- tuscany-itest
- 1.4-EQUINOX-SNAPSHOT
- ../pom.xml
-
- itest-callback-api
- Apache Tuscany SCA Callback API Integration Tests
-
-
-
- org.apache.tuscany.sca
- tuscany-host-embedded
- 1.4-EQUINOX-SNAPSHOT
-
-
-
- org.apache.tuscany.sca
- tuscany-implementation-java-runtime
- 1.4-EQUINOX-SNAPSHOT
- runtime
-
-
-
-
- ${basedir}/../build-was-integration.xml
- ${basedir}/../wasAdmin.py
-
-
diff --git a/branches/sca-equinox/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiCallBack.java b/branches/sca-equinox/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiCallBack.java
deleted file mode 100644
index de17ba2f0d..0000000000
--- a/branches/sca-equinox/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiCallBack.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * 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.sca.test;
-
-import org.osoa.sca.annotations.Remotable;
-
-@Remotable
-/**
- *
- */
-public interface CallBackApiCallBack {
- /**
- * This function is defined in CallBackApiClientImpl
- */
- public void callBackMessage(String aString);
-
- /**
- * This function is defined in CallBackApiClientImpl
- */
- public void callBackIncrement(String aString);
-
-}
diff --git a/branches/sca-equinox/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClient.java b/branches/sca-equinox/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClient.java
deleted file mode 100644
index 5fd4a71466..0000000000
--- a/branches/sca-equinox/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClient.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * 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.sca.test;
-
-import org.osoa.sca.annotations.Remotable;
-
-@Remotable
-public interface CallBackApiClient {
- /**
- * This function is defined in CallBackApiClientImpl
- */
- public void run();
-
-}
diff --git a/branches/sca-equinox/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClientImpl.java b/branches/sca-equinox/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClientImpl.java
deleted file mode 100644
index 274984abb3..0000000000
--- a/branches/sca-equinox/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClientImpl.java
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- * 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.sca.test;
-
-import junit.framework.Assert;
-
-import org.osoa.sca.annotations.Reference;
-import org.osoa.sca.annotations.Service;
-
-@Service(CallBackApiClient.class)
-public class CallBackApiClientImpl implements CallBackApiClient, CallBackApiCallBack {
-
- @Reference
- protected CallBackApiService aCallBackService;
-
- private static String returnMessage = null;
- private static int callBackCount = 0;
- private static Object monitor = new Object();
-
- /**
- * This test calls function test 3a,3a1,3b,3c
- */
- public void run() {
-
- // This tests basic callback patterns.
-
- // Test3a is the basic callback where the target calls back prior to
- // returning to the client.
- test3a();
-
- test3a1();
-
- // Test3b is where the target does not call back to the client.
- test3b();
-
- // Test3c is where the target calls back multiple times to the client.
- test3c();
-
- return;
- }
-
- /**
- * This test is the basic callback where the target calls back prior to returning to the client.
- */
-
- private void test3a() {
- aCallBackService.knockKnock("Knock Knock");
- int count = 0;
-
- //
- // If we can't get a response in 30 seconds consider this a failure
- //
-
- synchronized (monitor) {
- while (returnMessage == null && count++ < 30) {
- try {
- monitor.wait(1000L);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- }
-
- Assert.assertEquals("CallBackApiITest - test3a", "Who's There", this.getReturnMessage());
-
- }
-
- /**
- * This test is the basic callback where the target calls back prior to returning to the client.
- */
- private void test3a1() {
- aCallBackService.knockKnockByRef("Knock Knock");
- int count = 0;
-
- //
- // If we can't get a response in 30 seconds consider this a failure
- //
-
- synchronized (monitor) {
- while (returnMessage == null && count++ < 30) {
- try {
- monitor.wait(1000L);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- }
-
- Assert.assertEquals("CallBackApiITest - test3a", "Who's There", this.getReturnMessage());
-
- }
-
- /**
- * This test is the basic callback where the target does not call back to the client
- */
- private void test3b() {
- aCallBackService.noCallBack("No Reply Desired");
- Assert.assertEquals("CallBackApiITest - test3b", 1, 1);
- return;
- }
-
- /**
- * This test is the basic callback where the target calls back multiple times to the client
- */
-
- private void test3c() {
- aCallBackService.multiCallBack("Call me back 3 times");
- int count = 0;
-
- //
- // If we can't get a response in 30 seconds consider this a failure
- //
-
- synchronized (monitor) {
- while (this.getCallBackCount() < 3 && count++ < 30) {
- try {
- monitor.wait(1000L);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- }
-
- Assert.assertEquals("CallBackApiITest - test3c", 3, this.getCallBackCount());
- return;
- }
-
- /**
- * This function returns a string
- *
- * @param void
- * @return String result string
- */
-
- public String getReturnMessage() {
- return returnMessage;
- }
-
- /**
- * This function set the returnMessage string
- *
- * @param String
- */
- public void setReturnMessage(String aReturnMessage) {
- returnMessage = aReturnMessage;
- }
-
- /**
- * This function returns the callBackCount variable
- *
- * @return Integer callBackCount variable
- */
- public int getCallBackCount() {
- return callBackCount;
- }
-
- /**
- * This function increments callBackCount variable by 1
- */
- public void incrementCallBackCount() {
- callBackCount++;
- }
-
- /**
- * This function prints a message synched with setReturnMessage function
- *
- * @param String
- */
- public void callBackMessage(String aString) {
- System.out.println("Entering callback callBackMessage: " + aString);
- synchronized (monitor) {
- this.setReturnMessage(aString);
- monitor.notify();
- }
- }
-
- /**
- * This function prints a message synched with incrementCallBackCount function
- *
- * @param String
- */
- public void callBackIncrement(String aString) {
- System.out.println("Entering callback increment: " + aString);
- synchronized (monitor) {
- this.incrementCallBackCount();
- monitor.notify();
- }
- }
-
-}
diff --git a/branches/sca-equinox/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiService.java b/branches/sca-equinox/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiService.java
deleted file mode 100644
index 33de1e7739..0000000000
--- a/branches/sca-equinox/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiService.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * 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.sca.test;
-
-import org.osoa.sca.annotations.Callback;
-import org.osoa.sca.annotations.Remotable;
-
-@Remotable
-@Callback(CallBackApiCallBack.class)
-/**
- *
- */
-public interface CallBackApiService {
- /**
- * This function is defined in CallBackApiServiceImpl
- */
- public void knockKnock(String aString);
-
- /**
- * This function is defined in CallBackApiServiceImpl
- */
- public void knockKnockByRef(String aString);
-
- /**
- * This function is defined in CallBackApiServiceImpl
- */
- public void noCallBack(String aString);
-
- /**
- * This function is defined in CallBackApiServiceImpl
- */
- public void multiCallBack(String aString);
-
-}
diff --git a/branches/sca-equinox/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiServiceImpl.java b/branches/sca-equinox/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiServiceImpl.java
deleted file mode 100644
index 61e2c7ee8f..0000000000
--- a/branches/sca-equinox/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiServiceImpl.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * 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.sca.test;
-
-import org.osoa.sca.CallableReference;
-import org.osoa.sca.ComponentContext;
-import org.osoa.sca.RequestContext;
-import org.osoa.sca.annotations.Callback;
-import org.osoa.sca.annotations.Context;
-import org.osoa.sca.annotations.Service;
-
-@Service(CallBackApiService.class)
-public class CallBackApiServiceImpl implements CallBackApiService {
-
- @Context
- protected ComponentContext componentContext;
- /**
- * Object of CallBackApiCallBack class
- */
- private CallBackApiCallBack callback;
-
- @Callback
- protected CallableReference callbackRef;
-
- /**
- * This function get an object of CallBackApiServiceImpl by calling getCallBackInterface function and calls the
- * callBackMessage function.
- *
- * @param aString String passed by a function call
- */
-
- public void knockKnock(String aString) {
-
- System.out.println("CallBackApiServiceImpl message received: " + aString);
- callback = this.getCallBackInterface();
- callback.callBackMessage("Who's There");
- System.out.println("CallBackApiServiceImpl response sent");
- return;
-
- }
-
- /**
- * This function calls the callBackMessage function.
- * The reference to this function is received from Call back reference to the class CallBackApiService.
- *
- * @param aString String passed by a function call
- */
- public void knockKnockByRef(String aString) {
-
- System.out.println("CallBackApiServiceImpl message received: " + aString);
- callbackRef.getService().callBackMessage("Who's There");
- System.out.println("CallBackApiServiceImpl response sent");
- return;
-
- }
-
- /**
- * This function get an object of CallBackApiServiceImpl by calling getCallBackInterface function.
- * This function then places multiple callBack using the callbackIncrement function defined in
- * callBack.ApiServiceImpl
- *
- * @param aString String passed by a function call
- */
- public void multiCallBack(String aString) {
-
- callback = this.getCallBackInterface();
-
- System.out.println("CallBackApiServiceImpl message received: " + aString);
- callback.callBackIncrement("Who's There 1");
- System.out.println("CallBackApiServiceImpl response sent");
- callback.callBackIncrement("Who's There 2");
- System.out.println("CallBackApiServiceImpl response sent");
- callback.callBackIncrement("Who's There 3");
- System.out.println("CallBackApiServiceImpl response sent");
- return;
-
- }
-
- /**
- * This function does not callBack any function.
- *
- * @param aString String passed by a function call
- */
- public void noCallBack(String aString) {
-
- System.out.println("CallBackApiServiceImpl message received: " + aString);
-
- return;
-
- }
-
- /**
- * This function get an object of CallBackApiServiceImpl from the present componentContext
- *
- * @param void
- */
- private CallBackApiCallBack getCallBackInterface() {
- System.out.println("CallBackApiServiceImpl getting request context");
- RequestContext rc = componentContext.getRequestContext();
- System.out.println("CallBackApiServiceImpl getting callback from request context");
- callback = rc.getCallback();
- System.out.println("CallBackApiServiceImpl returning callback");
- return callback;
-
- }
-
-}
diff --git a/branches/sca-equinox/itest/callback-api/src/main/resources/CallBackApiTest.composite b/branches/sca-equinox/itest/callback-api/src/main/resources/CallBackApiTest.composite
deleted file mode 100644
index 946c4862ee..0000000000
--- a/branches/sca-equinox/itest/callback-api/src/main/resources/CallBackApiTest.composite
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/branches/sca-equinox/itest/callback-api/src/main/resources/META-INF/sca-contribution.xml b/branches/sca-equinox/itest/callback-api/src/main/resources/META-INF/sca-contribution.xml
deleted file mode 100644
index 19eb25631e..0000000000
--- a/branches/sca-equinox/itest/callback-api/src/main/resources/META-INF/sca-contribution.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/branches/sca-equinox/itest/callback-api/src/test/java/org/apache/tuscany/sca/test/CallBackApiTestCase.java b/branches/sca-equinox/itest/callback-api/src/test/java/org/apache/tuscany/sca/test/CallBackApiTestCase.java
deleted file mode 100644
index 9471049c74..0000000000
--- a/branches/sca-equinox/itest/callback-api/src/test/java/org/apache/tuscany/sca/test/CallBackApiTestCase.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * 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.sca.test;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-public class CallBackApiTestCase extends TestCase {
-
- private static SCADomain domain;
- private CallBackApiClient aCallBackClient;
-
- /**
- * This function uses the Instance of CallBackApiClient.class
- * This function calls the run function defined in the CallBackApiClinet Interface
- * which in turn executes the following test cases.
- * 1. Basic callback patterns
- * 2. Test in which the target does not call back to the client
- * 3. Test in which the target calls back multiple times to the client.
- */
- public void testCallBackBasic() {
- aCallBackClient.run();
- }
-
- /**
- * This function creates the SCADomain instance and gets an Instance of CallBackApiClient.class
- */
- @Override
- protected void setUp() throws Exception {
- if (domain == null) {
- domain = SCADomain.newInstance("CallBackApiTest.composite");
- }
-
- aCallBackClient = domain.getService(CallBackApiClient.class, "CallBackApiClient");
- }
-
- /**
- * This function destroys the SCADomain instance that was created in setUp()
- */
- @Override
- protected void tearDown() throws Exception {
- domain.close();
- }
-
-}
diff --git a/branches/sca-equinox/itest/callback-basic/pom.xml b/branches/sca-equinox/itest/callback-basic/pom.xml
deleted file mode 100644
index 54403a30d6..0000000000
--- a/branches/sca-equinox/itest/callback-basic/pom.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
- 4.0.0
-
- org.apache.tuscany.sca
- tuscany-itest
- 1.4-EQUINOX-SNAPSHOT
- ../pom.xml
-
- itest-callback-basic
- Apache Tuscany SCA Callback Basic Integration Tests
-
-
-
- org.apache.tuscany.sca
- tuscany-host-embedded
- 1.4-EQUINOX-SNAPSHOT
-
-
-
- org.apache.tuscany.sca
- tuscany-implementation-java-runtime
- 1.4-EQUINOX-SNAPSHOT
- runtime
-
-
-
-
- ${basedir}/../build-was-integration.xml
- ${basedir}/../wasAdmin.py
-
-
diff --git a/branches/sca-equinox/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicCallBack.java b/branches/sca-equinox/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicCallBack.java
deleted file mode 100644
index 5e9d3d6821..0000000000
--- a/branches/sca-equinox/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicCallBack.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * 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.sca.test;
-
-import org.osoa.sca.annotations.Remotable;
-
-@Remotable
-/**
- *
- */
-public interface CallBackBasicCallBack {
-
- public void callBackMessage(String aString);
-
- public void callBackIncrement(String aString);
-
-}
diff --git a/branches/sca-equinox/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClient.java b/branches/sca-equinox/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClient.java
deleted file mode 100644
index 9f4019f28c..0000000000
--- a/branches/sca-equinox/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClient.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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.sca.test;
-
-import org.osoa.sca.annotations.Remotable;
-
-@Remotable
-public interface CallBackBasicClient {
-
- public void run();
-
-}
diff --git a/branches/sca-equinox/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClientImpl.java b/branches/sca-equinox/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClientImpl.java
deleted file mode 100644
index e0e6d7eb8c..0000000000
--- a/branches/sca-equinox/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClientImpl.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * 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.sca.test;
-
-import junit.framework.Assert;
-
-import org.osoa.sca.annotations.Reference;
-import org.osoa.sca.annotations.Service;
-
-@Service(CallBackBasicClient.class)
-public class CallBackBasicClientImpl implements CallBackBasicClient, CallBackBasicCallBack {
-
- @Reference
- protected CallBackBasicService aCallBackService;
- private static String returnMessage = null;
- private static int callBackCount = 0;
- private static Object monitor = new Object();
-
- public void run() {
-
- // This tests basic callback patterns.
-
- // Test1 is the basic callback where the target calls back prior to
- // returning to the client.
- test1a();
-
- // Test2 is where the target does not call back to the client.
- test1b();
-
- // Test3 is where the target calls back multiple times to the client.
- test1c();
-
- return;
- }
-
- private void test1a() {
- aCallBackService.knockKnock("Knock Knock");
- int count = 0;
-
- //
- // If we can't get a response in 30 seconds consider this a failure
- //
-
- synchronized (monitor) {
- while (returnMessage == null && count++ < 30) {
- try {
- monitor.wait(1000L);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- }
-
- Assert.assertEquals("CallBackBasicITest - test1a", "Who's There", this.getReturnMessage());
-
- }
-
- private void test1b() {
- aCallBackService.noCallBack("No Reply Desired");
- Assert.assertEquals("CallBackBasicITest - test1b", 1, 1);
-
- return;
- }
-
- private void test1c() {
- aCallBackService.multiCallBack("Call me back 3 times");
- int count = 0;
-
- //
- // If we can't get a response in 30 seconds consider this a failure
- //
-
- synchronized (monitor) {
- while (this.getCallBackCount() < 3 && count++ < 30) {
- try {
- monitor.wait(1000L);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- }
-
- Assert.assertEquals("CallBackBasicITest - test1c", 3, this.getCallBackCount());
- return;
- }
-
- public String getReturnMessage() {
- return returnMessage;
- }
-
- public void setReturnMessage(String aReturnMessage) {
- returnMessage = aReturnMessage;
- }
-
- public int getCallBackCount() {
- return callBackCount;
- }
-
- public void incrementCallBackCount() {
- callBackCount++;
- }
-
- public void callBackMessage(String aString) {
- System.out.println("Entering callback callBackMessage: " + aString);
- synchronized (monitor) {
- this.setReturnMessage(aString);
- monitor.notify();
- }
- }
-
- public void callBackIncrement(String aString) {
- System.out.println("Entering callback increment: " + aString);
- synchronized (monitor) {
- this.incrementCallBackCount();
- monitor.notify();
- }
- }
-
-}
diff --git a/branches/sca-equinox/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicService.java b/branches/sca-equinox/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicService.java
deleted file mode 100644
index bd41fa7037..0000000000
--- a/branches/sca-equinox/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicService.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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.sca.test;
-
-import org.osoa.sca.annotations.Callback;
-import org.osoa.sca.annotations.Remotable;
-
-@Remotable
-@Callback(CallBackBasicCallBack.class)
-/**
- *
- */
-public interface CallBackBasicService {
-
- public void knockKnock(String aString);
-
- public void noCallBack(String aString);
-
- public void multiCallBack(String aString);
-
-}
diff --git a/branches/sca-equinox/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicServiceImpl.java b/branches/sca-equinox/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicServiceImpl.java
deleted file mode 100644
index 4ca2dc9af9..0000000000
--- a/branches/sca-equinox/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicServiceImpl.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * 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.sca.test;
-
-import org.osoa.sca.annotations.Callback;
-import org.osoa.sca.annotations.Service;
-
-@Service(CallBackBasicService.class)
-public class CallBackBasicServiceImpl implements CallBackBasicService {
-
- @Callback
- protected CallBackBasicCallBack callback;
-
- public void knockKnock(String aString) {
-
- System.out.println("CallBackBasicServiceImpl message received: " + aString);
- callback.callBackMessage("Who's There");
- System.out.println("CallBackBasicServiceImpl response sent");
- return;
-
- }
-
- public void multiCallBack(String aString) {
-
- System.out.println("CallBackBasicServiceImpl message received: " + aString);
- callback.callBackIncrement("Who's There 1");
- System.out.println("CallBackBasicServiceImpl response sent");
- callback.callBackIncrement("Who's There 2");
- System.out.println("CallBackBasicServiceImpl response sent");
- callback.callBackIncrement("Who's There 3");
- System.out.println("CallBackBasicServiceImpl response sent");
- return;
-
- }
-
- public void noCallBack(String aString) {
-
- System.out.println("CallBackBasicServiceImpl message received: " + aString);
- // System.out.println("CallBackBasicServiceImpl No response desired");
- return;
-
- }
-}
diff --git a/branches/sca-equinox/itest/callback-basic/src/main/resources/CallBackBasicTest.composite b/branches/sca-equinox/itest/callback-basic/src/main/resources/CallBackBasicTest.composite
deleted file mode 100644
index c506956088..0000000000
--- a/branches/sca-equinox/itest/callback-basic/src/main/resources/CallBackBasicTest.composite
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/branches/sca-equinox/itest/callback-basic/src/main/resources/META-INF/sca-contribution.xml b/branches/sca-equinox/itest/callback-basic/src/main/resources/META-INF/sca-contribution.xml
deleted file mode 100644
index adf28214f6..0000000000
--- a/branches/sca-equinox/itest/callback-basic/src/main/resources/META-INF/sca-contribution.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/branches/sca-equinox/itest/callback-basic/src/test/java/org/apache/tuscany/sca/test/CallBackBasicTestCase.java b/branches/sca-equinox/itest/callback-basic/src/test/java/org/apache/tuscany/sca/test/CallBackBasicTestCase.java
deleted file mode 100644
index 32c26a348a..0000000000
--- a/branches/sca-equinox/itest/callback-basic/src/test/java/org/apache/tuscany/sca/test/CallBackBasicTestCase.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * 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.sca.test;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-public class CallBackBasicTestCase extends TestCase {
-
- private static SCADomain domain;
- private CallBackBasicClient aCallBackClient;
-
- public void testCallBackBasic() {
- aCallBackClient.run();
- }
-
- @Override
- protected void setUp() throws Exception {
- if( domain==null ) {
- domain = SCADomain.newInstance("CallBackBasicTest.composite");
- }
-
- aCallBackClient = domain.getService(CallBackBasicClient.class, "CallBackBasicClient");
- }
-
- @Override
- protected void tearDown() throws Exception {
- domain.close();
- }
-
-
-}
diff --git a/branches/sca-equinox/itest/callback-complex-type/pom.xml b/branches/sca-equinox/itest/callback-complex-type/pom.xml
deleted file mode 100644
index 9bcb760538..0000000000
--- a/branches/sca-equinox/itest/callback-complex-type/pom.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
- 4.0.0
-
- org.apache.tuscany.sca
- tuscany-itest
- 1.4-EQUINOX-SNAPSHOT
- ../pom.xml
-
- itest-callback-complex-type
- Apache Tuscany SCA Callback Complex Type Integration Tests
-
-
-
- org.apache.tuscany.sca
- tuscany-host-embedded
- 1.4-EQUINOX-SNAPSHOT
-
-
-
- org.apache.tuscany.sca
- tuscany-implementation-java-runtime
- 1.4-EQUINOX-SNAPSHOT
- runtime
-
-
-
diff --git a/branches/sca-equinox/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeCallBack.java b/branches/sca-equinox/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeCallBack.java
deleted file mode 100644
index 9fddb850ba..0000000000
--- a/branches/sca-equinox/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeCallBack.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * 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.sca.test;
-
-import org.osoa.sca.annotations.Remotable;
-
-@Remotable
-/**
- *
- */
-public interface CallBackCTypeCallBack {
-
- public void callBackMessage(String aString);
-
- public void callBackIncrement(String aString);
-
-}
diff --git a/branches/sca-equinox/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeClient.java b/branches/sca-equinox/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeClient.java
deleted file mode 100644
index 739983c277..0000000000
--- a/branches/sca-equinox/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeClient.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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.sca.test;
-
-import org.osoa.sca.annotations.Remotable;
-
-@Remotable
-public interface CallBackCTypeClient {
-
- public void run();
-
-}
diff --git a/branches/sca-equinox/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeClientImpl.java b/branches/sca-equinox/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeClientImpl.java
deleted file mode 100644
index d2b03fcde7..0000000000
--- a/branches/sca-equinox/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeClientImpl.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * 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.sca.test;
-
-import junit.framework.Assert;
-
-import org.osoa.sca.annotations.Reference;
-import org.osoa.sca.annotations.Service;
-
-@Service(CallBackCTypeClient.class)
-public class CallBackCTypeClientImpl implements CallBackCTypeClient, CallBackCTypeCallBack {
-
- @Reference
- protected CallBackCTypeService aCallBackService;
- private static String returnMessage = null;
- private static int callBackCount = 0;
- private static Object monitor = new Object();
-
- public CallBackCTypeClientImpl() {
- }
-
- public void run() {
-
- // This test is the same as the Basic Callback except it uses a
- // componentType side file.
- // This test currently fails because the integration test environment
- // does not properly copy
- // the componentType files to the target folder. This is documented in
- // Tuscany-967.
-
- // Test12a is the basic callback where the target calls back prior to
- // returning to the client.
- test12a();
-
- // Test12b is where the target does not call back to the client.
- test12b();
-
- // Test12c is where the target calls back multiple times to the client.
- test12c();
-
- return;
- }
-
- private void test12a() {
- aCallBackService.knockKnock("Knock Knock");
- int count = 0;
-
- //
- // If we can't get a response in 30 seconds consider this a failure
- //
-
- synchronized (monitor) {
- while (returnMessage == null && count++ < 30) {
- try {
- monitor.wait(1000L);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- }
-
- Assert.assertEquals("CallBackBasicITest - test12a -", "Who's There", this.getReturnMessage());
-
- }
-
- private void test12b() {
- aCallBackService.noCallBack("No Reply Desired");
- Assert.assertEquals("CallBackBasicITest - test12b -", 1, 1);
- return;
- }
-
- private void test12c() {
- aCallBackService.multiCallBack("Call me back 3 times");
- int count = 0;
-
- //
- // If we can't get a response in 30 seconds consider this a failure
- //
-
- synchronized (monitor) {
- while (this.getCallBackCount() < 3 && count++ < 30) {
- try {
- monitor.wait(1000L);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- }
-
- Assert.assertEquals("CallBackBasicITest - test12c -", 3, this.getCallBackCount());
- return;
- }
-
- public String getReturnMessage() {
- return returnMessage;
- }
-
- public void setReturnMessage(String aReturnMessage) {
- returnMessage = aReturnMessage;
- }
-
- public int getCallBackCount() {
- return callBackCount;
- }
-
- public void incrementCallBackCount() {
- callBackCount++;
- }
-
- public void callBackMessage(String aString) {
- System.out.println("Entering callback callBackMessage: " + aString);
- synchronized (monitor) {
- this.setReturnMessage(aString);
- monitor.notify();
- }
- }
-
- public void callBackIncrement(String aString) {
- System.out.println("Entering callback increment: " + aString);
- synchronized (monitor) {
- this.incrementCallBackCount();
- monitor.notify();
- }
- }
-
-}
diff --git a/branches/sca-equinox/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeService.java b/branches/sca-equinox/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeService.java
deleted file mode 100644
index ffbf4f35fa..0000000000
--- a/branches/sca-equinox/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeService.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * 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.sca.test;
-
-import org.osoa.sca.annotations.Remotable;
-
-@Remotable
-// @Callback(CallBackCTypeCallBack.class)
-/**
- *
- */
-public interface CallBackCTypeService {
-
- public void knockKnock(String aString);
-
- public void noCallBack(String aString);
-
- public void multiCallBack(String aString);
-
-}
diff --git a/branches/sca-equinox/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeServiceImpl.java b/branches/sca-equinox/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeServiceImpl.java
deleted file mode 100644
index dc31ed156b..0000000000
--- a/branches/sca-equinox/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeServiceImpl.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * 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.sca.test;
-
-import org.osoa.sca.annotations.Callback;
-import org.osoa.sca.annotations.Service;
-
-@Service(CallBackCTypeService.class)
-public class CallBackCTypeServiceImpl implements CallBackCTypeService {
-
- @Callback
- protected CallBackCTypeCallBack callback;
-
- public CallBackCTypeServiceImpl() {
- }
-
- public void knockKnock(String aString) {
-
- System.out.println("CallBackCTypeServiceImpl message received: " + aString);
- callback.callBackMessage("Who's There");
- System.out.println("CallBackCTypeServiceImpl response sent");
- return;
-
- }
-
- public void multiCallBack(String aString) {
-
- System.out.println("CallBackCTypeServiceImpl message received: " + aString);
- callback.callBackIncrement("Who's There 1");
- System.out.println("CallBackCTypeServiceImpl response sent");
- callback.callBackIncrement("Who's There 2");
- System.out.println("CallBackCTypeServiceImpl response sent");
- callback.callBackIncrement("Who's There 3");
- System.out.println("CallBackCTypeServiceImpl response sent");
- return;
-
- }
-
- public void noCallBack(String aString) {
-
- System.out.println("CallBackCTypeServiceImpl message received: " + aString);
- System.out.println("CallBackCTypeServiceImpl No response desired");
- return;
-
- }
-}
diff --git a/branches/sca-equinox/itest/callback-complex-type/src/main/resources/CallBackCTypeClient.composite b/branches/sca-equinox/itest/callback-complex-type/src/main/resources/CallBackCTypeClient.composite
deleted file mode 100644
index 3f48f16389..0000000000
--- a/branches/sca-equinox/itest/callback-complex-type/src/main/resources/CallBackCTypeClient.composite
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/branches/sca-equinox/itest/callback-complex-type/src/main/resources/org/apache/tuscany/sca/test/CallBackCTypeServiceImpl.componentType b/branches/sca-equinox/itest/callback-complex-type/src/main/resources/org/apache/tuscany/sca/test/CallBackCTypeServiceImpl.componentType
deleted file mode 100644
index ff38134df5..0000000000
--- a/branches/sca-equinox/itest/callback-complex-type/src/main/resources/org/apache/tuscany/sca/test/CallBackCTypeServiceImpl.componentType
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/branches/sca-equinox/itest/callback-complex-type/src/test/java/org/apache/tuscany/sca/test/CallBackCTypeTestCaseFIXME.java b/branches/sca-equinox/itest/callback-complex-type/src/test/java/org/apache/tuscany/sca/test/CallBackCTypeTestCaseFIXME.java
deleted file mode 100644
index 33d1afaecd..0000000000
--- a/branches/sca-equinox/itest/callback-complex-type/src/test/java/org/apache/tuscany/sca/test/CallBackCTypeTestCaseFIXME.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * 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.sca.test;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-//FIXME Fix this test case
-public class CallBackCTypeTestCaseFIXME extends TestCase {
-
- private SCADomain domain;
- private CallBackCTypeClient aCallBackClient;
-
- public void testCallBackBasic() {
- aCallBackClient.run();
- }
-
- @Override
- protected void setUp() throws Exception {
- domain = SCADomain.newInstance("CallBackCTypeClient.composite");
-
- aCallBackClient =
- domain.getService(CallBackCTypeClient.class, "CallBackCTypeClient");
- }
-
- @Override
- protected void tearDown() throws Exception {
- domain.close();
- }
-
-}
diff --git a/branches/sca-equinox/itest/callback-id/pom.xml b/branches/sca-equinox/itest/callback-id/pom.xml
deleted file mode 100644
index 7523306d92..0000000000
--- a/branches/sca-equinox/itest/callback-id/pom.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
- 4.0.0
-
- org.apache.tuscany.sca
- tuscany-itest
- 1.4-EQUINOX-SNAPSHOT
- ../pom.xml
-
- itest-callback-id
- Apache Tuscany SCA Callback ID Integration Tests
-
-
-
- org.apache.tuscany.sca
- tuscany-host-embedded
- 1.4-EQUINOX-SNAPSHOT
-
-
-
- org.apache.tuscany.sca
- tuscany-implementation-java-runtime
- 1.4-EQUINOX-SNAPSHOT
- runtime
-
-
-
diff --git a/branches/sca-equinox/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdCallBack.java b/branches/sca-equinox/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdCallBack.java
deleted file mode 100644
index b14560a8c3..0000000000
--- a/branches/sca-equinox/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdCallBack.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * 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.sca.test;
-
-import org.osoa.sca.annotations.Remotable;
-
-@Remotable
-/**
- *
- */
-public interface CallBackIdCallBack {
-
- public void callBackMessage(String aString);
-
-}
diff --git a/branches/sca-equinox/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdClient.java b/branches/sca-equinox/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdClient.java
deleted file mode 100644
index a9e551f8b4..0000000000
--- a/branches/sca-equinox/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdClient.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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.sca.test;
-
-import org.osoa.sca.annotations.Remotable;
-
-@Remotable
-public interface CallBackIdClient {
-
- public void run();
-
-}
diff --git a/branches/sca-equinox/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdClientImpl.java b/branches/sca-equinox/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdClientImpl.java
deleted file mode 100644
index 59c9c3d069..0000000000
--- a/branches/sca-equinox/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdClientImpl.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * 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.sca.test;
-
-import junit.framework.Assert;
-
-import org.osoa.sca.ComponentContext;
-import org.osoa.sca.RequestContext;
-import org.osoa.sca.ServiceReference;
-import org.osoa.sca.annotations.Context;
-import org.osoa.sca.annotations.Reference;
-import org.osoa.sca.annotations.Service;
-
-@Service(CallBackIdClient.class)
-public class CallBackIdClientImpl implements CallBackIdClient, CallBackIdCallBack {
-
- @Context
- protected ComponentContext componentContext;
-
- @Reference
- protected ServiceReference aCallBackService;
-
- private static String returnMessage = null;
- private static Object monitor = new Object();
- private static Object callBackId;
-
- public void run() {
-
- // This tests the use of the set/get callbackId API both SCA generated
- // and client specified.
-
- // Test1 uses a SCA generated callback ID and compare that with the
- // callbackID returned during callback.
- test11a();
-
- // Test2 uses a Client specified callback ID and compare that with the
- // callbackID returned during callback.
- test11b();
-
- return;
- }
-
- private void test11a() {
-
- // Retrieve this services callback ID and save it. Once the callback is
- // received the callback ID will be compared with the one
- // returned. Equal is good.
-
- Object origCallBackId = aCallBackService.getCallbackID();
- aCallBackService.getService().knockKnock("Knock Knock - Test1");
- int count = 0;
-
- //
- // If we cannot get a response in 30 seconds consider this a failure
- //
-
- synchronized (monitor) {
- while (returnMessage == null && count++ < 30) {
- try {
- monitor.wait(1000L);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- }
-
- Assert.assertEquals("CallBackIdITest - test11a - SCA Generated Id", origCallBackId, this.getCallBackId());
-
- }
-
- private void test11b() {
-
- // Set the services callback ID and save it. Once the callback is
- // received the callback ID will be compared with the one
- // returned. Equal is good.
-
- String origCallBackId = "CallBackId1";
- aCallBackService.setCallbackID(origCallBackId);
-
- aCallBackService.getService().knockKnock("Knock Knock - Test2");
- int count = 0;
-
- //
- // If we can't get a response in 30 seconds consider this a failure
- //
-
- synchronized (monitor) {
- while (returnMessage == null && count++ < 30) {
- try {
- monitor.wait(1000L);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- }
-
- Assert
- .assertEquals("CallBackIdITest - 11b - Client Specified Id", origCallBackId, (String)this.getCallBackId());
-
- }
-
- public String getReturnMessage() {
- return returnMessage;
- }
-
- public void setReturnMessage(String aReturnMessage) {
- returnMessage = aReturnMessage;
- }
-
- public void callBackMessage(String aString) {
-
- System.out.println("Entering callback callBackMessage: " + aString);
- RequestContext rc = componentContext.getRequestContext();
- Object callBackId = rc.getServiceReference().getCallbackID();
-
- synchronized (monitor) {
- this.setReturnMessage(aString);
- this.setCallBackId(callBackId);
- monitor.notify();
- }
- }
-
- protected Object getCallBackId() {
- return callBackId;
- }
-
- protected void setCallBackId(Object aCallBackId) {
- callBackId = aCallBackId;
- }
-
-}
diff --git a/branches/sca-equinox/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdService.java b/branches/sca-equinox/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdService.java
deleted file mode 100644
index 18c592a1c1..0000000000
--- a/branches/sca-equinox/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdService.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * 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.sca.test;
-
-import org.osoa.sca.annotations.Callback;
-import org.osoa.sca.annotations.Remotable;
-
-@Remotable
-@Callback(CallBackIdCallBack.class)
-/**
- *
- */
-public interface CallBackIdService {
-
- public void knockKnock(String aString);
-
-}
diff --git a/branches/sca-equinox/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdServiceImpl.java b/branches/sca-equinox/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdServiceImpl.java
deleted file mode 100644
index 8b0a4b69cf..0000000000
--- a/branches/sca-equinox/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdServiceImpl.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * 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.sca.test;
-
-import org.osoa.sca.ComponentContext;
-import org.osoa.sca.RequestContext;
-import org.osoa.sca.annotations.Callback;
-import org.osoa.sca.annotations.Context;
-import org.osoa.sca.annotations.Service;
-
-@Service(CallBackIdService.class)
-public class CallBackIdServiceImpl implements CallBackIdService {
-
- @Callback
- protected CallBackIdCallBack callback;
- @Context
- protected ComponentContext compositeContext;
-
- public void knockKnock(String aString) {
-
- System.out.println("CallBackIdServiceImpl message received: " + aString);
- RequestContext rc = compositeContext.getRequestContext();
- Object callBackId = rc.getServiceReference().getCallbackID();
- System.out.println("CallBackIdServiceImpl callbackID: " + callBackId);
-
- callback.callBackMessage("Who's There");
- System.out.println("CallBackIdServiceImpl response sent");
- return;
-
- }
-
-}
diff --git a/branches/sca-equinox/itest/callback-id/src/main/resources/CallBackIdClient.composite b/branches/sca-equinox/itest/callback-id/src/main/resources/CallBackIdClient.composite
deleted file mode 100644
index c9a6ba6258..0000000000
--- a/branches/sca-equinox/itest/callback-id/src/main/resources/CallBackIdClient.composite
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/branches/sca-equinox/itest/callback-id/src/test/java/org/apache/tuscany/sca/test/CallBackIdTestCase.java b/branches/sca-equinox/itest/callback-id/src/test/java/org/apache/tuscany/sca/test/CallBackIdTestCase.java
deleted file mode 100644
index 771fbb8ff7..0000000000
--- a/branches/sca-equinox/itest/callback-id/src/test/java/org/apache/tuscany/sca/test/CallBackIdTestCase.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * 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.sca.test;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-public class CallBackIdTestCase extends TestCase {
-
- private SCADomain domain;
- private CallBackIdClient aCallBackClient;
-
- public void testCallBackBasic() {
- aCallBackClient.run();
- }
-
- @Override
- protected void setUp() throws Exception {
- domain = SCADomain.newInstance("CallBackIdClient.composite");
-
- aCallBackClient = domain.getService(CallBackIdClient.class, "CallBackIdClient");
- }
-
- @Override
- protected void tearDown() throws Exception {
- domain.close();
- }
-}
diff --git a/branches/sca-equinox/itest/callback-multiple-wires/pom.xml b/branches/sca-equinox/itest/callback-multiple-wires/pom.xml
deleted file mode 100644
index ad236df1ad..0000000000
--- a/branches/sca-equinox/itest/callback-multiple-wires/pom.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
- 4.0.0
-
- org.apache.tuscany.sca
- tuscany-itest
- 1.4-EQUINOX-SNAPSHOT
- ../pom.xml
-
- itest-callback-multiple-wires
- Apache Tuscany SCA Callback With Mutiple Wires Test
-
-
-
- org.apache.tuscany.sca
- tuscany-host-embedded
- 1.4-EQUINOX-SNAPSHOT
-
-
-
- org.apache.tuscany.sca
- tuscany-implementation-java-runtime
- 1.4-EQUINOX-SNAPSHOT
- runtime
-
-
-
diff --git a/branches/sca-equinox/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClient.java b/branches/sca-equinox/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClient.java
deleted file mode 100644
index 7c80d222fc..0000000000
--- a/branches/sca-equinox/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClient.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * 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.sca.test.callback;
-
-/**
- * The client interface
- */
-public interface MyClient {
-
- void aClientMethod();
-}
diff --git a/branches/sca-equinox/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClientImpl1.java b/branches/sca-equinox/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClientImpl1.java
deleted file mode 100644
index df91f3d268..0000000000
--- a/branches/sca-equinox/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClientImpl1.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * 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.sca.test.callback;
-
-import org.osoa.sca.annotations.Reference;
-import org.osoa.sca.annotations.Scope;
-import org.osoa.sca.annotations.Service;
-
-/**
- * Demonstrates a component-to-component callback invocation
- */
-@Service(MyClient.class)
-@Scope("COMPOSITE")
-public class MyClientImpl1 implements MyClient, MyServiceCallback {
-
- private MyService myService;
- static String result;
-
- @Reference
- public void setMyService(MyService myService) {
- this.myService = myService;
- }
-
- public void aClientMethod() {
- myService.someMethod("-> someMethod1");
- }
-
- public void receiveResult(String result) {
- System.out.println("Work thread " + Thread.currentThread());
- System.out.println("Result: " + result);
- MyClientImpl1.result = result;
- }
-}
diff --git a/branches/sca-equinox/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClientImpl2.java b/branches/sca-equinox/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClientImpl2.java
deleted file mode 100644
index a0a9564002..0000000000
--- a/branches/sca-equinox/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClientImpl2.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * 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.sca.test.callback;
-
-import org.osoa.sca.annotations.Reference;
-import org.osoa.sca.annotations.Scope;
-import org.osoa.sca.annotations.Service;
-
-/**
- * Demonstrates a component-to-component callback invocation
- */
-@Service(MyClient.class)
-@Scope("COMPOSITE")
-public class MyClientImpl2 implements MyClient, MyServiceCallback {
-
- private MyService myService;
- static String result;
-
- @Reference
- public void setMyService(MyService myService) {
- this.myService = myService;
- }
-
- public void aClientMethod() {
- myService.someMethod("-> someMethod2");
- }
-
- public void receiveResult(String result) {
- System.out.println("Work thread " + Thread.currentThread());
- System.out.println("Result: " + result);
- MyClientImpl2.result = result;
- }
-}
diff --git a/branches/sca-equinox/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyService.java b/branches/sca-equinox/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyService.java
deleted file mode 100644
index cfd601f546..0000000000
--- a/branches/sca-equinox/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyService.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * 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.sca.test.callback;
-
-import org.osoa.sca.annotations.Callback;
-import org.osoa.sca.annotations.OneWay;
-
-/**
- * This service that will be invoked in a non-blocking fashion
- */
-@Callback(MyServiceCallback.class)
-public interface MyService {
-
- @OneWay
- void someMethod(String arg);
-}
diff --git a/branches/sca-equinox/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyServiceCallback.java b/branches/sca-equinox/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyServiceCallback.java
deleted file mode 100644
index f198efae51..0000000000
--- a/branches/sca-equinox/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyServiceCallback.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * 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.sca.test.callback;
-
-/**
- * The callback interface for {@link MyService}.
- */
-public interface MyServiceCallback {
-
- void receiveResult(String result);
-}
diff --git a/branches/sca-equinox/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyServiceImpl.java b/branches/sca-equinox/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyServiceImpl.java
deleted file mode 100644
index d19b3fe355..0000000000
--- a/branches/sca-equinox/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyServiceImpl.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * 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.sca.test.callback;
-
-import org.osoa.sca.RequestContext;
-import org.osoa.sca.annotations.Context;
-import org.osoa.sca.annotations.Scope;
-import org.osoa.sca.annotations.Service;
-
-/**
- * This class implements MyService and uses a callback.
- */
-@Service(MyService.class)
-@Scope("COMPOSITE")
-public class MyServiceImpl implements MyService {
-
- @Context
- protected RequestContext requestContext;
-
- public void someMethod(String arg) {
- // invoke the callback
- try {
- MyServiceCallback myServiceCallback = requestContext.getCallback();
- myServiceCallback.receiveResult(arg + " -> receiveResult");
- } catch(RuntimeException e) {
- System.out.println("RuntimeException invoking receiveResult: " + e.toString());
- }
- }
-}
diff --git a/branches/sca-equinox/itest/callback-multiple-wires/src/main/resources/CallbackMultiWireTest.composite b/branches/sca-equinox/itest/callback-multiple-wires/src/main/resources/CallbackMultiWireTest.composite
deleted file mode 100644
index 3dae3ca3a8..0000000000
--- a/branches/sca-equinox/itest/callback-multiple-wires/src/main/resources/CallbackMultiWireTest.composite
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/branches/sca-equinox/itest/callback-multiple-wires/src/test/java/org/apache/tuscany/sca/test/callback/CallbackMultiWireTestCase.java b/branches/sca-equinox/itest/callback-multiple-wires/src/test/java/org/apache/tuscany/sca/test/callback/CallbackMultiWireTestCase.java
deleted file mode 100644
index 3c83e4bedd..0000000000
--- a/branches/sca-equinox/itest/callback-multiple-wires/src/test/java/org/apache/tuscany/sca/test/callback/CallbackMultiWireTestCase.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * 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.sca.test.callback;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-/**
- * A TestCase that demonstrates resolving the client service and initiating the callback sequence
- */
-public class CallbackMultiWireTestCase extends TestCase {
-
- private SCADomain scaDomain;
- private MyClient myClient1;
- private MyClient myClient2;
-
- @Override
- protected void setUp() throws Exception {
- scaDomain = SCADomain.newInstance("CallbackMultiWireTest.composite");
- myClient1 = scaDomain.getService(MyClient.class, "MyClientComponent1");
- myClient2 = scaDomain.getService(MyClient.class, "MyClientComponent2");
- }
-
- @Override
- protected void tearDown() throws Exception {
- scaDomain.close();
- }
-
- public void test() throws Exception {
- System.out.println("Main thread " + Thread.currentThread());
- myClient1.aClientMethod();
- myClient2.aClientMethod();
- System.out.println("Sleeping ...");
- Thread.sleep(300);
- assertEquals("-> someMethod1 -> receiveResult", MyClientImpl1.result);
- assertEquals("-> someMethod2 -> receiveResult", MyClientImpl2.result);
- }
-}
diff --git a/branches/sca-equinox/itest/callback-separatethread/pom.xml b/branches/sca-equinox/itest/callback-separatethread/pom.xml
deleted file mode 100644
index f3a75c4623..0000000000
--- a/branches/sca-equinox/itest/callback-separatethread/pom.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
- 4.0.0
-
- org.apache.tuscany.sca
- tuscany-itest
- 1.4-EQUINOX-SNAPSHOT
- ../pom.xml
-
- itest-callback-separatethread
- Apache Tuscany SCA Callback Using Separate Thread Integration Tests
-
-
-
- org.apache.tuscany.sca
- tuscany-host-embedded
- 1.4-EQUINOX-SNAPSHOT
-
-
-
- org.apache.tuscany.sca
- tuscany-implementation-java-runtime
- 1.4-EQUINOX-SNAPSHOT
- runtime
-
-
-
diff --git a/branches/sca-equinox/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadClient.java b/branches/sca-equinox/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadClient.java
deleted file mode 100644
index f812a39058..0000000000
--- a/branches/sca-equinox/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadClient.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * 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.sca.itest;
-
-import org.osoa.sca.annotations.Remotable;
-
-/**
- * This is the client interface for the call backs in a separate thread tests
- */
-@Remotable
-public interface CallBackSeparateThreadClient {
-
- /**
- * This tests call back patterns using separate threads.
- */
- void runTests();
-}
diff --git a/branches/sca-equinox/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadClientImpl.java b/branches/sca-equinox/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadClientImpl.java
deleted file mode 100644
index e861f8a3d1..0000000000
--- a/branches/sca-equinox/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadClientImpl.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * 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.sca.itest;
-
-import java.util.concurrent.atomic.AtomicInteger;
-
-import junit.framework.Assert;
-
-import org.osoa.sca.annotations.Reference;
-import org.osoa.sca.annotations.Service;
-
-/**
- * This is the client implementation for the call backs in a separate thread tests
- */
-@Service(CallBackSeparateThreadClient.class)
-public class CallBackSeparateThreadClientImpl implements CallBackSeparateThreadClient, EventProcessorCallBack {
- /**
- * Used to sleep for 60 seconds.
- */
- private static final int SIXTY_SECONDS = 60 * 1000;
-
- /**
- * Counts the number of one second call backs
- */
- private static final AtomicInteger oneSecondCallbackCount = new AtomicInteger();
-
- /**
- * Counts the number of five second call backs
- */
- private static final AtomicInteger fiveSecondCallbackCount = new AtomicInteger();
-
- /**
- * This is our injected reference to the EventProcessorService
- */
- @Reference
- protected EventProcessorService aCallBackService;
-
- /**
- * This tests call back patterns using separate threads.
- */
- public void runTests() {
- // Register for 1 second call back
- registerFor1SecondCallback();
-
- // Wait for a few 1 second call backs
- System.out.println("Waiting for some 1 second calls");
- waitForSome1SecondCallbacks();
-
- // Register for 5 second call back
- registerFor5SecondCallback();
-
- // Wait for a few 1 second call backs
- System.out.println("Waiting for some 1 second calls");
- waitForSome1SecondCallbacks();
-
- // Wait for a few 5 second call backs
- System.out.println("Waiting for some 5 second calls");
- waitForSome5SecondCallbacks();
-
- System.out.println("Done");
- }
-
- /**
- * Waits for some one second call backs to be fired
- */
- private void waitForSome1SecondCallbacks() {
- // Reset the one second call back count
- oneSecondCallbackCount.set(0);
-
- // Wait until we have 10 1 second call backs or 60 seconds has passed
- final long start = System.currentTimeMillis();
- do {
- if (oneSecondCallbackCount.get() >= 10) {
- System.out.println("Received enough 1 second notifications");
- return;
- }
-
- try {
- Thread.sleep(500);
- } catch (InterruptedException e) {
- Assert.fail("Unexpeceted exception " + e);
- }
- }
- while (System.currentTimeMillis() - start < SIXTY_SECONDS);
-
- // If we get to here then we did not receive enough events
- Assert.fail("Did not receive enough 1 second events");
- }
-
- /**
- * Waits for some five second call backs to be fired
- */
- private void waitForSome5SecondCallbacks() {
- // Reset the five second call back count
- fiveSecondCallbackCount.set(0);
-
- // Wait until we have 4 5 second call backs or 60 seconds has passed
- final long start = System.currentTimeMillis();
- do
- {
- if (fiveSecondCallbackCount.get() >= 4) {
- System.out.println("Received enough 5 second notifications");
- return;
- }
-
- try
- {
- Thread.sleep(500);
- }
- catch (InterruptedException e)
- {
- Assert.fail("Unexpeceted exception " + e);
- }
- }
- while (System.currentTimeMillis() - start < SIXTY_SECONDS);
-
- // If we get to here then we did not receive enough events
- Assert.fail("Did not receive enough 5 second events");
- }
-
- /**
- * Register to receive one second call backs
- */
- private void registerFor1SecondCallback() {
- aCallBackService.registerForEvent("ONE");
- return;
- }
-
- /**
- * Register to receive five second call backs
- */
- private void registerFor5SecondCallback() {
- aCallBackService.registerForEvent("FIVE");
- }
-
- /**
- * Method that is called when an Event is delivered.
- *
- * @param aEventName The name of the Event
- * @param aEventData The Event data
- */
- public void eventNotification(String aEventName, Object aEventData) {
- // System.out.println("Received Event : " + aEventName + " " + aEventData);
-
- if (aEventName.equals("ONE")) {
- final int newValue = oneSecondCallbackCount.incrementAndGet();
- //System.out.println("Received total of " + newValue + " 1 second call backs");
- } else if (aEventName.equals("FIVE")) {
- final int newValue = fiveSecondCallbackCount.incrementAndGet();
- //System.out.println("Received total of " + newValue + " 5 second call backs");
- }
- else
- System.out.println("Unknown event type of " + aEventName);
- }
-}
diff --git a/branches/sca-equinox/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorCallBack.java b/branches/sca-equinox/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorCallBack.java
deleted file mode 100644
index ae41f596fc..0000000000
--- a/branches/sca-equinox/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorCallBack.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * 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.sca.itest;
-
-
-import org.osoa.sca.annotations.Remotable;
-
-/**
- * The call back interface for the EventProcessorService that is implemented
- * by the client to receive event notifications
- */
-@Remotable
-public interface EventProcessorCallBack {
- /**
- * Call back notifying client of an Event
- *
- * @param aEventName The name of the Event
- * @param aEventData The data for the Event
- */
- void eventNotification(String aEventName, Object aEventData);
-}
diff --git a/branches/sca-equinox/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorService.java b/branches/sca-equinox/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorService.java
deleted file mode 100644
index c22b8cceec..0000000000
--- a/branches/sca-equinox/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorService.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * 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.sca.itest;
-
-import org.osoa.sca.annotations.Callback;
-import org.osoa.sca.annotations.Conversational;
-import org.osoa.sca.annotations.Remotable;
-
-
-/**
- * Sample Event Processor Service
- */
-@Conversational
-@Callback(EventProcessorCallBack.class)
-@Remotable
-public interface EventProcessorService {
-
- /**
- * Registers the client to receive notifications for the specified event
- *
- * @param aEventName The name of the Event to register
- */
- void registerForEvent(String aEventName);
-
- /**
- * Unregisters the client so it no longer receives notifications for the specified event
- *
- * @param aEventName The name of the Event to unregister
- */
- void unregisterForEvent(String aEventName);
-}
diff --git a/branches/sca-equinox/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorServiceImpl.java b/branches/sca-equinox/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorServiceImpl.java
deleted file mode 100644
index 4d672b3a8b..0000000000
--- a/branches/sca-equinox/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorServiceImpl.java
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- * 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.sca.itest;
-
-import java.util.Map;
-import java.util.Timer;
-import java.util.TimerTask;
-import java.util.UUID;
-import java.util.concurrent.ConcurrentHashMap;
-
-import org.osoa.sca.CallableReference;
-import org.osoa.sca.annotations.Callback;
-import org.osoa.sca.annotations.Destroy;
-import org.osoa.sca.annotations.Scope;
-import org.osoa.sca.annotations.Service;
-
-/**
- * Sample Event Processor Service Implementation
- */
-@Service(EventProcessorService.class)
-@Scope("CONVERSATION")
-public class EventProcessorServiceImpl implements EventProcessorService {
-
- /**
- * Reference to the call back
- */
- @Callback
- protected CallableReference clientCallback;
-
- /**
- * This map contains the call backs for each of the registered Event names
- */
- private final Map> eventListeners;
-
- /**
- * The list of all Event Generators we create
- */
- private final EventGenerator[] allEventGenerators;
-
- /**
- * Constructor. Starts the Event Generators
- */
- public EventProcessorServiceImpl() {
- eventListeners = new ConcurrentHashMap>();
-
- // We will simulate an Event generator
- allEventGenerators = new EventGenerator[2];
- allEventGenerators[0] = new EventGenerator("ONE", 1); // Generate the SECOND event every second
- allEventGenerators[1] = new EventGenerator("FIVE", 5); // Generate the FIVE event every 5 seconds
- }
-
- /**
- * Registers the client to receive notifications for the specified event
- *
- * @param aEventName The name of the Event to register
- */
- public void registerForEvent(String aEventName)
- {
- // Register for the Event
- eventListeners.put(aEventName, clientCallback);
-
- // Send the "register" started event to the client
- receiveEvent(aEventName, "SameThread: Registered to receive notifications for " + aEventName);
- }
-
- /**
- * Unregisters the client so it no longer receives notifications for the specified event
- *
- * @param aEventName The name of the Event to unregister
- */
- public void unregisterForEvent(String aEventName)
- {
- // Send the "register" started event to the client
- receiveEvent(aEventName, "SameThread: Unregister from receiving notifications for " + aEventName);
-
- eventListeners.remove(aEventName);
- }
-
- /**
- * This method is called whenever the EventProcessorService receives an Event
- *
- * @param aEventName The name of the Event received
- * @param aEventData The Event data
- */
- private void receiveEvent(String aEventName, Object aEventData)
- {
- // Get the listener for the Event
- final CallableReference callback = eventListeners.get(aEventName);
- if (callback == null)
- {
- //System.out.println("No registered listeners for " + aEventName);
- return;
- }
-
- // Trigger the call back
- // System.out.println("Notifying " + callback + " of event " + aEventName);
- callback.getService().eventNotification(aEventName, aEventData);
- // System.out.println("Done notify " + callback + " of event " + aEventName);
- }
-
- /**
- * Shuts down the Event Processor
- */
- @Destroy
- public void shutdown()
- {
- System.out.println("Shutting down the EventProcessor");
-
- // Clear list of call back locations as we don't want to send any more notifications
- eventListeners.clear();
-
- // Stop the Event Generators
- for (EventGenerator generator : allEventGenerators)
- {
- generator.stop();
- }
- }
-
- /**
- * Utility class for generating Events
- */
- private class EventGenerator
- {
- /**
- * The Timer we are using to generate the events
- */
- private final Timer timer = new Timer();
-
- /**
- * Constructor
- *
- * @param aEventName The name of the Event to generate
- * @param frequencyInSeconds How frequently we should generate the Events
- */
- private EventGenerator(String aEventName, int frequencyInSeconds)
- {
- timer.schedule(new EventGeneratorTimerTask(aEventName),
- frequencyInSeconds * 1000, frequencyInSeconds * 1000);
- }
-
- /**
- * Stop this Event Generator
- */
- private void stop()
- {
- timer.cancel();
- }
-
- /**
- * The TimerTask that is invoked by the Timer for the EventGenerator
- */
- private class EventGeneratorTimerTask extends TimerTask
- {
- /**
- * The name of the Event we should generate
- */
- private final String eventName;
-
- /**
- * Constructor
- *
- * @param aEventName The name of the Event we should generate
- */
- private EventGeneratorTimerTask(String aEventName)
- {
- eventName = aEventName;
- }
-
- /**
- * Timer calls this method and it will generate an Event
- */
- @Override
- public void run()
- {
- // System.out.println("Generating new event " + eventName);
- receiveEvent(eventName, "Separate Thread Notification: " + UUID.randomUUID().toString());
- }
- }
- }
-}
diff --git a/branches/sca-equinox/itest/callback-separatethread/src/main/resources/CallBackSeparateThreadTest.composite b/branches/sca-equinox/itest/callback-separatethread/src/main/resources/CallBackSeparateThreadTest.composite
deleted file mode 100644
index e111e5074c..0000000000
--- a/branches/sca-equinox/itest/callback-separatethread/src/main/resources/CallBackSeparateThreadTest.composite
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/branches/sca-equinox/itest/callback-separatethread/src/test/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadTestCase.java b/branches/sca-equinox/itest/callback-separatethread/src/test/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadTestCase.java
deleted file mode 100644
index f7e7be2133..0000000000
--- a/branches/sca-equinox/itest/callback-separatethread/src/test/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadTestCase.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * 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.sca.itest;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-/**
- * This test case will attempt to trigger a call back using a separate thread
- */
-public class CallBackSeparateThreadTestCase extends TestCase {
-
- /**
- * The SCADomain we are using
- */
- private SCADomain domain;
-
- /**
- * The client the tests should use
- */
- private CallBackSeparateThreadClient aCallBackClient;
-
- /**
- * Run the call back in separate thread tests
- */
- public void testCallBackSeparateThread() {
- aCallBackClient.runTests();
- }
-
- /**
- * Load the Call back in separate thread composite and look up the client.
- */
- @Override
- protected void setUp() throws Exception {
- domain = SCADomain.newInstance("CallBackSeparateThreadTest.composite");
- aCallBackClient = domain.getService(CallBackSeparateThreadClient.class, "CallBackSeparateThreadClient");
- }
-
- /**
- * Shutdown the SCA domain
- */
- @Override
- protected void tearDown() throws Exception {
- domain.close();
- }
-}
diff --git a/branches/sca-equinox/itest/callback-set-callback/pom.xml b/branches/sca-equinox/itest/callback-set-callback/pom.xml
deleted file mode 100644
index d7ea83853d..0000000000
--- a/branches/sca-equinox/itest/callback-set-callback/pom.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
- 4.0.0
-
- org.apache.tuscany.sca
- tuscany-itest
- 1.4-EQUINOX-SNAPSHOT
- ../pom.xml
-
- itest-callback-set-callback
- Apache Tuscany SCA Set Callback Integration Tests
-
-
-
- org.apache.tuscany.sca
- tuscany-host-embedded
- 1.4-EQUINOX-SNAPSHOT
-
-
-
- org.apache.tuscany.sca
- tuscany-implementation-java-runtime
- 1.4-EQUINOX-SNAPSHOT
- runtime
-
-
-
diff --git a/branches/sca-equinox/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCalbackService.java b/branches/sca-equinox/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCalbackService.java
deleted file mode 100644
index 3b9599f53f..0000000000
--- a/branches/sca-equinox/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCalbackService.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * 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.sca.test;
-
-import org.osoa.sca.annotations.Callback;
-
-// @Remotable
-@Callback(CallBackSetCallbackCallback.class)
-/**
- *
- */
-public interface CallBackSetCalbackService {
-
- public void knockKnock(String aString);
-
- public boolean setCallbackIllegally(String aString);
-
-}
diff --git a/branches/sca-equinox/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackBadCallback.java b/branches/sca-equinox/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackBadCallback.java
deleted file mode 100644
index 48752f2ea1..0000000000
--- a/branches/sca-equinox/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackBadCallback.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * 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.sca.test;
-
-import junit.framework.Assert;
-
-public class CallBackSetCallbackBadCallback {
-
- public CallBackSetCallbackBadCallback() {
- super();
- }
-
- public void callback(String aString) {
- //
- // This callback method should never be called.
- //
- System.out.println("CallBackSetCallbackBadCallback: callback called");
- Assert.fail("CallBackSetCallbackBadCallback: callback called");
- return;
- }
-
-}
diff --git a/branches/sca-equinox/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackCallback.java b/branches/sca-equinox/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackCallback.java
deleted file mode 100644
index ad0e0603a3..0000000000
--- a/branches/sca-equinox/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackCallback.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * 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.sca.test;
-
-// @Remotable
-/**
- *
- */
-public interface CallBackSetCallbackCallback {
-
- public void callBackMessage(String aString);
-
- public void callBackIncrement(String aString);
-
-}
diff --git a/branches/sca-equinox/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackCallbackImpl.java b/branches/sca-equinox/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackCallbackImpl.java
deleted file mode 100644
index 0a22b0e01f..0000000000
--- a/branches/sca-equinox/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackCallbackImpl.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * 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.sca.test;
-
-import java.io.File;
-
-import org.osoa.sca.annotations.Service;
-
-@Service(CallBackSetCallbackCallback.class)
-public class CallBackSetCallbackCallbackImpl implements CallBackSetCallbackCallback {
-
- private static String returnMessage = null;
- private static int callBackCount = 0;
-
- public String getReturnMessage() {
- return returnMessage;
- }
-
- public void setReturnMessage(String aReturnMessage) {
- returnMessage = aReturnMessage;
- }
-
- public int getCallBackCount() {
- return callBackCount;
- }
-
- public void incrementCallBackCount() {
- callBackCount++;
- }
-
- public void callBackMessage(String aString) {
-
- System.out.println("Entering CallBackSetCallbackCallbackImpl callBackMessage: " + aString);
-
- File aFile = new File("target/test4_marker");
- try {
- aFile.createNewFile();
- } catch (Exception ex) {
- System.out.println("Error Creating target/test4_marker marker file");
- ex.printStackTrace();
- }
-
- }
-
- public void callBackIncrement(String aString) {
- System.out.println("Entering callback increment: " + aString);
- this.incrementCallBackCount();
- }
-
-}
diff --git a/branches/sca-equinox/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackClient.java b/branches/sca-equinox/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackClient.java
deleted file mode 100644
index 94cb6aa73b..0000000000
--- a/branches/sca-equinox/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackClient.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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.sca.test;
-
-import org.osoa.sca.annotations.Remotable;
-
-@Remotable
-public interface CallBackSetCallbackClient {
-
- public void run();
-
-}
diff --git a/branches/sca-equinox/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackClientImpl.java b/branches/sca-equinox/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackClientImpl.java
deleted file mode 100644
index 66e4d3fc05..0000000000
--- a/branches/sca-equinox/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackClientImpl.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * 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.sca.test;
-
-import java.io.File;
-
-import junit.framework.Assert;
-
-import org.osoa.sca.NoRegisteredCallbackException;
-import org.osoa.sca.ServiceReference;
-import org.osoa.sca.annotations.Reference;
-import org.osoa.sca.annotations.Service;
-
-@Service(CallBackSetCallbackClient.class)
-public class CallBackSetCallbackClientImpl implements CallBackSetCallbackClient {
-
- @Reference
- protected ServiceReference aCallBackService;
- @Reference
- protected ServiceReference callBack;
-
- public void run() {
-
- // This test various aspects of the setCallback() API in a stateless
- // scope.
-
- /*
- * test4 Client does not implement the callback interface but calls
- * setCallback with a service reference before invoking the target,
- * Verify successful execution.
- */
-
- test4();
-
- /*
- * test5 The client does not implement the callback interface and does
- * not call setCallback() before invoking the target. Verify a
- * NoRegisteredCallbackException is thrown.
- */
-
- test5();
-
- /*
- * test6() The client calls setCallback() with an object that is not a
- * service reference and the callback interface is stateless. Verify
- * that an appropriate exception is thrown. When calling setCallback
- * with an object the interface must be stateful. Stateless interfaces
- * require a service Reference.
- */
-
- test6();
-
- /*
- * test10 The target calls setCallback() on its own service reference,
- * e.g. getRequestContext().getServiceReference().getCallback(). Verify
- * an appropriate exception occurs.
- */
-
- test10();
-
- return;
- }
-
- private void test4() {
-
- //
- // Since callbacks do not synchronously return and this test results in
- // a callback to a component other
- // than this client I am using a marker file to determine the outcome.
- // The presence of the marker
- // file will be used for the Assertion test. If it exists then the
- // callback occurred and all is good.
- //
-
- // Make sure the marker file is not present before starting the test.
- File aFile = new File("target/test4_marker");
- if (aFile.exists())
- aFile.delete();
-
- aCallBackService.setCallback(callBack);
-
- aCallBackService.getService().knockKnock("Knock Knock");
-
- // Lets give the callback a little time to complete....
-
- int count = 0;
- long timeout = 1000;
-
- while (count++ < 30 && (aFile.exists() == false)) {
- try {
- Thread.sleep(timeout);
- } catch (InterruptedException ie) {
- }
- }
-
- Assert.assertEquals("CallBackSetCallback - Test4", true, aFile.exists());
-
- aCallBackService.setCallback(null); // leave this in the default state for next test
-
- }
-
- private void test5() {
-
- boolean correctException = false;
-
- //
- // The backend service is expecting a callback reference to be set. This
- // test will not
- // set one so an exception is expected. According to the spec if a
- // client calls a method on
- // a service reference prior to calling setCallback() then a
- // NoRegisteredCallbackException
- // will be thrown on the client.
- //
-
- try {
- aCallBackService.getService().knockKnock("Knock Knock");
- } catch (NoRegisteredCallbackException NotRegEx) {
- correctException = true;
- } catch (Exception ex) {
- ex.printStackTrace();
- }
-
- Assert.assertEquals("CallBackSetCallback - Test5", true, correctException);
-
- }
-
- private void test6() {
-
- boolean correctException = false;
-
- //
- // This test is to specify an Object that is not a service reference
- // that does implement
- // the callback interface. However because this callback service is
- // stateless the expected
- // result is an appropriate exception.
- //
-
- try {
- aCallBackService.setCallback(new CallBackSetCallbackObjectCallback());
- aCallBackService.getService().knockKnock("Knock Knock");
- }
- //
- // This should catch an appropriate exception.
- //
- catch (IllegalArgumentException goodEx) {
- correctException = true;
- } catch (Exception ex) {
- ex.printStackTrace();
- }
-
- Assert.assertEquals("CallBackSetCallback - Test6", true, correctException);
-
- }
-
- private void test10() {
-
- //
- // The appropriate exception should be thrown and caught on the service side.
- // If this happens, the setCallbackIllegally() method will return true.
- // If not, this method will return false.
- //
-
- aCallBackService.setCallback(callBack); // ensure no client-side exception
-
- boolean result = aCallBackService.getService().setCallbackIllegally
- ("Try to set callback on your own service reference");
-
- Assert.assertEquals("CallBackSetCallback - Test10", true, result);
-
- }
-
-}
diff --git a/branches/sca-equinox/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackObjectCallback.java b/branches/sca-equinox/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackObjectCallback.java
deleted file mode 100644
index afedcdf7f1..0000000000
--- a/branches/sca-equinox/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackObjectCallback.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * 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.sca.test;
-
-public class CallBackSetCallbackObjectCallback implements CallBackSetCallbackCallback {
-
- private int callBackCount = 0;
-
- public CallBackSetCallbackObjectCallback() {
- super();
- }
-
- public void incrementCallBackCount() {
- callBackCount++;
- }
-
- public void callBackMessage(String aString) {
-
- System.out.println("Entering CallBackSetCallbackObjectCallback callBackMessage: " + aString);
-
- }
-
- public void callBackIncrement(String aString) {
- System.out.println("Entering callback increment: " + aString);
- this.incrementCallBackCount();
- }
-
-}
diff --git a/branches/sca-equinox/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackServiceImpl.java b/branches/sca-equinox/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackServiceImpl.java
deleted file mode 100644
index 4a6c9dbaa6..0000000000
--- a/branches/sca-equinox/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackServiceImpl.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * 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.sca.test;
-
-import org.osoa.sca.ComponentContext;
-import org.osoa.sca.RequestContext;
-import org.osoa.sca.ServiceReference;
-import org.osoa.sca.annotations.Callback;
-import org.osoa.sca.annotations.Context;
-import org.osoa.sca.annotations.Service;
-
-@Service(CallBackSetCalbackService.class)
-public class CallBackSetCallbackServiceImpl implements CallBackSetCalbackService {
-
- @Callback
- protected CallBackSetCallbackCallback callback;
- @Context
- protected ComponentContext context;
-
- public void knockKnock(String aString) {
-
- try {
- System.out.println("CallBackBasicServiceImpl message received: " + aString);
- callback.callBackMessage("Who's There");
- System.out.println("CallBackBasicServiceImpl response sent");
- return;
- } catch (Exception ex) {
- ex.printStackTrace();
- }
-
- }
-
- public boolean setCallbackIllegally(String aString) {
-
- System.out.println("CallBackBasicServiceImpl.setCallbackIllegally() message received: " + aString);
-
- boolean exceptionProduced = false;
- RequestContext requestContext = null;
- ServiceReference serviceRef = null;
-
- try {
- requestContext = context.getRequestContext();
- serviceRef = (ServiceReference) requestContext.getServiceReference();
- serviceRef.setCallback(serviceRef);
- } catch (ClassCastException goodEx) {
- exceptionProduced = true;
- System.out.println("Test10 appropriate exception caught during setCallback to own service reference");
- } catch (Exception badEx) {
- System.out.println("CallBackBasicServiceImpl.setCallbackIllegally() " + badEx.toString());
- badEx.printStackTrace();
- }
-
- // Return a flag indicating whether we got the exception we are looking for
- return exceptionProduced;
-
- }
-}
diff --git a/branches/sca-equinox/itest/callback-set-callback/src/main/resources/CallBackSetCallbackTest.composite b/branches/sca-equinox/itest/callback-set-callback/src/main/resources/CallBackSetCallbackTest.composite
deleted file mode 100644
index 3552ddecab..0000000000
--- a/branches/sca-equinox/itest/callback-set-callback/src/main/resources/CallBackSetCallbackTest.composite
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/branches/sca-equinox/itest/callback-set-callback/src/test/java/org/apache/tuscany/sca/test/CallBackSetCallbackTestCase.java b/branches/sca-equinox/itest/callback-set-callback/src/test/java/org/apache/tuscany/sca/test/CallBackSetCallbackTestCase.java
deleted file mode 100644
index 496ae0b1a5..0000000000
--- a/branches/sca-equinox/itest/callback-set-callback/src/test/java/org/apache/tuscany/sca/test/CallBackSetCallbackTestCase.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * 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.sca.test;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-//FIXME Fix this test case
-public class CallBackSetCallbackTestCase extends TestCase {
-
- private SCADomain domain;
- private CallBackSetCallbackClient aCallBackClient;
-
- public void testCallBackSetCallback() {
- aCallBackClient.run();
- }
-
- @Override
- protected void setUp() throws Exception {
- domain = SCADomain.newInstance("CallBackSetCallbackTest.composite");
-
- aCallBackClient =
- domain.getService(CallBackSetCallbackClient.class,
- "CallBackSetCallbackClient");
- }
-
- @Override
- protected void tearDown() throws Exception {
- domain.close();
- }
-
-}
diff --git a/branches/sca-equinox/itest/callback-set-conversation/pom.xml b/branches/sca-equinox/itest/callback-set-conversation/pom.xml
deleted file mode 100644
index 8e3e052809..0000000000
--- a/branches/sca-equinox/itest/callback-set-conversation/pom.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
- 4.0.0
-
- org.apache.tuscany.sca
- tuscany-itest
- 1.4-EQUINOX-SNAPSHOT
- ../pom.xml
-
- itest-callback-set-conversation
- Apache Tuscany SCA Callback Set Conversation Integration Tests
-
-
-
- org.apache.tuscany.sca
- tuscany-host-embedded
- 1.4-EQUINOX-SNAPSHOT
-
-
-
- org.apache.tuscany.sca
- tuscany-implementation-java-runtime
- 1.4-EQUINOX-SNAPSHOT
- runtime
-
-
-
diff --git a/branches/sca-equinox/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvBadCallback.java b/branches/sca-equinox/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvBadCallback.java
deleted file mode 100644
index d97c69eaed..0000000000
--- a/branches/sca-equinox/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvBadCallback.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * 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.sca.test;
-
-import java.io.Serializable;
-
-import junit.framework.Assert;
-
-public class CallBackSetCallbackConvBadCallback implements Serializable {
-
- public CallBackSetCallbackConvBadCallback() {
- super();
- }
-
- public void callback(String aString) {
- //
- // This callback method should never be called.
- //
- System.out.println("CallBackSetCallbackBadCallback: callback called");
- Assert.fail("CallBackSetCallbackConvBadCallback: callback called");
- }
-
-}
diff --git a/branches/sca-equinox/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvCallback.java b/branches/sca-equinox/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvCallback.java
deleted file mode 100644
index a704fd0ece..0000000000
--- a/branches/sca-equinox/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvCallback.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * 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.sca.test;
-
-import org.osoa.sca.annotations.Conversational;
-
-// @Remotable
-@Conversational
-/**
- *
- */
-public interface CallBackSetCallbackConvCallback {
-
- public void callBackMessage(String aString);
-
- public void callBackIncrement(String aString);
-
-}
diff --git a/branches/sca-equinox/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvClient.java b/branches/sca-equinox/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvClient.java
deleted file mode 100644
index 013424bf5e..0000000000
--- a/branches/sca-equinox/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvClient.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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.sca.test;
-
-import org.osoa.sca.annotations.Remotable;
-
-@Remotable
-public interface CallBackSetCallbackConvClient {
-
- public void run();
-
-}
diff --git a/branches/sca-equinox/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvClientImpl.java b/branches/sca-equinox/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvClientImpl.java
deleted file mode 100644
index 5d692e7728..0000000000
--- a/branches/sca-equinox/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvClientImpl.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * 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.sca.test;
-
-import junit.framework.Assert;
-
-import org.osoa.sca.ComponentContext;
-import org.osoa.sca.ServiceReference;
-import org.osoa.sca.annotations.Context;
-import org.osoa.sca.annotations.Reference;
-import org.osoa.sca.annotations.Scope;
-import org.osoa.sca.annotations.Service;
-
-@Service(CallBackSetCallbackConvClient.class)
-@Scope("CONVERSATION")
-public class CallBackSetCallbackConvClientImpl implements CallBackSetCallbackConvClient {
-
- @Context
- protected ComponentContext componentContext;
-
- @Reference
- protected CallBackSetCallbackConvService aCallBackService;
-
- private CallBackSetCallbackConvObjectCallback aCallbackObject = null;
-
- public void run() {
-
- // This tests aspects of the setCallback() API within a conversational
- // scope.
-
- /*
- * test7 The client calls setCallback() with an object that is not a
- * service reference and the callback interface is stateful. Verify
- * successful execution.
- */
- test7();
-
- /*
- * test8() The client calls setCallback() with an object that does not
- * implement the callback interface. Verify an appropriate exception is
- * thrown. This requires a STATEFUL interface.
- */
- test8();
-
- /*
- * test9 The client calls setCallback() with an object that is not
- * Serializable. Verify an appropriate exception is thrown. This
- * requires a STATEFUL callback interface. Move from the stateless test
- * case.
- */
- test9();
-
- return;
- }
-
- private void test7() {
-
- //
- // This test is to specify an Object that is not a service reference
- // that does implement
- // the callback interface and is Serializable. Verify successful
- // execution.
- //
-
- aCallbackObject = new CallBackSetCallbackConvObjectCallback();
- aCallbackObject.incrementCallBackCount();
-
- ServiceReference aCallBackServiceRef
- = componentContext.cast(aCallBackService);
- aCallBackServiceRef.setCallback(aCallbackObject);
- aCallBackService.knockKnock("Knock Knock 7");
-
- Assert.assertEquals("CallBackSetCallbackConv - Test7", 2, aCallbackObject.getCount());
-
- }
-
- private void test8() {
-
- boolean correctException = false;
-
- //
- // This test is to specify an Object that is not a service reference
- // that does not implement
- // the callback interface. The expected result is an appropriate
- // exception.
- //
-
- try {
- ServiceReference aCallBackServiceRef
- = componentContext.cast(aCallBackService);
- aCallBackServiceRef.setCallback(new CallBackSetCallbackConvBadCallback());
- aCallBackService.knockKnock("Knock Knock 8");
- }
-
- //
- // This should catch an appropriate exception.
- //
-
- catch (IllegalArgumentException goodEx)
- {
- System.out.println("correct exception " + goodEx);
- correctException = true;
- }
-
- catch (Exception ex) {
- // This means an inappropriate exception occurred
- ex.printStackTrace();
- }
-
- Assert.assertEquals("CallBackSetCallbackConv - Test8", true, correctException);
-
- }
-
- private void test9() {
-
- boolean correctException = false;
-
- //
- // This test is to specify an Object that is not a service reference
- // that does implement
- // the callback interface but does not implement Serializable. Verify
- // an appropriate exception
- // is thrown.
- //
-
- try {
- ServiceReference aCallBackServiceRef
- = componentContext.cast(aCallBackService);
- aCallBackServiceRef.setCallback(new CallBackSetCallbackConvNonSerCallback());
- aCallBackService.knockKnock("Knock Knock 9");
- }
- //
- // This should catch an appropriate exception.
- //
- catch (IllegalArgumentException goodEx)
- {
- System.out.println("correct exception " + goodEx);
- correctException = true;
- } catch (Exception ex) {
- ex.printStackTrace();
- }
-
- Assert.assertEquals("CallBackSetCallbackConv - Test9", true, correctException);
-
- }
-
-}
diff --git a/branches/sca-equinox/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvNonSerCallback.java b/branches/sca-equinox/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvNonSerCallback.java
deleted file mode 100644
index 75a4a3a6a0..0000000000
--- a/branches/sca-equinox/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvNonSerCallback.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * 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.sca.test;
-
-import junit.framework.Assert;
-
-public class CallBackSetCallbackConvNonSerCallback implements CallBackSetCallbackConvCallback {
-
- private int callBackCount = 0;
-
- public CallBackSetCallbackConvNonSerCallback() {
- super();
- }
-
- public synchronized void incrementCallBackCount() {
- callBackCount++;
- }
-
- public synchronized int getCount() {
- return callBackCount;
- }
-
- public void callBackMessage(String aString) {
- //
- // This callback method should never be called.
- //
- System.out.println("Entering CallBackSetCallbackConvNonSerCallback callBackMessage: " + aString);
- Assert.fail("CallBackSetCallbackConvNonSerCallback: callbackMessage called");
- }
-
- public void callBackIncrement(String aString) {
- //
- // This callback method should never be called.
- //
- System.out.println("Entering callbackIncrement: " + aString);
- this.incrementCallBackCount();
- Assert.fail("CallBackSetCallbackConvNonSerCallback: callbackIncrement called");
- }
-
-}
diff --git a/branches/sca-equinox/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvObjectCallback.java b/branches/sca-equinox/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvObjectCallback.java
deleted file mode 100644
index e7a3b144f6..0000000000
--- a/branches/sca-equinox/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvObjectCallback.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * 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.sca.test;
-
-import java.io.Serializable;
-
-public class CallBackSetCallbackConvObjectCallback implements CallBackSetCallbackConvCallback, Serializable
-{
- private int callBackCount = 0;
-
- public CallBackSetCallbackConvObjectCallback() {
- super();
- }
-
- public synchronized void incrementCallBackCount() {
- callBackCount++;
- }
-
- public synchronized int getCount() {
- return callBackCount;
- }
-
- public void callBackMessage(String aString) {
-
- System.out.println("Entering CallBackSetCallbackObjectCallback callBackMessage: " + aString);
-
- }
-
- public void callBackIncrement(String aString) {
-
- System.out.println("Entering callback increment: " + aString);
-
- this.incrementCallBackCount();
- }
-
-}
diff --git a/branches/sca-equinox/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvService.java b/branches/sca-equinox/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvService.java
deleted file mode 100644
index 692b6dfc35..0000000000
--- a/branches/sca-equinox/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvService.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * 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.sca.test;
-
-import org.osoa.sca.annotations.Callback;
-import org.osoa.sca.annotations.Conversational;
-
-// @Remotable
-@Conversational
-@Callback(CallBackSetCallbackConvCallback.class)
-/**
- *
- */
-public interface CallBackSetCallbackConvService {
-
- public void knockKnock(String aString);
-
- public void setCallbackIllegally(String aString);
-
-}
diff --git a/branches/sca-equinox/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvServiceImpl.java b/branches/sca-equinox/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvServiceImpl.java
deleted file mode 100644
index bca94ce407..0000000000
--- a/branches/sca-equinox/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvServiceImpl.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * 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.sca.test;
-
-import java.io.File;
-
-import org.osoa.sca.ComponentContext;
-import org.osoa.sca.RequestContext;
-import org.osoa.sca.ServiceReference;
-import org.osoa.sca.annotations.Callback;
-import org.osoa.sca.annotations.Context;
-import org.osoa.sca.annotations.Scope;
-import org.osoa.sca.annotations.Service;
-
-@Service(CallBackSetCallbackConvService.class)
-@Scope("CONVERSATION")
-public class CallBackSetCallbackConvServiceImpl implements CallBackSetCallbackConvService {
-
- @Callback
- protected CallBackSetCallbackConvCallback callback;
- @Context
- protected ComponentContext context;
-
- public void knockKnock(String aString) {
-
- System.out.println("CallBackSetCallbackConvServiceImpl message received: " + aString);
- callback.callBackMessage("Who's There");
- callback.callBackIncrement("This should do it");
- System.out.println("CallBackSetCallbackConvServiceImpl response sent");
-
- }
-
- public void setCallbackIllegally(String aString) {
-
- System.out.println("CallBackBasicServiceImpl.setCallbackIllegally() message received: " + aString);
-
- boolean exceptionProduced = false;
- RequestContext requestContext = null;
- ServiceReference serviceRef = null;
-
- // Context is not working properly so we can't trust that this is
- // working.....
- try {
- requestContext = context.getRequestContext();
- serviceRef = (ServiceReference) requestContext.getServiceReference();
- } catch (Exception ex) {
- System.out.println("CallBackBasicServiceImpl.setCallbackIllegally() " + ex.toString());
- ex.printStackTrace();
- return;
- }
-
- // Ok, call setCallback with my own service reference.
- try {
- serviceRef.setCallback(serviceRef);
- } catch (NullPointerException npe) {
- // This is not an appropriate exception.
- System.out.println("Test10 NPE exception during setCallback to own service reference");
- npe.printStackTrace();
- return;
- }
- // This needs to catch the appropriate exception, once we figure out
- // what is needs to be!
- catch (Exception ex) {
- exceptionProduced = true;
- System.out.println("Test10 appropriate exception caught during setCallback to own service reference");
- }
- ;
-
- // If we get the exception we are looking for then create the marker
- // file.
- if (exceptionProduced == true) {
- File aFile = new File("target/test10_marker");
- try {
- aFile.createNewFile();
- } catch (Exception ex) {
- System.out.println("Error Creating target/test10_marker marker file");
- ex.printStackTrace();
- }
- }
-
- }
-}
diff --git a/branches/sca-equinox/itest/callback-set-conversation/src/main/resources/CallBackSetCallbackConvTest.composite b/branches/sca-equinox/itest/callback-set-conversation/src/main/resources/CallBackSetCallbackConvTest.composite
deleted file mode 100644
index ce73417f94..0000000000
--- a/branches/sca-equinox/itest/callback-set-conversation/src/main/resources/CallBackSetCallbackConvTest.composite
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/branches/sca-equinox/itest/callback-set-conversation/src/test/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvTestCase.java b/branches/sca-equinox/itest/callback-set-conversation/src/test/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvTestCase.java
deleted file mode 100644
index 45bdaea9ab..0000000000
--- a/branches/sca-equinox/itest/callback-set-conversation/src/test/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvTestCase.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * 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.sca.test;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-public class CallBackSetCallbackConvTestCase extends TestCase {
-
- private SCADomain domain;
- private CallBackSetCallbackConvClient aCallBackClient;
-
- public void testCallBackSetCallback() {
- aCallBackClient.run();
- }
-
- @Override
- protected void setUp() throws Exception {
- domain = SCADomain.newInstance("CallBackSetCallbackConvTest.composite");
-
- aCallBackClient =
- domain.getService(CallBackSetCallbackConvClient.class,
- "CallBackSetCallbackConvClient");
- }
-
- @Override
- protected void tearDown() throws Exception {
- domain.close();
- }
-
-}
diff --git a/branches/sca-equinox/itest/component-type/pom.xml b/branches/sca-equinox/itest/component-type/pom.xml
deleted file mode 100644
index b8baf9b95a..0000000000
--- a/branches/sca-equinox/itest/component-type/pom.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-
- 4.0.0
-
- org.apache.tuscany.sca
- tuscany-itest
- 1.4-EQUINOX-SNAPSHOT
- ../pom.xml
-
- itest-component-type
- Apache Tuscany SCA Component Type Integration Tests
-
-
-
- org.apache.tuscany.sca
- tuscany-host-embedded
- 1.4-EQUINOX-SNAPSHOT
-
-
-
- org.apache.tuscany.sca
- tuscany-implementation-java-runtime
- 1.4-EQUINOX-SNAPSHOT
- runtime
-
-
-
-
-
diff --git a/branches/sca-equinox/itest/component-type/src/main/java/calculator/AddService.java b/branches/sca-equinox/itest/component-type/src/main/java/calculator/AddService.java
deleted file mode 100644
index 188451ebac..0000000000
--- a/branches/sca-equinox/itest/component-type/src/main/java/calculator/AddService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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 calculator;
-
-/**
- * The Add service interface
- */
-public interface AddService {
-
- double add(double n1, double n2);
-
-}
diff --git a/branches/sca-equinox/itest/component-type/src/main/java/calculator/AddServiceImpl.java b/branches/sca-equinox/itest/component-type/src/main/java/calculator/AddServiceImpl.java
deleted file mode 100644
index 8b6fe066a6..0000000000
--- a/branches/sca-equinox/itest/component-type/src/main/java/calculator/AddServiceImpl.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * 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 calculator;
-
-/**
- * An implementation of the Add service
- */
-public class AddServiceImpl implements AddService {
-
- public double add(double n1, double n2) {
- return n1 + n2;
- }
-
-}
diff --git a/branches/sca-equinox/itest/component-type/src/main/java/calculator/CalculatorClient.java b/branches/sca-equinox/itest/component-type/src/main/java/calculator/CalculatorClient.java
deleted file mode 100644
index 08afd922b3..0000000000
--- a/branches/sca-equinox/itest/component-type/src/main/java/calculator/CalculatorClient.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * 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 calculator;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-/**
- * This client program shows how to create an SCA runtime, start it,
- * and locate and invoke a SCA component
- */
-public class CalculatorClient {
- public static void main(String[] args) throws Exception {
-
- SCADomain scaDomain = SCADomain.newInstance("Calculator.composite");
-
- CalculatorService calculatorService =
- scaDomain.getService(CalculatorService.class, "CalculatorServiceComponent/CalculatorService");
-
- // Calculate
- System.out.println("3 + 2=" + calculatorService.add(3, 2));
- System.out.println("3 - 2=" + calculatorService.subtract(3, 2));
- System.out.println("3 * 2=" + calculatorService.multiply(3, 2));
- System.out.println("3 / 2=" + calculatorService.divide(3, 2));
-
- scaDomain.close();
- }
-
-}
diff --git a/branches/sca-equinox/itest/component-type/src/main/java/calculator/CalculatorService.java b/branches/sca-equinox/itest/component-type/src/main/java/calculator/CalculatorService.java
deleted file mode 100644
index 031fa8b912..0000000000
--- a/branches/sca-equinox/itest/component-type/src/main/java/calculator/CalculatorService.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * 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 calculator;
-
-
-/**
- * The Calculator service interface.
- */
-public interface CalculatorService {
-
- double add(double n1, double n2);
-
- double subtract(double n1, double n2);
-
- double multiply(double n1, double n2);
-
- double divide(double n1, double n2);
-
-}
diff --git a/branches/sca-equinox/itest/component-type/src/main/java/calculator/CalculatorServiceImpl.java b/branches/sca-equinox/itest/component-type/src/main/java/calculator/CalculatorServiceImpl.java
deleted file mode 100644
index 1209ac128a..0000000000
--- a/branches/sca-equinox/itest/component-type/src/main/java/calculator/CalculatorServiceImpl.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * 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 calculator;
-
-/**
- * An implementation of the Calculator service.
- */
-public class CalculatorServiceImpl implements CalculatorService {
-
- private AddService addService;
- private SubtractService subtractService;
- private MultiplyService multiplyService;
- private DivideService divideService;
-
- public void setAddService(AddService addService) {
- this.addService = addService;
- }
-
- public void setSubtractService(SubtractService subtractService) {
- this.subtractService = subtractService;
- }
-
- public void setDivideService(DivideService divideService) {
- this.divideService = divideService;
- }
-
- public void setMultiplyService(MultiplyService multiplyService) {
- this.multiplyService = multiplyService;
- }
-
- public double add(double n1, double n2) {
- return addService.add(n1, n2);
- }
-
- public double subtract(double n1, double n2) {
- return subtractService.subtract(n1, n2);
- }
-
- public double multiply(double n1, double n2) {
- return multiplyService.multiply(n1, n2);
- }
-
- public double divide(double n1, double n2) {
- return divideService.divide(n1, n2);
- }
-
-}
diff --git a/branches/sca-equinox/itest/component-type/src/main/java/calculator/DivideService.java b/branches/sca-equinox/itest/component-type/src/main/java/calculator/DivideService.java
deleted file mode 100644
index 30d248208b..0000000000
--- a/branches/sca-equinox/itest/component-type/src/main/java/calculator/DivideService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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 calculator;
-
-/**
- * The divide service interface
- */
-public interface DivideService {
-
- double divide(double n1, double n2);
-
-}
diff --git a/branches/sca-equinox/itest/component-type/src/main/java/calculator/DivideServiceImpl.java b/branches/sca-equinox/itest/component-type/src/main/java/calculator/DivideServiceImpl.java
deleted file mode 100644
index f7ac0b7287..0000000000
--- a/branches/sca-equinox/itest/component-type/src/main/java/calculator/DivideServiceImpl.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * 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 calculator;
-
-/**
- * An implementation of the Divide service.
- */
-public class DivideServiceImpl implements DivideService {
-
- public double divide(double n1, double n2) {
- return n1 / n2;
- }
-
-}
diff --git a/branches/sca-equinox/itest/component-type/src/main/java/calculator/MultiplyService.java b/branches/sca-equinox/itest/component-type/src/main/java/calculator/MultiplyService.java
deleted file mode 100644
index 5290605938..0000000000
--- a/branches/sca-equinox/itest/component-type/src/main/java/calculator/MultiplyService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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 calculator;
-
-/**
- * The interface for the multiply service
- */
-public interface MultiplyService {
-
- double multiply(double n1, double n2);
-
-}
diff --git a/branches/sca-equinox/itest/component-type/src/main/java/calculator/MultiplyServiceImpl.java b/branches/sca-equinox/itest/component-type/src/main/java/calculator/MultiplyServiceImpl.java
deleted file mode 100644
index b7dca792b2..0000000000
--- a/branches/sca-equinox/itest/component-type/src/main/java/calculator/MultiplyServiceImpl.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * 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 calculator;
-
-/**
- * An implementation of the Multiply service.
- */
-public class MultiplyServiceImpl implements MultiplyService {
-
- public double multiply(double n1, double n2) {
- return n1 * n2;
- }
-
-}
diff --git a/branches/sca-equinox/itest/component-type/src/main/java/calculator/SubtractService.java b/branches/sca-equinox/itest/component-type/src/main/java/calculator/SubtractService.java
deleted file mode 100644
index bf0d1882b6..0000000000
--- a/branches/sca-equinox/itest/component-type/src/main/java/calculator/SubtractService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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 calculator;
-
-/**
- * The interface for the multiply service
- */
-public interface SubtractService {
-
- double subtract(double n1, double n2);
-
-}
diff --git a/branches/sca-equinox/itest/component-type/src/main/java/calculator/SubtractServiceImpl.java b/branches/sca-equinox/itest/component-type/src/main/java/calculator/SubtractServiceImpl.java
deleted file mode 100644
index 77b128ab8d..0000000000
--- a/branches/sca-equinox/itest/component-type/src/main/java/calculator/SubtractServiceImpl.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * 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 calculator;
-
-/**
- * An implementation of the subtract service.
- */
-public class SubtractServiceImpl implements SubtractService {
-
- public double subtract(double n1, double n2) {
- return n1 - n2;
- }
-
-}
diff --git a/branches/sca-equinox/itest/component-type/src/main/resources/Calculator.composite b/branches/sca-equinox/itest/component-type/src/main/resources/Calculator.composite
deleted file mode 100644
index b229787657..0000000000
--- a/branches/sca-equinox/itest/component-type/src/main/resources/Calculator.composite
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/branches/sca-equinox/itest/component-type/src/main/resources/calculator/AddServiceImpl.componentType b/branches/sca-equinox/itest/component-type/src/main/resources/calculator/AddServiceImpl.componentType
deleted file mode 100644
index 00c48e5a35..0000000000
--- a/branches/sca-equinox/itest/component-type/src/main/resources/calculator/AddServiceImpl.componentType
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/branches/sca-equinox/itest/component-type/src/main/resources/calculator/CalculatorServiceImpl.componentType b/branches/sca-equinox/itest/component-type/src/main/resources/calculator/CalculatorServiceImpl.componentType
deleted file mode 100644
index 74bedc0a98..0000000000
--- a/branches/sca-equinox/itest/component-type/src/main/resources/calculator/CalculatorServiceImpl.componentType
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/branches/sca-equinox/itest/component-type/src/main/resources/calculator/DivideServiceImpl.componentType b/branches/sca-equinox/itest/component-type/src/main/resources/calculator/DivideServiceImpl.componentType
deleted file mode 100644
index 289fcc3e11..0000000000
--- a/branches/sca-equinox/itest/component-type/src/main/resources/calculator/DivideServiceImpl.componentType
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/branches/sca-equinox/itest/component-type/src/main/resources/calculator/MultiplyServiceImpl.componentType b/branches/sca-equinox/itest/component-type/src/main/resources/calculator/MultiplyServiceImpl.componentType
deleted file mode 100644
index 2d8a879cda..0000000000
--- a/branches/sca-equinox/itest/component-type/src/main/resources/calculator/MultiplyServiceImpl.componentType
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/branches/sca-equinox/itest/component-type/src/main/resources/calculator/SubtractServiceImpl.componentType b/branches/sca-equinox/itest/component-type/src/main/resources/calculator/SubtractServiceImpl.componentType
deleted file mode 100644
index 6214955141..0000000000
--- a/branches/sca-equinox/itest/component-type/src/main/resources/calculator/SubtractServiceImpl.componentType
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/branches/sca-equinox/itest/component-type/src/test/java/calculator/CalculatorTestCase.java b/branches/sca-equinox/itest/component-type/src/test/java/calculator/CalculatorTestCase.java
deleted file mode 100644
index 08fc8e33bf..0000000000
--- a/branches/sca-equinox/itest/component-type/src/test/java/calculator/CalculatorTestCase.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * 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 calculator;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-/**
- * This shows how to test the Calculator service component.
- */
-public class CalculatorTestCase extends TestCase {
-
- private CalculatorService calculatorService;
- private SCADomain scaDomain;
-
- @Override
- protected void setUp() throws Exception {
- scaDomain = SCADomain.newInstance("Calculator.composite");
- calculatorService = scaDomain.getService(CalculatorService.class, "CalculatorServiceComponent/CalculatorService");
- }
-
- @Override
- protected void tearDown() throws Exception {
- scaDomain.close();
- }
-
- public void testCalculator() throws Exception {
- // Calculate
- assertEquals(calculatorService.add(3, 2), 5.0);
- assertEquals(calculatorService.subtract(3, 2), 1.0);
- assertEquals(calculatorService.multiply(3, 2), 6.0);
- assertEquals(calculatorService.divide(3, 2), 1.5);
-
- }
-}
diff --git a/branches/sca-equinox/itest/contribution-classloader/contribution-classes/build-jar.xml b/branches/sca-equinox/itest/contribution-classloader/contribution-classes/build-jar.xml
deleted file mode 100644
index 299ce6864f..0000000000
--- a/branches/sca-equinox/itest/contribution-classloader/contribution-classes/build-jar.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/branches/sca-equinox/itest/contribution-classloader/contribution-classes/pom.xml b/branches/sca-equinox/itest/contribution-classloader/contribution-classes/pom.xml
deleted file mode 100644
index 63bce7556c..0000000000
--- a/branches/sca-equinox/itest/contribution-classloader/contribution-classes/pom.xml
+++ /dev/null
@@ -1,203 +0,0 @@
-
-
-
- 4.0.0
-
- org.apache.tuscany.sca
- tuscany-itest
- 1.4-EQUINOX-SNAPSHOT
- ../pom.xml
-
- itest-contribution-classloader-classes
- Apache Tuscany Contribution ClassLoader Test : Contribution Classes
-
-
-
- org.apache.tuscany.sca
- tuscany-host-embedded
- 1.4-EQUINOX-SNAPSHOT
-
-
-
- org.apache.tuscany.sca
- tuscany-implementation-java-runtime
- 1.4-EQUINOX-SNAPSHOT
- runtime
-
-
-
- junit
- junit
- 4.5
- test
-
-
-
-
-
- itest-contribution-classloader-classes
-
-
- org.apache.maven.plugins
- maven-antrun-plugin
- 1.1
-
-
-
- ant
- ant-trax
- 1.6.5
-
-
-
-
-
- create-jar
- generate-test-sources
-
- run
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/customer/Customer.java b/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/customer/Customer.java
deleted file mode 100644
index 814c38777a..0000000000
--- a/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/customer/Customer.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * 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 supplychain.customer;
-
-import org.osoa.sca.annotations.OneWay;
-
-/**
- * This is the business interface of the Customer service component.
- */
-public interface Customer {
-
- public void purchaseGoods();
-
- @OneWay
- public void notifyShipment(String order);
-
- public int outstandingOrderCount();
-
-}
diff --git a/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/customer/JavaCustomerComponentImpl.java b/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/customer/JavaCustomerComponentImpl.java
deleted file mode 100644
index e4daf0ec02..0000000000
--- a/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/customer/JavaCustomerComponentImpl.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * 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 supplychain.customer;
-
-import org.osoa.sca.annotations.Reference;
-import org.osoa.sca.annotations.Scope;
-import org.osoa.sca.annotations.Service;
-
-import supplychain.retailer.Retailer;
-
-/**
- * This class implements the Customer service component (POJO implementation).
- */
-@Service(Customer.class)
-@Scope("COMPOSITE")
-public class JavaCustomerComponentImpl implements Customer {
-
- private static int outstandingOrderCount;
-
- private Retailer retailer;
-
- public JavaCustomerComponentImpl() {
- System.out.println("Created " + this.getClass().getName() +
- " using: " + this.getClass().getClassLoader());
- }
-
- @Reference
- public void setRetailer(Retailer retailer) {
- this.retailer = retailer;
- }
-
- public void purchaseGoods() {
- outstandingOrderCount++;
- retailer.submitOrder("Order");
- }
-
- public void notifyShipment(String order) {
- outstandingOrderCount--;
- System.out.print("Work thread " + Thread.currentThread() + " - ");
- System.out.println(order);
- }
-
- public int outstandingOrderCount() {
- return outstandingOrderCount;
- }
-
-}
diff --git a/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/illegal/JavaCustomerComponentImpl.java b/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/illegal/JavaCustomerComponentImpl.java
deleted file mode 100644
index e4b3bc7048..0000000000
--- a/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/illegal/JavaCustomerComponentImpl.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * 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 supplychain.illegal;
-
-import org.osoa.sca.annotations.Reference;
-import org.osoa.sca.annotations.Scope;
-import org.osoa.sca.annotations.Service;
-
-import supplychain.customer.Customer;
-import supplychain.retailer.JavaRetailerComponentImpl;
-import supplychain.retailer.Retailer;
-import supplychain.warehouse.JavaWarehouseComponentImpl;
-import supplychain.warehouse.Warehouse;
-
-/**
- * This class implements the Customer service component (POJO implementation).
- */
-@Service(Customer.class)
-@Scope("COMPOSITE")
-public class JavaCustomerComponentImpl implements Customer {
-
- private static int outstandingOrderCount;
-
- private Retailer retailer;
-
- public JavaCustomerComponentImpl() {
- System.out.println("Created " + this.getClass().getName() +
- " using: " + this.getClass().getClassLoader());
- }
-
- @Reference
- public void setRetailer(Retailer retailer) {
- this.retailer = retailer;
- }
-
- public void purchaseGoods() {
-
- Retailer retailerImpl = new JavaRetailerComponentImpl();
- System.out.println("Created a retailer from Customer " + retailerImpl);
-
- Warehouse warehouseImpl = new JavaWarehouseComponentImpl();
- System.out.println("Created a warehouse from Customer " + warehouseImpl);
-
- outstandingOrderCount++;
- retailer.submitOrder("Order");
- }
-
- public void notifyShipment(String order) {
- outstandingOrderCount--;
- System.out.print("Work thread " + Thread.currentThread() + " - ");
- System.out.println(order);
- }
-
- public int outstandingOrderCount() {
- return outstandingOrderCount;
- }
-
-}
diff --git a/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/retailer/JavaRetailerComponentImpl.java b/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/retailer/JavaRetailerComponentImpl.java
deleted file mode 100644
index 698aa2aa5d..0000000000
--- a/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/retailer/JavaRetailerComponentImpl.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * 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 supplychain.retailer;
-
-
-import org.osoa.sca.annotations.Reference;
-import org.osoa.sca.annotations.Scope;
-import org.osoa.sca.annotations.Service;
-
-import supplychain.warehouse.Warehouse;
-
-/**
- * This class implements the Retailer service component (POJO implementation).
- */
-@Service(Retailer.class)
-@Scope("STATELESS")
-public class JavaRetailerComponentImpl implements Retailer {
-
- private Warehouse warehouse;
-
- public JavaRetailerComponentImpl() {
- System.out.println("Created " + this.getClass().getName() +
- " using: " + this.getClass().getClassLoader());
- }
-
- @Reference
- public void setWarehouse(Warehouse warehouse) {
- this.warehouse = warehouse;
- }
-
-
- public Warehouse getWarehouse() {
- return warehouse;
- }
-
- public void submitOrder(String order) {
-
- warehouse.fulfillOrder(order + ", submitted");
-
- }
-
-
-
-
-}
diff --git a/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/retailer/Retailer.java b/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/retailer/Retailer.java
deleted file mode 100644
index 1e87d59af1..0000000000
--- a/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/retailer/Retailer.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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 supplychain.retailer;
-
-/**
- * This is the business interface of the Retailer service component.
- */
-public interface Retailer {
-
- public void submitOrder(String order);
-
-}
diff --git a/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/shipper/JavaShipperComponentImpl.java b/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/shipper/JavaShipperComponentImpl.java
deleted file mode 100644
index 9e01f00a79..0000000000
--- a/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/shipper/JavaShipperComponentImpl.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * 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 supplychain.shipper;
-
-
-import org.osoa.sca.annotations.Reference;
-import org.osoa.sca.annotations.Scope;
-import org.osoa.sca.annotations.Service;
-
-import supplychain.customer.Customer;
-
-/**
- * This class implements the Shipper service component (POJO implementation).
- */
-@Service(Shipper.class)
-@Scope("COMPOSITE")
-public class JavaShipperComponentImpl implements Shipper {
-
- private Customer customer;
-
- public JavaShipperComponentImpl() {
- System.out.println("Created " + this.getClass().getCanonicalName() +
- " using: " + this.getClass().getClassLoader());
- }
-
- @Reference
- public void setCustomer(Customer customer) {
- this.customer = customer;
- }
-
- public void processShipment(String order) {
- customer.notifyShipment(order + ", shipped");
- }
-
-
-}
diff --git a/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/shipper/Shipper.java b/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/shipper/Shipper.java
deleted file mode 100644
index 2514928c10..0000000000
--- a/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/shipper/Shipper.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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 supplychain.shipper;
-
-/**
- * This is the business interface of the Shipper service component.
- */
-public interface Shipper {
-
- public void processShipment(String order);
-
-}
diff --git a/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/warehouse/JavaWarehouseComponentImpl.java b/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/warehouse/JavaWarehouseComponentImpl.java
deleted file mode 100644
index cdd12d589d..0000000000
--- a/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/warehouse/JavaWarehouseComponentImpl.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * 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 supplychain.warehouse;
-
-import org.osoa.sca.annotations.Scope;
-
-import supplychain.shipper.Shipper;
-
-/**
- * This class implements the Warehouse service component (POJO implementation).
- */
-@Scope("STATELESS")
-public class JavaWarehouseComponentImpl implements Warehouse {
-
- private Shipper shipper;
-
- public JavaWarehouseComponentImpl() {
- System.out.println("Created " + this.getClass().getCanonicalName() +
- " using: " + this.getClass().getClassLoader());
- }
-
- public void setShipper(Shipper shipper) {
- this.shipper = shipper;
- }
-
- public void fulfillOrder(String order) {
- shipper.processShipment(order + ", fulfilled");
- }
-
-
-}
diff --git a/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/warehouse/Warehouse.java b/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/warehouse/Warehouse.java
deleted file mode 100644
index 6f1f6b8730..0000000000
--- a/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/java/supplychain/warehouse/Warehouse.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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 supplychain.warehouse;
-
-/**
- * This is the business interface of the Warehouse service component.
- */
-public interface Warehouse {
-
- public void fulfillOrder(String order);
-
-}
diff --git a/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/complete-supplychain-sca-contribution.xml b/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/complete-supplychain-sca-contribution.xml
deleted file mode 100644
index 714d1826e1..0000000000
--- a/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/complete-supplychain-sca-contribution.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-
diff --git a/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/customer-impl-sca-contribution.xml b/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/customer-impl-sca-contribution.xml
deleted file mode 100644
index 7f7dc969e2..0000000000
--- a/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/customer-impl-sca-contribution.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-
diff --git a/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/customer-interface-sca-contribution.xml b/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/customer-interface-sca-contribution.xml
deleted file mode 100644
index 7f7dc969e2..0000000000
--- a/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/customer-interface-sca-contribution.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-
diff --git a/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/customer-sca-contribution.xml b/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/customer-sca-contribution.xml
deleted file mode 100644
index 8a2bec308f..0000000000
--- a/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/customer-sca-contribution.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
diff --git a/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/illegal-customer-sca-contribution.xml b/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/illegal-customer-sca-contribution.xml
deleted file mode 100644
index c77c4c1c7e..0000000000
--- a/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/illegal-customer-sca-contribution.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-
diff --git a/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/illegal1-supplychain-sca-contribution.xml b/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/illegal1-supplychain-sca-contribution.xml
deleted file mode 100644
index 210a68011f..0000000000
--- a/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/illegal1-supplychain-sca-contribution.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
diff --git a/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/illegal2-supplychain-sca-contribution.xml b/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/illegal2-supplychain-sca-contribution.xml
deleted file mode 100644
index d118cceef9..0000000000
--- a/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/illegal2-supplychain-sca-contribution.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/retailer-sca-contribution.xml b/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/retailer-sca-contribution.xml
deleted file mode 100644
index d37b6659da..0000000000
--- a/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/retailer-sca-contribution.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
diff --git a/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/shipper-sca-contribution.xml b/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/shipper-sca-contribution.xml
deleted file mode 100644
index 77b28d9023..0000000000
--- a/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/shipper-sca-contribution.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
diff --git a/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/supplychain-sca-contribution.xml b/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/supplychain-sca-contribution.xml
deleted file mode 100644
index 8ec290a831..0000000000
--- a/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/supplychain-sca-contribution.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/warehouse-sca-contribution.xml b/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/warehouse-sca-contribution.xml
deleted file mode 100644
index 1398416978..0000000000
--- a/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/resources/META-INF/warehouse-sca-contribution.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
diff --git a/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/resources/supplychain/illegalsupplychain.composite b/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/resources/supplychain/illegalsupplychain.composite
deleted file mode 100644
index db1f0d34e7..0000000000
--- a/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/resources/supplychain/illegalsupplychain.composite
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/resources/supplychain/supplychain.composite b/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/resources/supplychain/supplychain.composite
deleted file mode 100644
index 5be79b741a..0000000000
--- a/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/resources/supplychain/supplychain.composite
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/resources/supplychain/warehouse/JavaWarehouseComponentImpl.componentType b/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/resources/supplychain/warehouse/JavaWarehouseComponentImpl.componentType
deleted file mode 100644
index a76fae8090..0000000000
--- a/branches/sca-equinox/itest/contribution-classloader/contribution-classes/src/main/resources/supplychain/warehouse/JavaWarehouseComponentImpl.componentType
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/branches/sca-equinox/itest/contribution-classloader/contribution-test/pom.xml b/branches/sca-equinox/itest/contribution-classloader/contribution-test/pom.xml
deleted file mode 100644
index 4bfad25131..0000000000
--- a/branches/sca-equinox/itest/contribution-classloader/contribution-test/pom.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-
- 4.0.0
-
- org.apache.tuscany.sca
- tuscany-itest
- 1.4-EQUINOX-SNAPSHOT
- ../pom.xml
-
- itest-contribution-classloader-test
- Apache Tuscany Contribution Classloader tests
-
-
-
- org.apache.tuscany.sca
- tuscany-host-embedded
- 1.4-EQUINOX-SNAPSHOT
-
-
-
- org.apache.tuscany.sca
- tuscany-implementation-java-runtime
- 1.4-EQUINOX-SNAPSHOT
- runtime
-
-
-
- junit
- junit
- 4.5
- test
-
-
-
-
diff --git a/branches/sca-equinox/itest/contribution-classloader/contribution-test/src/test/java/org/apache/tuscany/sca/test/contribution/ContributionTestCase.java b/branches/sca-equinox/itest/contribution-classloader/contribution-test/src/test/java/org/apache/tuscany/sca/test/contribution/ContributionTestCase.java
deleted file mode 100644
index 18fc2bbc88..0000000000
--- a/branches/sca-equinox/itest/contribution-classloader/contribution-test/src/test/java/org/apache/tuscany/sca/test/contribution/ContributionTestCase.java
+++ /dev/null
@@ -1,373 +0,0 @@
-/*
- * 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.sca.test.contribution;
-
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.net.URLClassLoader;
-
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.resolver.ClassReference;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
-/*
- *
- * Contribution ClassLoading integration tests
- */
-
-public class ContributionTestCase {
-
- private SupplyChain supplyChain;
-
-
- @Before
- public void setUp() throws Exception {
- supplyChain = new SupplyChain();
- }
-
-
- @After
- public void tearDown() throws Exception {
-
- supplyChain.tearDown();
-
- }
-
-
- /**
- * Test static ClassLoading for classes that are visible from contribution
- *
- * @throws Exception
- */
- public void staticClassLoadingTestForVisibleClasses() throws Exception {
-
- Contribution customerContribution = supplyChain.getContribution("Customer");
- ClassReference customerClassRef = new ClassReference("supplychain.customer.Customer");
- customerClassRef = customerContribution.getModelResolver().resolveModel(ClassReference.class, customerClassRef);
- Class> customerClass = customerClassRef.getJavaClass();
-
- Class customerClassFromContribution = customerContribution.getClassLoader().loadClass("supplychain.customer.Customer");
- Assert.assertEquals(customerClass, customerClassFromContribution);
-
- Object customer = supplyChain.getCustomer(customerClass);
-
- Method m = customerClass.getMethod("purchaseGoods");
- m.invoke(customer);
-
-
- m = customerClass.getMethod("outstandingOrderCount");
-
- int retries = 10;
- int outstandingCount = 1;
- while (retries-- > 0) {
-
- outstandingCount = (int)(Integer)m.invoke(customer);
- if (outstandingCount == 0)
- break;
- else
- Thread.sleep(100);
- }
- Assert.assertEquals(0, outstandingCount);
-
-
- }
-
-
- /**
- * Test dynamic ClassLoading for classes that are visible from contribution
- *
- * @throws Exception
- */
- public void dynamicClassLoadingTestForVisibleClasses() throws Exception {
-
- Contribution customerContribution = supplyChain.getContribution("Customer");
- Contribution retailerContribution = supplyChain.getContribution("Retailer");
- Contribution warehouseContribution = supplyChain.getContribution("Warehouse");
- Contribution shipperContribution = supplyChain.getContribution("Shipper");
- Contribution supplyChainContribution = supplyChain.getContribution("SupplyChain");
-
- ClassReference customerClassRef = new ClassReference("supplychain.customer.Customer");
- customerClassRef = customerContribution.getModelResolver().resolveModel(ClassReference.class, customerClassRef);
- Class customerClass = customerClassRef.getJavaClass();
-
- Class customerClassFromContribution = customerContribution.getClassLoader().loadClass("supplychain.customer.Customer");
- Assert.assertEquals(customerClass, customerClassFromContribution);
-
- Object customer = supplyChain.getCustomer(customerClass);
- Assert.assertTrue(customerClass.isInstance(customer));
-
- ClassReference retailerClassRef = new ClassReference("supplychain.retailer.Retailer");
- retailerClassRef = retailerContribution.getModelResolver().resolveModel(ClassReference.class, retailerClassRef);
- Class retailerClass = retailerClassRef.getJavaClass();
-
- Class retailerClassFromContribution = retailerContribution.getClassLoader().loadClass("supplychain.retailer.Retailer");
- Assert.assertEquals(retailerClass, retailerClassFromContribution);
-
- Class retailerClassFromCustomer = customerContribution.getClassLoader().loadClass("supplychain.retailer.Retailer");
- Assert.assertEquals(retailerClass, retailerClassFromCustomer);
-
- ClassReference warehouseClassRef = new ClassReference("supplychain.warehouse.Warehouse");
- warehouseClassRef = warehouseContribution.getModelResolver().resolveModel(ClassReference.class, warehouseClassRef);
- Class warehouseClass = warehouseClassRef.getJavaClass();
-
- Class warehouseClassFromContribution = warehouseContribution.getClassLoader().loadClass("supplychain.warehouse.Warehouse");
- Assert.assertEquals(warehouseClass, warehouseClassFromContribution);
-
- Class warehouseClassFromRetailer = retailerContribution.getClassLoader().loadClass("supplychain.warehouse.Warehouse");
- Assert.assertEquals(warehouseClass, warehouseClassFromRetailer);
-
- ClassReference shipperClassRef = new ClassReference("supplychain.shipper.Shipper");
- shipperClassRef = shipperContribution.getModelResolver().resolveModel(ClassReference.class, shipperClassRef);
- Class shipperClass = shipperClassRef.getJavaClass();
-
- Class shipperClassFromContribution = shipperContribution.getClassLoader().loadClass("supplychain.shipper.Shipper");
- Assert.assertEquals(shipperClass, shipperClassFromContribution);
-
- Class shipperClassFromWarehouse = shipperContribution.getClassLoader().loadClass("supplychain.shipper.Shipper");
- Assert.assertEquals(shipperClass, shipperClassFromWarehouse);
-
- Class customerClassFromShipper = shipperContribution.getClassLoader().loadClass("supplychain.customer.Customer");
- Assert.assertEquals(customerClass, customerClassFromShipper);
-
- Class customerClassFromSupplyChain = supplyChainContribution.getClassLoader().loadClass("supplychain.customer.Customer");
- Assert.assertEquals(customerClass, customerClassFromSupplyChain);
- Class retailerClassFromSupplyChain = supplyChainContribution.getClassLoader().loadClass("supplychain.retailer.Retailer");
- Assert.assertEquals(retailerClass, retailerClassFromSupplyChain);
- Class warehouseClassFromSupplyChain = supplyChainContribution.getClassLoader().loadClass("supplychain.warehouse.Warehouse");
- Assert.assertEquals(warehouseClass, warehouseClassFromSupplyChain);
- Class shipperClassFromSupplyChain = supplyChainContribution.getClassLoader().loadClass("supplychain.shipper.Shipper");
- Assert.assertEquals(shipperClass, shipperClassFromSupplyChain);
-
- }
-
- /**
- * Test dynamic ClassLoading for classes that are visible from contribution
- *
- * @throws Exception
- */
- public void dynamicClassLoadingTestForNonImportedClasses() throws Exception {
-
- Contribution customerContribution = supplyChain.getContribution("Customer");
- Contribution shipperContribution = supplyChain.getContribution("Shipper");
-
- Class customerClass = customerContribution.getClassLoader().loadClass("supplychain.customer.Customer");
- Class shipperClass = shipperContribution.getClassLoader().loadClass("supplychain.shipper.Shipper");
-
- try {
- customerClass.getClassLoader().loadClass("supplychain.warehouse.Warehouse");
- Assert.fail("Non-imported class loaded incorrectly");
- } catch (ClassNotFoundException e) {
- }
- try {
- customerClass.getClassLoader().loadClass("supplychain.shipper.JavaShipperComponentImpl");
- Assert.fail("Non-imported class loaded incorrectly");
- } catch (ClassNotFoundException e) {
- }
-
- try {
- Class.forName("supplychain.warehouse.Warehouse", true, customerClass.getClassLoader());
- Assert.fail("Non-imported class loaded incorrectly");
- } catch (ClassNotFoundException e) {
- }
- try {
- Class.forName("supplychain.shipper.JavaShipperComponentImpl", true, customerClass.getClassLoader());
- Assert.fail("Non-imported class loaded incorrectly");
- } catch (ClassNotFoundException e) {
- }
-
- try {
- shipperClass.getClassLoader().loadClass("supplychain.warehouse.JavaWarehouseComponentImpl");
- Assert.fail("Non-imported class loaded incorrectly");
- } catch (ClassNotFoundException e) {
- }
- try {
- shipperClass.getClassLoader().loadClass("supplychain.retailer.Retailer");
- Assert.fail("Non-imported class loaded incorrectly");
- } catch (ClassNotFoundException e) {
- }
-
- try {
- Class.forName("supplychain.warehouse.JavaWarehouseComponentImpl", true, shipperClass.getClassLoader());
- Assert.fail("Non-imported class loaded incorrectly");
- } catch (ClassNotFoundException e) {
- }
- try {
- Class.forName("supplychain.retailer.Retailer", true, shipperClass.getClassLoader());
- Assert.fail("Non-imported class loaded incorrectly");
- } catch (ClassNotFoundException e) {
- }
-
-
- }
-
-
- /**
- * This test ensures that classes from imported packages can be statically loaded
- * from other contributions even though the classes are not on CLASSPATH or on the
- * parent ClassLoader, or the thread context ClassLoader.
- *
- * @throws Exception
- */
- @Test
- public void testValidStaticClassLoading() throws Exception {
-
- supplyChain.setUp(this.getClass().getClassLoader());
-
- staticClassLoadingTestForVisibleClasses();
- }
-
- /**
- * This test ensures that all imported classes are loaded from the exporting contributions
- * rather than the parent classLoader. If any of the interface classes were incorrectly loaded
- * through the parent ClassLoader, LinkageError should result.
- *
- * @throws Exception
- */
- @Test
- public void testValidStaticClassLoadingWithContributionsInParentClassLoader() throws Exception {
-
-
- URLClassLoader parentClassLoader = new URLClassLoader(
- supplyChain.getContributionURLs(),
- this.getClass().getClassLoader());
-
- supplyChain.setUp(parentClassLoader);
-
- staticClassLoadingTestForVisibleClasses();
- }
-
-
- /**
- * This test ensures that classes from imported packages can be dynamically loaded from
- * other contributions even though the classes are not on CLASSPATH or on the
- * parent ClassLoader, or the thread context ClassLoader.
- *
- * @throws Exception
- */
- @Test
- public void testValidDynamicClassLoading() throws Exception {
-
- supplyChain.setUp(this.getClass().getClassLoader());
-
- dynamicClassLoadingTestForVisibleClasses();
- }
-
- /**
- * This test ensures that all imported classes are dynamically loaded from the exporting
- * contributions rather than the parent classLoader. If any of the interface classes were
- * incorrectly loaded through the parent, NoClassDefFoundError or LinkageError should result.
- *
- * @throws Exception
- */
- @Test
- public void testValidDynamicClassLoadingWithContributionsInParentClassLoader() throws Exception {
-
-
- URLClassLoader parentClassLoader = new URLClassLoader(
- supplyChain.getContributionURLs(),
- this.getClass().getClassLoader());
-
- supplyChain.setUp(parentClassLoader);
-
- dynamicClassLoadingTestForVisibleClasses();
- }
-
- @Test
- public void testIllegalStaticClassLoading1() throws Exception {
- // FIXME we have commented this code as we are not throwing exceptions anymore
- // need to deal with monitor logs to catch the errors.
-
- /*try {
- supplyChain.setUp(this.getClass().getClassLoader(), SupplyChain.SUPPLYCHAIN_ILLEGAL_1);
-
- Assert.fail("Composite containing unresolved references resolved incorrectly");
- } catch (ContributionResolveException e) {
- }*/
- }
-
- @Test
- public void testIllegalStaticClassLoading2() throws Exception {
-
- supplyChain.setUp(this.getClass().getClassLoader(), SupplyChain.SUPPLYCHAIN_ILLEGAL_2);
-
- Contribution customerContribution = supplyChain.getContribution("Customer");
- ClassReference customerClassRef = new ClassReference("supplychain.customer.Customer");
- customerClassRef = customerContribution.getModelResolver().resolveModel(ClassReference.class, customerClassRef);
- Class> customerClass = customerClassRef.getJavaClass();
-
- Object customer = supplyChain.getCustomer(customerClass);
-
- try {
- Method m = customerClass.getMethod("purchaseGoods");
- m.invoke(customer);
-
- Assert.fail("Classloading exception not thrown as expected");
- } catch (InvocationTargetException e) {
-
- Throwable cause = e.getCause();
- Assert.assertTrue(cause instanceof NoClassDefFoundError);
- Assert.assertTrue(cause.getMessage().indexOf("JavaWarehouseComponentImpl") > -1); }
-
- }
-
- /**
- * This test ensures that classes from imported packages can be dynamically loaded from
- * other contributions even though the classes are not on CLASSPATH or on the
- * parent ClassLoader, or the thread context ClassLoader.
- *
- * @throws Exception
- */
- @Test
- public void testIllegalDynamicClassLoading() throws Exception {
-
- supplyChain.setUp(this.getClass().getClassLoader());
-
- dynamicClassLoadingTestForNonImportedClasses();
- }
-
-
- /**
- * Self-contained contribution containing composites, componentType files and implementations
- * should not require import/export statements for these files to find each other or for Tuscany
- * to load these files.
- * @throws Exception
- */
- @Test
- public void testSelfContainedContribution() throws Exception {
-
- supplyChain.setUp(this.getClass().getClassLoader(), SupplyChain.SUPPLYCHAIN_SELFCONTAINED);
-
- staticClassLoadingTestForVisibleClasses();
- }
-
- @Test
- public void testContributionsWithSplitPackage() throws Exception {
-
- supplyChain.setUp(this.getClass().getClassLoader(), SupplyChain.SUPPLYCHAIN_SPLITPACKAGE);
-
- staticClassLoadingTestForVisibleClasses();
-
- dynamicClassLoadingTestForNonImportedClasses();
- }
-}
diff --git a/branches/sca-equinox/itest/contribution-classloader/contribution-test/src/test/java/org/apache/tuscany/sca/test/contribution/SupplyChain.java b/branches/sca-equinox/itest/contribution-classloader/contribution-test/src/test/java/org/apache/tuscany/sca/test/contribution/SupplyChain.java
deleted file mode 100644
index 1ec7aaaa3a..0000000000
--- a/branches/sca-equinox/itest/contribution-classloader/contribution-test/src/test/java/org/apache/tuscany/sca/test/contribution/SupplyChain.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- * 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.sca.test.contribution;
-
-
-import java.io.File;
-import java.net.URL;
-import java.util.Hashtable;
-
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.service.ContributionService;
-import org.apache.tuscany.sca.host.embedded.impl.EmbeddedSCADomain;
-import org.junit.Assert;
-
-/*
- *
- * Contribution ClassLoading integration tests
- */
-
-public class SupplyChain {
-
- public static final int SUPPLYCHAIN = 0;
- public static final int SUPPLYCHAIN_ILLEGAL_1 = 1;
- public static final int SUPPLYCHAIN_ILLEGAL_2 = 2;
- public static final int SUPPLYCHAIN_SELFCONTAINED = 3;
- public static final int SUPPLYCHAIN_SPLITPACKAGE = 4;
-
- private String folderName = "../contribution-classes/target/classes";
-
- private String customerJarName = "Customer";
- private String retailerJarName = "Retailer";
- private String warehouseJarName = "Warehouse";
- private String shipperJarName = "Shipper";
- private String supplychainJarName = "SupplyChain";
- private String illegalSupplyChain1JarName = "IllegalSupplyChain1";
- private String illegalSupplyChain2JarName = "IllegalSupplyChain2";
- private String illegalCustomerJarName = "IllegalCustomer";
- private String completeSupplychainJarName = "CompleteSupplyChain";
- private String customerInterfaceJarName = "CustomerInterface";
- private String customerImplJarName = "CustomerImpl";
-
-
- private EmbeddedSCADomain domain;
- private ContributionService contributionService;
- private int supplyChainVersion;
-
- private Hashtable contributions = new Hashtable();
-
- private URL customerContribURL;
- private URL retailerContribURL;
- private URL warehouseContribURL;
- private URL shipperContribURL;
- private URL supplyChainContribURL;
- private URL illegalSupplyChain1ContribURL;
- private URL illegalSupplyChain2ContribURL;
- private URL illegalCustomerContribURL;
- private URL completeSupplyChainContribURL;
- private URL customerInterfaceContribURL;
- private URL customerImplContribURL;
-
- public SupplyChain() throws Exception {
-
- customerContribURL = new File(folderName + "/" + customerJarName + ".jar").toURI().toURL();
- retailerContribURL = new File(folderName + "/" + retailerJarName + ".jar").toURI().toURL();
- warehouseContribURL = new File(folderName + "/" + warehouseJarName + ".jar").toURI().toURL();
- shipperContribURL = new File(folderName + "/" + shipperJarName + ".jar").toURI().toURL();
- supplyChainContribURL = new File(folderName + "/" + supplychainJarName + ".jar").toURI().toURL();
- illegalSupplyChain1ContribURL = new File(folderName + "/" + illegalSupplyChain1JarName + ".jar").toURI().toURL();
- illegalSupplyChain2ContribURL = new File(folderName + "/" + illegalSupplyChain2JarName + ".jar").toURI().toURL();
- illegalCustomerContribURL = new File(folderName + "/" + illegalCustomerJarName + ".jar").toURI().toURL();
- completeSupplyChainContribURL = new File(folderName + "/" + completeSupplychainJarName + ".jar").toURI().toURL();
- customerInterfaceContribURL = new File(folderName + "/" + customerInterfaceJarName + ".jar").toURI().toURL();
- customerImplContribURL = new File(folderName + "/" + customerImplJarName + ".jar").toURI().toURL();
- }
-
- public void setUp(ClassLoader parentClassLoader) throws Exception {
- this.setUp(parentClassLoader, SUPPLYCHAIN);
- }
-
- public void setUp(ClassLoader parentClassLoader, int supplyChainVersion) throws Exception {
-
- this.supplyChainVersion = supplyChainVersion;
-
- Thread.currentThread().setContextClassLoader(parentClassLoader);
-
- //Create an embedded SCA domain
- domain = new EmbeddedSCADomain(parentClassLoader, "http://localhost");
-
- //Start the domain
- domain.start();
-
- this.contributionService = domain.getContributionService();
-
- addContributions(supplyChainVersion);
- }
-
- protected void addContributions(int supplyChainVersion) throws Exception {
-
- Contribution contribution;
-
- if (supplyChainVersion != SUPPLYCHAIN_SELFCONTAINED) {
- contribution = contributionService.contribute("Shipper", shipperContribURL, true);
- contributions.put("Shipper", contribution);
- contribution = contributionService.contribute("Warehouse", warehouseContribURL, true);
- contributions.put("Warehouse", contribution);
- contribution = contributionService.contribute("Retailer", retailerContribURL, true);
- contributions.put("Retailer", contribution);
- }
-
- switch (supplyChainVersion) {
- case SUPPLYCHAIN:
- contribution = contributionService.contribute("Customer", customerContribURL, true);
- contributions.put("Customer", contribution);
-
- contribution = contributionService.contribute("SupplyChain", supplyChainContribURL, true);
- contributions.put("SupplyChain", contribution);
- break;
- case SUPPLYCHAIN_ILLEGAL_1:
- contribution = contributionService.contribute("Customer", customerContribURL, true);
- contributions.put("Customer", contribution);
-
- contribution = contributionService.contribute("SupplyChain", illegalSupplyChain1ContribURL, true);
- contributions.put("SupplyChain", contribution);
- break;
- case SUPPLYCHAIN_ILLEGAL_2:
- contribution = contributionService.contribute("Customer", illegalCustomerContribURL, true);
- contributions.put("Customer", contribution);
-
- contribution = contributionService.contribute("SupplyChain", illegalSupplyChain2ContribURL, true);
- contributions.put("SupplyChain", contribution);
- break;
- case SUPPLYCHAIN_SELFCONTAINED:
- contribution = contributionService.contribute("SupplyChain", completeSupplyChainContribURL, true);
- contributions.put("SupplyChain", contribution);
- break;
- case SUPPLYCHAIN_SPLITPACKAGE:
- contribution = contributionService.contribute("Customer", customerInterfaceContribURL, true);
- contributions.put("Customer", contribution);
-
- contribution = contributionService.contribute("CustomerImpl", customerImplContribURL, true);
- contributions.put("CustomerImpl", contribution);
-
- contribution = contributionService.contribute("SupplyChain", supplyChainContribURL, true);
- contributions.put("SupplyChain", contribution);
- break;
- }
-
- // SUPPLYCHAIN_ILLEGAL_1 should throw an exception when the composite is resolved, and hence
- // should not get this far.
- Assert.assertTrue(supplyChainVersion != SUPPLYCHAIN_ILLEGAL_1);
-
-
- for (Contribution c : contributions.values()) {
-
- for (Composite deployable : c.getDeployables()) {
- domain.getDomainComposite().getIncludes().add(deployable);
- domain.buildComposite(deployable);
- }
-
- }
-
- // Start Components from my composite
- for (Composite deployable : contributions.get("SupplyChain").getDeployables() ) {
- domain.getCompositeActivator().activate(deployable);
- domain.getCompositeActivator().start(deployable);
- }
- }
-
- public void tearDown() throws Exception {
-
- if (domain == null)
- return;
-
- for (String contributionURI : contributions.keySet()) {
- contributionService.remove(contributionURI);
- }
-
-
- if (contributions.get("SupplyChain") != null) {
- // Stop Components from my composite
- for (Composite deployable : contributions.get("SupplyChain").getDeployables() ) {
- domain.getCompositeActivator().stop(deployable);
- domain.getCompositeActivator().deactivate(deployable);
- }
- }
-
- domain.stop();
-
- domain.close();
- }
-
- public Contribution getContribution(String uri) {
- if (supplyChainVersion == SUPPLYCHAIN_SELFCONTAINED)
- return contributions.get("SupplyChain");
- else
- return contributions.get(uri);
- }
-
- public Object getCustomer(Class> customerClass) {
- return domain.getService(customerClass, "CustomerComponent");
- }
-
- public URL[] getContributionURLs() {
- return new URL[] {
- customerContribURL,
- retailerContribURL,
- warehouseContribURL,
- shipperContribURL,
- supplyChainContribURL
- };
- }
-
-
-}
diff --git a/branches/sca-equinox/itest/contribution-classloader/contribution-test/src/test/java/org/apache/tuscany/sca/test/contribution/TuscanyClassloadingTestCaseFIXME.java b/branches/sca-equinox/itest/contribution-classloader/contribution-test/src/test/java/org/apache/tuscany/sca/test/contribution/TuscanyClassloadingTestCaseFIXME.java
deleted file mode 100644
index b123951ef6..0000000000
--- a/branches/sca-equinox/itest/contribution-classloader/contribution-test/src/test/java/org/apache/tuscany/sca/test/contribution/TuscanyClassloadingTestCaseFIXME.java
+++ /dev/null
@@ -1,381 +0,0 @@
-/*
- * 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.sca.test.contribution;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Method;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.extensibility.ServiceDiscovery;
-import org.apache.tuscany.sca.host.embedded.impl.EmbeddedSCADomain;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.osoa.sca.ServiceReference;
-
-/*
- *
- * Contribution ClassLoading integration tests
- */
-
-//FIXME This test case needs some serious rework!
-// First it is very dependent on the names of the Tuscany runtime JARs
-// and this is going to be difficult to maintain
-// Second its usage of reflection requires the Tuscany implementation classes
-// to be made public and this breaks isolation between modules.
-public class TuscanyClassloadingTestCaseFIXME {
-
- // private static final int SCA_API = 1;
- // private static final int TUSCANY_CORE_SPI = 2;
- // private static final int TUSCANY_RUNTIME = 3;
- // private static final int TUSCANY_EXTENSIONS = 4;
- // private static final int TUSCANY_DEPENDENCIES = 0;
-
- private static final String[] scaApiJars = {"sca-api"};
- private static final String[] tuscanyCoreSpiJars =
- {"core-spi", "interface", "interface-java", "interface-wsdl", "assembly", "policy", "databinding",
- "contribution", "definitions"};
- private static final String[] tuscanyRuntimeJars =
- {
-
- "binding-sca-xml", "binding-sca", "assembly-java-dsl", "assembly-xml", "assembly-xsd", "contribution-impl",
- "contribution-java", "contribution-namespace", "core-databinding", "core-spring", "core", "definitions-xml",
- "domain-api", "domain-impl", "domain", "extension-helper", "host-embedded", "interface-java-xml",
- "interface-wsdl-xml", "java2wsdl", "node-api", "node-impl", "node", "osgi-runtime", "policy-logging",
- "policy-security", "policy-transaction", "policy-xml", "wsdl2java"};
- private static final String[] tuscanyExtensionJars =
- {"binding-dwr", "binding-ejb", "binding-feed", "binding-http", "binding-jms", "binding-jsonrpc",
- "binding-notification", "binding-rmi", "binding-sca-axis2", "binding-ws-axis2", "binding-ws-xml",
- "binding-ws", "databinding-axiom", "databinding-fastinfoset", "databinding-jaxb", "databinding-json",
- "databinding-saxon", "databinding-sdo-axiom", "databinding-sdo", "databinding-xmlbeans", "host-http",
- "host-jetty", "host-rmi", "host-tomcat", "host-webapp", "implementation-das.jar", "implementation-data.jar",
- "implementation-java-runtime", "implementation-java-xml", "implementation-java",
- "implementation-node-runtime", "implementation-node-xml", "implementation-node",
- "implementation-notification", "implementation-osgi", "implementation-resource", "implementation-script",
- "implementation-spring", "implementation-xquery", "contribution-osgi"};
-
- private Class> embeddedDomainClass;
- Object domain;
-
- @Before
- public void setUp() throws Exception {
-
- embeddedDomainClass = getEmbeddedDomainClass();
-
- Constructor c = embeddedDomainClass.getConstructor(ClassLoader.class, String.class);
- // Create an embedded domain
- domain = c.newInstance(embeddedDomainClass.getClassLoader(), "http://localhost");
-
- // Start the domain
- invokeNoArgsMethod(domain, "start");
-
- }
-
- @After
- public void tearDown() throws Exception {
-
- // Stop the domain
- invokeNoArgsMethod(domain, "stop");
-
- }
-
- /**
- * Create a ClassLoader hierarchy for Tuscany runtime
- * Dependencies <- SCA-API <- Core-SPI+ Runtime <- Extensions
- * Load the embedded SCA domain class using the runtime ClassLoader
- *
- * @return embedded SCA domain class
- * @throws Exception
- */
- private Class> getEmbeddedDomainClass() throws Exception {
-
- URL[] scaApiUrls;
- URL[] runtimeUrls;
- URL[] extensionUrls;
- URL[] dependencyUrls;
-
- // When the test is run under Eclipse, the ClassLoader for the test is
- // sun.misc.Launcher$AppClassLoader. The first code path is taken.
- // When the test is run under Maven, the ClassLoader for the test is
- // org.apache.maven.surefire.booter.IsolatedClassLoader, which is a subclass
- // of URLClassLoader. The second code path is taken.
- if (!(this.getClass().getClassLoader() instanceof URLClassLoader)) {
- String classPath = System.getProperty("java.class.path");
- String[] classPathEntries = classPath.split(System.getProperty("path.separator"));
- HashSet dependentJars = new HashSet();
- for (int i = 0; i < classPathEntries.length; i++) {
- dependentJars.add(classPathEntries[i]);
- }
-
- scaApiUrls = getTuscanyClassLoaderURLs(classPathEntries, dependentJars, scaApiJars);
- runtimeUrls =
- getTuscanyClassLoaderURLs(classPathEntries, dependentJars, tuscanyCoreSpiJars, tuscanyRuntimeJars);
- extensionUrls = getTuscanyClassLoaderURLs(classPathEntries, dependentJars, tuscanyExtensionJars);
- dependencyUrls = getTuscanyClassLoaderURLs(classPathEntries, dependentJars);
- } else {
- HashSet dependentJars = new HashSet();
- URL[] classPathEntries = ((URLClassLoader)this.getClass().getClassLoader()).getURLs();
- for (int i = 0; i < classPathEntries.length; i++) {
- dependentJars.add(classPathEntries[i]);
- }
- scaApiUrls = getTuscanyClassLoaderURLs(classPathEntries, dependentJars, scaApiJars);
- runtimeUrls =
- getTuscanyClassLoaderURLs(classPathEntries, dependentJars, tuscanyCoreSpiJars, tuscanyRuntimeJars);
- extensionUrls = getTuscanyClassLoaderURLs(classPathEntries, dependentJars, tuscanyExtensionJars);
- dependencyUrls = getTuscanyClassLoaderURLs(classPathEntries, dependentJars);
-
- }
-
- boolean useSingleClassLoader =
- (scaApiUrls == null || scaApiUrls.length == 0) || (runtimeUrls == null || runtimeUrls.length == 0)
- || (extensionUrls == null || extensionUrls.length == 0)
- || (dependencyUrls == null || dependencyUrls.length == 0);
-
- if (useSingleClassLoader) {
- return EmbeddedSCADomain.class;
- } else {
-
- ClassLoader dependencyLoader = new URLClassLoader(dependencyUrls, null);
- ClassLoader scaApiLoader = new URLClassLoader(scaApiUrls, dependencyLoader);
- ClassLoader runtimeClassLoader = new URLClassLoader(runtimeUrls, scaApiLoader);
- ClassLoader extensionClassLoader = new URLClassLoader(extensionUrls, runtimeClassLoader);
-
- Class> serviceDiscoveryClass = runtimeClassLoader.loadClass(ServiceDiscovery.class.getName());
- Method getInstanceMethod = serviceDiscoveryClass.getMethod("getInstance");
- Object serviceDiscoveryObj = getInstanceMethod.invoke(null);
- Method registerClassLoaderMethod =
- serviceDiscoveryClass.getMethod("registerClassLoader", ClassLoader.class);
- registerClassLoaderMethod.invoke(serviceDiscoveryObj, extensionClassLoader);
-
- Thread.currentThread().setContextClassLoader(extensionClassLoader);
-
- return runtimeClassLoader.loadClass(EmbeddedSCADomain.class.getName());
-
- }
-
- }
-
- /**
- * From the list of entries in the test ClassLoader, match
- * Tuscany jars corresponding to a ClassLoader, and return the list
- * of matching entries as URLs.
- * This method is used when the test is run under eclipse, using CLASSPATH
- * based application ClassLoader.
- *
- * @param classPathEntries List of entries on CLASSPATH
- * @param dependentJars Complete set of jars, remove jars corresponding to this
- * ClassLoader from the set.
- * @param jars List of Tuscany jars corresponding to this ClassLoader
- * @return Matching URLs for the ClassLoader
- * @throws IOException
- */
- private URL[] getTuscanyClassLoaderURLs(String[] classPathEntries, HashSet dependentJars, String[]... jars)
- throws IOException {
-
- String pathSeparator = System.getProperty("file.separator");
- HashSet classPathEntrySet;
-
- if (jars.length == 0)
- classPathEntrySet = dependentJars;
- else {
- classPathEntrySet = new HashSet();
-
- for (int i = 0; i < classPathEntries.length; i++) {
-
- String classPathEntry = classPathEntries[i];
- for (int j = 0; j < jars.length; j++) {
- String[] jarList = jars[j];
- if (jarList != null) {
- for (int k = 0; k < jarList.length; k++) {
- String jarName = "tuscany-" + jarList[k];
- String alternateJarName = "modules" + pathSeparator + jarList[k];
- if (classPathEntry.indexOf(jarName) >= 0 || classPathEntry.indexOf(alternateJarName) >= 0) {
- classPathEntrySet.add(classPathEntry);
- dependentJars.remove(classPathEntry);
- }
- }
- }
- }
- }
-
- }
- ArrayList urls = new ArrayList();
-
- for (String fileName : classPathEntrySet) {
- File file = new File((String)fileName);
- if (!file.exists()) {
- throw new FileNotFoundException(fileName);
-
- } else {
- urls.add(file.toURL());
-
- }
- }
-
- return (URL[])urls.toArray(new URL[urls.size()]);
- }
-
- /**
- * From the list of URLs of the test ClassLoader, match
- * Tuscany jars corresponding to a ClassLoader, and return the matching URLs
- * This method is used when the test is run under Maven. The test ClassLoader is
- * org.apache.maven.surefire.booter.IsolatedClassLoader, which is a subclass
- * of URLClassLoader
- *
- * @param classPathEntries List of URLs from the test ClassLoader
- * @param dependentJars Complete set of jars, remove jars corresponding to this
- * ClassLoader from the set.
- * @param jars List of Tuscany jars corresponding to this ClassLoader
- * @return Matching URLs for the ClassLoader
- * @throws IOException
- */
- private URL[] getTuscanyClassLoaderURLs(URL[] classPathEntries, HashSet dependentJars, String[]... jars)
- throws IOException {
-
- String pathSeparator = System.getProperty("file.separator");
- HashSet classPathEntrySet;
-
- if (jars.length == 0)
- classPathEntrySet = dependentJars;
- else {
- classPathEntrySet = new HashSet();
-
- for (int i = 0; i < classPathEntries.length; i++) {
-
- URL classPathEntry = classPathEntries[i];
- String classPathEntryStr = classPathEntry.getPath();
- for (int j = 0; j < jars.length; j++) {
- String[] jarList = jars[j];
- if (jarList != null) {
- for (int k = 0; k < jarList.length; k++) {
- String jarName = "tuscany-" + jarList[k];
- String alternateJarName = "modules" + pathSeparator + jarList[k];
- if (classPathEntryStr.indexOf(jarName) >= 0 || classPathEntryStr.indexOf(alternateJarName) >= 0) {
- classPathEntrySet.add(classPathEntry);
- dependentJars.remove(classPathEntry);
- }
- }
- }
- }
- }
-
- }
- return (URL[])classPathEntrySet.toArray(new URL[classPathEntrySet.size()]);
- }
-
- private Object invokeNoArgsMethod(Object obj, String methodName) throws Exception {
-
- return obj.getClass().getMethod(methodName).invoke(obj);
- }
-
- private Object invokeOneArgMethod(Object obj, String methodName, Class argType, Object arg) throws Exception {
-
- return obj.getClass().getMethod(methodName, argType).invoke(obj, arg);
- }
-
- /**
- *
- * Load Tuscany runtime using multiple ClassLoaders, and run supplychain
- * test.
- *
- * @throws Exception
- */
- @SuppressWarnings("unchecked")
- @Test
- public void test() throws Exception {
-
- ClassLoader runtimeClassloader = embeddedDomainClass.getClassLoader();
-
- if (runtimeClassloader == this.getClass().getClassLoader()) {
- System.out.println("Runtime and test loaded using the same classloader " + runtimeClassloader);
- } else {
- System.out
- .println("Running test using separate Tuscany classloaders, runtime classloader=" + runtimeClassloader);
- ClassLoader apiClassLoader =
- runtimeClassloader.loadClass(ServiceReference.class.getName()).getClassLoader();
- Assert.assertTrue(apiClassLoader != runtimeClassloader);
-
- try {
- runtimeClassloader.loadClass("org.apache.tuscany.sca.implementation.java.JavaImplementation");
- Assert.fail("Loaded extension class incorrectly from runtimeClassLoader");
- } catch (ClassNotFoundException e) {
- }
-
- }
-
- // Contribute supplychain (as single contribution)
- Object contributionService = invokeNoArgsMethod(domain, "getContributionService");
- Method contributeMethod =
- contributionService.getClass().getMethod("contribute", String.class, URL.class, boolean.class);
-
- String folderName = "../contribution-classes/target/classes";
- String supplychainJarName = "CompleteSupplyChain";
- URL supplyChainContribURL = new File(folderName + "/" + supplychainJarName + ".jar").toURL();
- Object contribution = contributeMethod.invoke(contributionService, "SupplyChain", supplyChainContribURL, true);
-
- Object composite = ((List)invokeNoArgsMethod(contribution, "getDeployables")).get(0);
- Object domainComposite = invokeNoArgsMethod(domain, "getDomainComposite");
- List includes = (List)invokeNoArgsMethod(domainComposite, "getIncludes");
- includes.add(composite);
- //Object compositeBuilder = invokeNoArgsMethod(domain, "getCompositeBuilder");
- Object compositeActivator = invokeNoArgsMethod(domain, "getCompositeActivator");
-
- Class compositeClass = embeddedDomainClass.getClassLoader().loadClass(Composite.class.getName());
- invokeOneArgMethod(domain, "buildComposite", compositeClass, composite);
- invokeOneArgMethod(compositeActivator, "activate", compositeClass, composite);
- invokeOneArgMethod(compositeActivator, "start", compositeClass, composite);
-
- // Get customer service
- Method getClassLoaderMethod = contribution.getClass().getMethod("getClassLoader");
- ClassLoader classLoader = (ClassLoader)getClassLoaderMethod.invoke(contribution);
-
- Class customerClass = classLoader.loadClass("supplychain.customer.Customer");
- Method getServiceMethod = embeddedDomainClass.getMethod("getService", Class.class, String.class);
- Object customer = getServiceMethod.invoke(domain, customerClass, "CustomerComponent");
-
- // Invoke purchaseGoods
- Method m = customerClass.getMethod("purchaseGoods");
- m.invoke(customer);
-
- m = customerClass.getMethod("outstandingOrderCount");
-
- int retries = 10;
- int outstandingCount = 1;
- while (retries-- > 0) {
-
- outstandingCount = (int)(Integer)m.invoke(customer);
- if (outstandingCount == 0)
- break;
- else
- Thread.sleep(100);
- }
- Assert.assertEquals(0, outstandingCount);
-
- }
-
-}
diff --git a/branches/sca-equinox/itest/contribution-classloader/pom.xml b/branches/sca-equinox/itest/contribution-classloader/pom.xml
deleted file mode 100644
index 613a9d36db..0000000000
--- a/branches/sca-equinox/itest/contribution-classloader/pom.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
- 4.0.0
-
- org.apache.tuscany.sca
- tuscany-itest
- 1.4-EQUINOX-SNAPSHOT
- ../pom.xml
-
- itest-contribution-classloader
- pom
- Apache Tuscany Contribution ClassLoader Integration Tests
-
-
- contribution-classes
- contribution-test
-
-
-
-
-