From c4a6a944e93fa338c196ad5c16d5c844d4b2d09c Mon Sep 17 00:00:00 2001 From: antelder Date: Tue, 17 Mar 2009 12:05:24 +0000 Subject: Copy sca trunk to sandbox area so i can get the release plugin configuration correct without messing up the live trunk git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@755209 13f79535-47bb-0310-9956-ffa450edef68 --- .../trunk/itest/callback-set-conversation/pom.xml | 53 +++++++ .../test/CallBackSetCallbackConvBadCallback.java | 39 +++++ .../sca/test/CallBackSetCallbackConvCallback.java | 34 +++++ .../sca/test/CallBackSetCallbackConvClient.java | 28 ++++ .../test/CallBackSetCallbackConvClientImpl.java | 157 +++++++++++++++++++++ .../CallBackSetCallbackConvNonSerCallback.java | 56 ++++++++ .../CallBackSetCallbackConvObjectCallback.java | 51 +++++++ .../sca/test/CallBackSetCallbackConvService.java | 36 +++++ .../test/CallBackSetCallbackConvServiceImpl.java | 98 +++++++++++++ .../CallBackSetCallbackConvTest.composite | 33 +++++ .../sca/test/CallBackSetCallbackConvTestCase.java | 52 +++++++ 11 files changed, 637 insertions(+) create mode 100644 sandbox/ant/sca/trunk/itest/callback-set-conversation/pom.xml create mode 100644 sandbox/ant/sca/trunk/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvBadCallback.java create mode 100644 sandbox/ant/sca/trunk/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvCallback.java create mode 100644 sandbox/ant/sca/trunk/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvClient.java create mode 100644 sandbox/ant/sca/trunk/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvClientImpl.java create mode 100644 sandbox/ant/sca/trunk/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvNonSerCallback.java create mode 100644 sandbox/ant/sca/trunk/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvObjectCallback.java create mode 100644 sandbox/ant/sca/trunk/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvService.java create mode 100644 sandbox/ant/sca/trunk/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvServiceImpl.java create mode 100644 sandbox/ant/sca/trunk/itest/callback-set-conversation/src/main/resources/CallBackSetCallbackConvTest.composite create mode 100644 sandbox/ant/sca/trunk/itest/callback-set-conversation/src/test/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvTestCase.java (limited to 'sandbox/ant/sca/trunk/itest/callback-set-conversation') diff --git a/sandbox/ant/sca/trunk/itest/callback-set-conversation/pom.xml b/sandbox/ant/sca/trunk/itest/callback-set-conversation/pom.xml new file mode 100644 index 0000000000..4356e70491 --- /dev/null +++ b/sandbox/ant/sca/trunk/itest/callback-set-conversation/pom.xml @@ -0,0 +1,53 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-itest + 2.0-SNAPSHOT + ../pom.xml + + itest-callback-set-conversation + Apache Tuscany SCA Callback Set Conversation Integration Tests + + + + org.apache.tuscany.sca + tuscany-node-api + 2.0-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-node-impl + 2.0-SNAPSHOT + test + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 2.0-SNAPSHOT + test + + + + diff --git a/sandbox/ant/sca/trunk/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvBadCallback.java b/sandbox/ant/sca/trunk/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvBadCallback.java new file mode 100644 index 0000000000..77837fdb77 --- /dev/null +++ b/sandbox/ant/sca/trunk/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvBadCallback.java @@ -0,0 +1,39 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.test; + +import java.io.Serializable; + +import org.junit.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/sandbox/ant/sca/trunk/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvCallback.java b/sandbox/ant/sca/trunk/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvCallback.java new file mode 100644 index 0000000000..825d1d6486 --- /dev/null +++ b/sandbox/ant/sca/trunk/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvCallback.java @@ -0,0 +1,34 @@ +/* + * 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.Conversational; + +// @Remotable +@Conversational +/** + * + */ +public interface CallBackSetCallbackConvCallback { + + void callBackMessage(String aString); + + void callBackIncrement(String aString); + +} diff --git a/sandbox/ant/sca/trunk/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvClient.java b/sandbox/ant/sca/trunk/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvClient.java new file mode 100644 index 0000000000..b5c3e6e8b8 --- /dev/null +++ b/sandbox/ant/sca/trunk/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvClient.java @@ -0,0 +1,28 @@ +/* + * 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 CallBackSetCallbackConvClient { + + void run(); + +} diff --git a/sandbox/ant/sca/trunk/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvClientImpl.java b/sandbox/ant/sca/trunk/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvClientImpl.java new file mode 100644 index 0000000000..12a206affa --- /dev/null +++ b/sandbox/ant/sca/trunk/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvClientImpl.java @@ -0,0 +1,157 @@ +/* + * 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.ComponentContext; +import org.oasisopen.sca.ServiceReference; +import org.oasisopen.sca.annotation.Context; +import org.oasisopen.sca.annotation.Reference; +import org.oasisopen.sca.annotation.Scope; +import org.oasisopen.sca.annotation.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(); + } + + 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/sandbox/ant/sca/trunk/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvNonSerCallback.java b/sandbox/ant/sca/trunk/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvNonSerCallback.java new file mode 100644 index 0000000000..bd17731fa1 --- /dev/null +++ b/sandbox/ant/sca/trunk/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvNonSerCallback.java @@ -0,0 +1,56 @@ +/* + * 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; + +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/sandbox/ant/sca/trunk/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvObjectCallback.java b/sandbox/ant/sca/trunk/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvObjectCallback.java new file mode 100644 index 0000000000..f7c718adab --- /dev/null +++ b/sandbox/ant/sca/trunk/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvObjectCallback.java @@ -0,0 +1,51 @@ +/* + * 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/sandbox/ant/sca/trunk/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvService.java b/sandbox/ant/sca/trunk/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvService.java new file mode 100644 index 0000000000..74c19961ba --- /dev/null +++ b/sandbox/ant/sca/trunk/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvService.java @@ -0,0 +1,36 @@ +/* + * 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.Conversational; + +// @Remotable +@Conversational +@Callback(CallBackSetCallbackConvCallback.class) +/** + * + */ +public interface CallBackSetCallbackConvService { + + void knockKnock(String aString); + + void setCallbackIllegally(String aString); + +} diff --git a/sandbox/ant/sca/trunk/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvServiceImpl.java b/sandbox/ant/sca/trunk/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvServiceImpl.java new file mode 100644 index 0000000000..d79b9278e2 --- /dev/null +++ b/sandbox/ant/sca/trunk/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvServiceImpl.java @@ -0,0 +1,98 @@ +/* + * 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.oasisopen.sca.ComponentContext; +import org.oasisopen.sca.RequestContext; +import org.oasisopen.sca.ServiceReference; +import org.oasisopen.sca.annotation.Callback; +import org.oasisopen.sca.annotation.Context; +import org.oasisopen.sca.annotation.Scope; +import org.oasisopen.sca.annotation.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/sandbox/ant/sca/trunk/itest/callback-set-conversation/src/main/resources/CallBackSetCallbackConvTest.composite b/sandbox/ant/sca/trunk/itest/callback-set-conversation/src/main/resources/CallBackSetCallbackConvTest.composite new file mode 100644 index 0000000000..831e488f1b --- /dev/null +++ b/sandbox/ant/sca/trunk/itest/callback-set-conversation/src/main/resources/CallBackSetCallbackConvTest.composite @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + diff --git a/sandbox/ant/sca/trunk/itest/callback-set-conversation/src/test/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvTestCase.java b/sandbox/ant/sca/trunk/itest/callback-set-conversation/src/test/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvTestCase.java new file mode 100644 index 0000000000..a61682da06 --- /dev/null +++ b/sandbox/ant/sca/trunk/itest/callback-set-conversation/src/test/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvTestCase.java @@ -0,0 +1,52 @@ +/* + * 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.After; +import org.junit.Before; +import org.junit.Test; + +public class CallBackSetCallbackConvTestCase { + + private Node node; + private CallBackSetCallbackConvClient aCallBackClient; + + @Test + public void testCallBackSetCallback() { + aCallBackClient.run(); + } + + @Before + public void setUp() throws Exception { + String location = ContributionLocationHelper.getContributionLocation("CallBackSetCallbackConvTest.composite"); + node = NodeFactory.newInstance().createNode("CallBackSetCallbackConvTest.composite", new Contribution("c1", location)); + node.start(); + aCallBackClient = node.getService(CallBackSetCallbackConvClient.class, "CallBackSetCallbackConvClient"); + } + + @After + public void tearDown() throws Exception { + node.stop(); + } + +} -- cgit v1.2.3