From 35f81a620ea2d8423a49d8630bcef1d69027f444 Mon Sep 17 00:00:00 2001 From: antelder Date: Sat, 28 Mar 2009 09:44:15 +0000 Subject: Remove old m2 branch git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@759447 13f79535-47bb-0310-9956-ffa450edef68 --- .../sca-java-2.0-M2/itest/callback-api/pom.xml | 58 ------ .../tuscany/sca/test/CallBackApiCallBack.java | 38 ---- .../apache/tuscany/sca/test/CallBackApiClient.java | 30 --- .../tuscany/sca/test/CallBackApiClientImpl.java | 201 --------------------- .../tuscany/sca/test/CallBackApiService.java | 50 ----- .../tuscany/sca/test/CallBackApiServiceImpl.java | 113 ------------ .../src/main/resources/CallBackApiTest.composite | 33 ---- .../main/resources/META-INF/sca-contribution.xml | 23 --- .../tuscany/sca/test/CallBackApiTestCase.java | 70 ------- 9 files changed, 616 deletions(-) delete mode 100644 branches/sca-java-2.0-M2/itest/callback-api/pom.xml delete mode 100644 branches/sca-java-2.0-M2/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiCallBack.java delete mode 100644 branches/sca-java-2.0-M2/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClient.java delete mode 100644 branches/sca-java-2.0-M2/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClientImpl.java delete mode 100644 branches/sca-java-2.0-M2/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiService.java delete mode 100644 branches/sca-java-2.0-M2/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiServiceImpl.java delete mode 100644 branches/sca-java-2.0-M2/itest/callback-api/src/main/resources/CallBackApiTest.composite delete mode 100644 branches/sca-java-2.0-M2/itest/callback-api/src/main/resources/META-INF/sca-contribution.xml delete mode 100644 branches/sca-java-2.0-M2/itest/callback-api/src/test/java/org/apache/tuscany/sca/test/CallBackApiTestCase.java (limited to 'branches/sca-java-2.0-M2/itest/callback-api') diff --git a/branches/sca-java-2.0-M2/itest/callback-api/pom.xml b/branches/sca-java-2.0-M2/itest/callback-api/pom.xml deleted file mode 100644 index 2ea0858bfb..0000000000 --- a/branches/sca-java-2.0-M2/itest/callback-api/pom.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-itest - 2.0-M2-SNAPSHOT - ../pom.xml - - itest-callback-api - Apache Tuscany SCA iTest Callback API - - - - org.apache.tuscany.sca - tuscany-node-api - 2.0-M2-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-node-impl - 2.0-M2-SNAPSHOT - test - - - - org.apache.tuscany.sca - tuscany-implementation-java-runtime - 2.0-M2-SNAPSHOT - test - - - - - - ${basedir}/../build-was-integration.xml - ${basedir}/../wasAdmin.py - - diff --git a/branches/sca-java-2.0-M2/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiCallBack.java b/branches/sca-java-2.0-M2/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiCallBack.java deleted file mode 100644 index b013462f9f..0000000000 --- a/branches/sca-java-2.0-M2/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.oasisopen.sca.annotation.Remotable; - -@Remotable -/** - * - */ -public interface CallBackApiCallBack { - /** - * This function is defined in CallBackApiClientImpl - */ - void callBackMessage(String aString); - - /** - * This function is defined in CallBackApiClientImpl - */ - void callBackIncrement(String aString); - -} diff --git a/branches/sca-java-2.0-M2/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClient.java b/branches/sca-java-2.0-M2/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClient.java deleted file mode 100644 index 252e4dc45f..0000000000 --- a/branches/sca-java-2.0-M2/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.oasisopen.sca.annotation.Remotable; - -@Remotable -public interface CallBackApiClient { - /** - * This function is defined in CallBackApiClientImpl - */ - void run(); - -} diff --git a/branches/sca-java-2.0-M2/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClientImpl.java b/branches/sca-java-2.0-M2/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClientImpl.java deleted file mode 100644 index d883dc2d6f..0000000000 --- a/branches/sca-java-2.0-M2/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClientImpl.java +++ /dev/null @@ -1,201 +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.junit.Assert; -import org.oasisopen.sca.annotation.Reference; -import org.oasisopen.sca.annotation.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(); - } - - /** - * 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); - } - - /** - * 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()); - } - - /** - * 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-java-2.0-M2/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiService.java b/branches/sca-java-2.0-M2/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiService.java deleted file mode 100644 index afb7c45e2c..0000000000 --- a/branches/sca-java-2.0-M2/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.oasisopen.sca.annotation.Callback; -import org.oasisopen.sca.annotation.Remotable; - -@Remotable -@Callback(CallBackApiCallBack.class) -/** - * - */ -public interface CallBackApiService { - /** - * This function is defined in CallBackApiServiceImpl - */ - void knockKnock(String aString); - - /** - * This function is defined in CallBackApiServiceImpl - */ - void knockKnockByRef(String aString); - - /** - * This function is defined in CallBackApiServiceImpl - */ - void noCallBack(String aString); - - /** - * This function is defined in CallBackApiServiceImpl - */ - void multiCallBack(String aString); - -} diff --git a/branches/sca-java-2.0-M2/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiServiceImpl.java b/branches/sca-java-2.0-M2/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiServiceImpl.java deleted file mode 100644 index bdac56d222..0000000000 --- a/branches/sca-java-2.0-M2/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiServiceImpl.java +++ /dev/null @@ -1,113 +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.oasisopen.sca.CallableReference; -import org.oasisopen.sca.ComponentContext; -import org.oasisopen.sca.RequestContext; -import org.oasisopen.sca.annotation.Callback; -import org.oasisopen.sca.annotation.Context; -import org.oasisopen.sca.annotation.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"); - } - - /** - * 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"); - } - - /** - * 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"); - } - - /** - * 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); - } - - /** - * 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-java-2.0-M2/itest/callback-api/src/main/resources/CallBackApiTest.composite b/branches/sca-java-2.0-M2/itest/callback-api/src/main/resources/CallBackApiTest.composite deleted file mode 100644 index 309311e258..0000000000 --- a/branches/sca-java-2.0-M2/itest/callback-api/src/main/resources/CallBackApiTest.composite +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - diff --git a/branches/sca-java-2.0-M2/itest/callback-api/src/main/resources/META-INF/sca-contribution.xml b/branches/sca-java-2.0-M2/itest/callback-api/src/main/resources/META-INF/sca-contribution.xml deleted file mode 100644 index 6e049d603e..0000000000 --- a/branches/sca-java-2.0-M2/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-java-2.0-M2/itest/callback-api/src/test/java/org/apache/tuscany/sca/test/CallBackApiTestCase.java b/branches/sca-java-2.0-M2/itest/callback-api/src/test/java/org/apache/tuscany/sca/test/CallBackApiTestCase.java deleted file mode 100644 index 75fab95efb..0000000000 --- a/branches/sca-java-2.0-M2/itest/callback-api/src/test/java/org/apache/tuscany/sca/test/CallBackApiTestCase.java +++ /dev/null @@ -1,70 +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.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.ContributionLocationHelper; -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; - -public class CallBackApiTestCase { - - private static Node node; - 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. - */ - @Test - public void testCallBackBasic() { - aCallBackClient = node.getService(CallBackApiClient.class, "CallBackApiClient"); - aCallBackClient.run(); - } - - /** - * This function creates the Node instance and gets an Instance of CallBackApiClient.class - */ - - @BeforeClass - public static void setUp() throws Exception { - if (node == null) { - String location = ContributionLocationHelper.getContributionLocation("CallBackApiTest.composite"); - node = NodeFactory.newInstance().createNode("CallBackApiTest.composite", new Contribution("c1", location)); - node.start(); - } - } - - /** - * This function destroys the Node instance that was created in setUp() - */ - - @AfterClass - public static void tearDown() throws Exception { - node.stop(); - } - -} -- cgit v1.2.3