From 743364ae6439cfc68e1eae795fc2065a9c148240 Mon Sep 17 00:00:00 2001 From: antelder Date: Thu, 19 Mar 2009 09:20:17 +0000 Subject: Delete old test tag git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@755884 13f79535-47bb-0310-9956-ffa450edef68 --- .../vtest/java-api/apis/callablereference/pom.xml | 45 ----- .../javaapi/apis/callablereference/AComponent.java | 38 ---- .../javaapi/apis/callablereference/BCallback.java | 26 --- .../javaapi/apis/callablereference/BComponent.java | 38 ---- .../callablereference/impl/AComponentImpl.java | 104 ----------- .../callablereference/impl/BComponentImpl.java | 70 -------- .../src/main/resources/callablereference.composite | 34 ---- .../CallableReferenceTestCase.java | 118 ------------- .../vtest/java-api/apis/componentcontext/pom.xml | 45 ----- .../javaapi/apis/componentcontext/AComponent.java | 42 ----- .../javaapi/apis/componentcontext/BComponent.java | 29 ---- .../javaapi/apis/componentcontext/BService.java | 34 ---- .../javaapi/apis/componentcontext/CService.java | 29 ---- .../javaapi/apis/componentcontext/DComponent.java | 29 ---- .../apis/componentcontext/impl/AComponentImpl.java | 124 ------------- .../impl/AUnannotatedComponentImpl.java | 121 ------------- .../apis/componentcontext/impl/BComponentImpl.java | 52 ------ .../apis/componentcontext/impl/DComponentImpl.java | 32 ---- .../src/main/resources/ab.composite | 47 ----- .../componentcontext/ComponentContextTestCase.java | 191 --------------------- .../vtest/java-api/apis/conversation/pom.xml | 45 ----- .../javaapi/apis/conversation/AComponent.java | 34 ---- .../javaapi/apis/conversation/BComponent.java | 39 ----- .../apis/conversation/impl/AComponentImpl.java | 73 -------- .../apis/conversation/impl/BComponentImpl.java | 78 --------- .../src/main/resources/conversation.composite | 34 ---- .../apis/conversation/ConversationTestCase.java | 70 -------- .../2.0-M2/vtest/java-api/apis/exception/pom.xml | 45 ----- .../vtest/javaapi/apis/exception/AComponent.java | 40 ----- .../vtest/javaapi/apis/exception/BCallback.java | 26 --- .../vtest/javaapi/apis/exception/BComponent.java | 35 ---- .../vtest/javaapi/apis/exception/CComponent.java | 34 ---- .../vtest/javaapi/apis/exception/DComponent.java | 33 ---- .../vtest/javaapi/apis/exception/DException.java | 30 ---- .../apis/exception/impl/AComponentImpl.java | 128 -------------- .../apis/exception/impl/BComponentImpl.java | 64 ------- .../apis/exception/impl/CComponentImpl.java | 50 ------ .../apis/exception/impl/DComponentImpl.java | 37 ---- .../src/main/resources/exception.composite | 44 ----- .../javaapi/apis/exception/ExceptionTestCase.java | 132 -------------- .../sca/tags/2.0-M2/vtest/java-api/apis/pom.xml | 64 ------- .../vtest/java-api/apis/requestcontext/pom.xml | 45 ----- .../javaapi/apis/requestcontext/AComponent.java | 35 ---- .../javaapi/apis/requestcontext/BCallback.java | 27 --- .../javaapi/apis/requestcontext/BComponent.java | 35 ---- .../apis/requestcontext/impl/AComponentImpl.java | 102 ----------- .../apis/requestcontext/impl/BComponentImpl.java | 61 ------- .../src/main/resources/requestcontext.composite | 34 ---- .../requestcontext/RequestContextTestCase.java | 109 ------------ .../vtest/java-api/apis/servicereference/pom.xml | 45 ----- .../javaapi/apis/servicereference/AComponent.java | 37 ---- .../javaapi/apis/servicereference/BCallback.java | 26 --- .../javaapi/apis/servicereference/BComponent.java | 38 ---- .../javaapi/apis/servicereference/CComponent.java | 27 --- .../apis/servicereference/impl/AComponentImpl.java | 119 ------------- .../apis/servicereference/impl/BComponentImpl.java | 74 -------- .../apis/servicereference/impl/CComponentImpl.java | 38 ---- .../apis/servicereference/impl/TestObject.java | 37 ---- .../src/main/resources/servicereference.composite | 39 ----- .../servicereference/ServiceReferenceTestCase.java | 106 ------------ 60 files changed, 3417 deletions(-) delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/callablereference/pom.xml delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/callablereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/AComponent.java delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/callablereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/BCallback.java delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/callablereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/BComponent.java delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/callablereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/impl/AComponentImpl.java delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/callablereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/impl/BComponentImpl.java delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/callablereference/src/main/resources/callablereference.composite delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/callablereference/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/CallableReferenceTestCase.java delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/componentcontext/pom.xml delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/AComponent.java delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/BComponent.java delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/BService.java delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/CService.java delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/DComponent.java delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/AComponentImpl.java delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/AUnannotatedComponentImpl.java delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/BComponentImpl.java delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/DComponentImpl.java delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/componentcontext/src/main/resources/ab.composite delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/componentcontext/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/ComponentContextTestCase.java delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/conversation/pom.xml delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/conversation/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/conversation/AComponent.java delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/conversation/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/conversation/BComponent.java delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/conversation/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/conversation/impl/AComponentImpl.java delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/conversation/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/conversation/impl/BComponentImpl.java delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/conversation/src/main/resources/conversation.composite delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/conversation/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/conversation/ConversationTestCase.java delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/exception/pom.xml delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/AComponent.java delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/BCallback.java delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/BComponent.java delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/CComponent.java delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/DComponent.java delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/DException.java delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/impl/AComponentImpl.java delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/impl/BComponentImpl.java delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/impl/CComponentImpl.java delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/impl/DComponentImpl.java delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/exception/src/main/resources/exception.composite delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/exception/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/ExceptionTestCase.java delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/pom.xml delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/requestcontext/pom.xml delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/requestcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/AComponent.java delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/requestcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/BCallback.java delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/requestcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/BComponent.java delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/requestcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/impl/AComponentImpl.java delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/requestcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/impl/BComponentImpl.java delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/requestcontext/src/main/resources/requestcontext.composite delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/requestcontext/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/RequestContextTestCase.java delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/servicereference/pom.xml delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/AComponent.java delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/BCallback.java delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/BComponent.java delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/CComponent.java delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/impl/AComponentImpl.java delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/impl/BComponentImpl.java delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/impl/CComponentImpl.java delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/impl/TestObject.java delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/servicereference/src/main/resources/servicereference.composite delete mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/servicereference/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/ServiceReferenceTestCase.java (limited to 'sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis') diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/callablereference/pom.xml b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/callablereference/pom.xml deleted file mode 100644 index f5d79a338a..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/callablereference/pom.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - java-api-apis - 2.0-M2-SNAPSHOT - ../pom.xml - - vtest-java-api-apis-callablereference - Apache Tuscany SCA Java APIs and Annotations Verification Tests - APIs - CallableReference - - - - org.apache.tuscany.sca - tuscany-host-embedded - 2.0-M2-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-implementation-java-runtime - 2.0-M2-SNAPSHOT - runtime - - - diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/callablereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/AComponent.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/callablereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/AComponent.java deleted file mode 100644 index a7040f944e..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/callablereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/AComponent.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.vtest.javaapi.apis.callablereference; - -import org.oasisopen.sca.annotation.Conversational; - -/** - * Simple Service A. - */ -@Conversational -public interface AComponent { - - public String getName(); - - public String getServiceName(); - public String getBusinessInterfaceName(); - public boolean isConversational(); - public void testConversationID(); - public String getCallbackResult(); - -} diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/callablereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/BCallback.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/callablereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/BCallback.java deleted file mode 100644 index 707568e507..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/callablereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/BCallback.java +++ /dev/null @@ -1,26 +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.vtest.javaapi.apis.callablereference; - -public interface BCallback { - - public void processResults(String result); - -} diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/callablereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/BComponent.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/callablereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/BComponent.java deleted file mode 100644 index 18fcaee6ee..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/callablereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/BComponent.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.vtest.javaapi.apis.callablereference; - -import org.oasisopen.sca.annotation.Callback; -import org.oasisopen.sca.annotation.Conversational; - -/** - * Simple Service B. - */ -@Conversational -@Callback(BCallback.class) -public interface BComponent { - - public String getName(); - - public void testCallback(); - public void testConversationID(); - public void testNonNullConversation(); - -} diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/callablereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/impl/AComponentImpl.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/callablereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/impl/AComponentImpl.java deleted file mode 100644 index 70a257d19f..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/callablereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/impl/AComponentImpl.java +++ /dev/null @@ -1,104 +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.vtest.javaapi.apis.callablereference.impl; - -import org.apache.tuscany.sca.vtest.javaapi.apis.callablereference.AComponent; -import org.apache.tuscany.sca.vtest.javaapi.apis.callablereference.BCallback; -import org.apache.tuscany.sca.vtest.javaapi.apis.callablereference.BComponent; -import org.junit.Assert; -import org.oasisopen.sca.CallableReference; -import org.oasisopen.sca.ComponentContext; -import org.oasisopen.sca.ServiceReference; -import org.oasisopen.sca.annotation.Context; -import org.oasisopen.sca.annotation.ConversationID; -import org.oasisopen.sca.annotation.Reference; -import org.oasisopen.sca.annotation.Scope; -import org.oasisopen.sca.annotation.Service; - -@Service(AComponent.class) -@Scope("CONVERSATION") -public class AComponentImpl implements AComponent, BCallback { - - private static Object monitor = new Object(); - private static String returnMessage = null; - - protected ComponentContext componentContext; - - @Reference - protected CallableReference bReference; - - @ConversationID - protected String cid; - - public String getName() { - return "ComponentA"; - } - - @Context - public void setComponentContext(ComponentContext context) { - this.componentContext = context; - } - - public String getServiceName() { - return bReference.getService().getName(); - } - - public String getBusinessInterfaceName() { - return bReference.getBusinessInterface().getSimpleName(); - } - - public boolean isConversational() { - return bReference.isConversational(); - } - - public void testConversationID() { - ServiceReference bSR = componentContext.getServiceReference(BComponent.class, "bReference"); - bSR.setConversationID("AConversationID"); - bSR.getService().testConversationID(); - - Assert.assertEquals("AConversationID", bSR.getConversation().getConversationID()); - } - - public String getCallbackResult() { - ServiceReference bSR = componentContext.getServiceReference(BComponent.class, "bReference"); - String cbID = "ComponentACallBack"; - bSR.setCallbackID(cbID); - bSR.getService().testCallback(); - - // Wait for 30s max. - int count = 0; - synchronized(monitor) { - while (returnMessage == null && count++ < 30) { - try { - monitor.wait(1000L); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - } - - return returnMessage; - } - - public void processResults(String result) { - returnMessage = result; - } - -} diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/callablereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/impl/BComponentImpl.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/callablereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/impl/BComponentImpl.java deleted file mode 100644 index ea4c71d27a..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/callablereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/impl/BComponentImpl.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.vtest.javaapi.apis.callablereference.impl; - -import org.apache.tuscany.sca.vtest.javaapi.apis.callablereference.BCallback; -import org.apache.tuscany.sca.vtest.javaapi.apis.callablereference.BComponent; -import org.junit.Assert; -import org.oasisopen.sca.CallableReference; -import org.oasisopen.sca.ComponentContext; -import org.oasisopen.sca.annotation.Callback; -import org.oasisopen.sca.annotation.Context; -import org.oasisopen.sca.annotation.ConversationID; -import org.oasisopen.sca.annotation.Scope; -import org.oasisopen.sca.annotation.Service; - -@Service(BComponent.class) -@Scope("CONVERSATION") -public class BComponentImpl implements BComponent { - - protected ComponentContext componentContext; - - @Callback - protected BCallback callback; - - @ConversationID - protected String cid; - - @Context - public void setComponentContext(ComponentContext context) { - this.componentContext = context; - } - - public String getName() { - return "ComponentB"; - } - - public void testCallback() { - callback = componentContext.getRequestContext().getCallback(); - callback.processResults("CallBackFromB"); - - CallableReference bCR = componentContext.getRequestContext().getCallbackReference(); - Assert.assertEquals("ComponentACallBack", bCR.getCallbackID()); - } - - public void testConversationID() { - Assert.assertEquals("AConversationID", cid); - } - - public void testNonNullConversation() { - Assert.assertNotNull(componentContext.getRequestContext().getServiceReference().getConversation()); - } - -} diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/callablereference/src/main/resources/callablereference.composite b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/callablereference/src/main/resources/callablereference.composite deleted file mode 100644 index f997d78bb5..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/callablereference/src/main/resources/callablereference.composite +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/callablereference/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/CallableReferenceTestCase.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/callablereference/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/CallableReferenceTestCase.java deleted file mode 100644 index 4d0d8338ba..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/callablereference/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/CallableReferenceTestCase.java +++ /dev/null @@ -1,118 +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.vtest.javaapi.apis.callablereference; - -import org.apache.tuscany.sca.vtest.utilities.ServiceFinder; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * This test class tests the CallableReference interface described in 1.7.3 of - * the SCA Java Annotations & APIs Specification 1.0. - */ -public class CallableReferenceTestCase { - - protected static String compositeName = "callablereference.composite"; - protected static AComponent a; - protected static BComponent b; - - @BeforeClass - public static void init() throws Exception { - try { - System.out.println("Setting up"); - ServiceFinder.init(compositeName); - a = ServiceFinder.getService(AComponent.class, "AComponent"); - b = ServiceFinder.getService(BComponent.class, "BComponent"); - } catch (Exception e) { - e.printStackTrace(); - } - } - - @AfterClass - public static void destroy() throws Exception { - System.out.println("Cleaning up"); - ServiceFinder.cleanup(); - } - - /** - * Lines 884
- * getService() - Returns a type-safe reference to the target of this - * reference. The instance returned is guaranteed to implement the business - * interface for this reference. The value returned is a proxy to the target - * that implements the business interface associated with this reference. - * - * @throws Exception - */ - @Test - public void testGetService() throws Exception { - Assert.assertEquals("ComponentB", a.getServiceName()); - } - - /** - * Lines 885
- * getBusinessInterface() – Returns the Java class for the business - * interface associated with this reference. - * - * @throws Exception - */ - @Test - public void testGetBusinessInterface() throws Exception { - Assert.assertEquals("BComponent", a.getBusinessInterfaceName()); - } - - /** - * Lines 886
- * isConversational() – Returns true if this reference is conversational. - * - * @throws Exception - */ - @Test - public void testIsConversational() throws Exception { - Assert.assertEquals(true, a.isConversational()); - } - - /** - * Lines 887
- * getConversation() – Returns the conversation associated with this - * reference. Returns null if no conversation is currently active. - * - * @throws Exception - */ - @Test - public void testGetConversation() throws Exception { - a.testConversationID(); - b.testNonNullConversation(); - } - - /** - * Lines 888
- * getCallbackID() – Returns the callback ID. - * - * @throws Exception - */ - @Test - public void testGetCallbackID() throws Exception { - // Actual test is in BComponentImpl. Below is an extra test. - Assert.assertEquals("CallBackFromB", a.getCallbackResult()); - } - -} diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/componentcontext/pom.xml b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/componentcontext/pom.xml deleted file mode 100644 index 2a73476678..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/componentcontext/pom.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - java-api-apis - 2.0-M2-SNAPSHOT - ../pom.xml - - vtest-java-api-apis-componentcontext - Apache Tuscany SCA Java APIs and Annotations Verification Tests - APIs - ComponentContext - - - - org.apache.tuscany.sca - tuscany-host-embedded - 2.0-M2-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-implementation-java-runtime - 2.0-M2-SNAPSHOT - runtime - - - diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/AComponent.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/AComponent.java deleted file mode 100644 index b2c8c07866..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/AComponent.java +++ /dev/null @@ -1,42 +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.vtest.javaapi.apis.componentcontext; - -/** - * Simple Service A. - */ -public interface AComponent { - - public String getName(); - - public String getContextURI(); - public String getServiceBName(); - public String getServiceReferenceBName(); - public String getSelfReferenceName(); - public String getProperty(); - public String getRequestContextServiceName(); - public String getCastCallableReferenceServiceName(); - public String getCastServiceReferenceServiceName(); - public void illegalCast(); - - public String testServiceLookup(); - public String getRequestContextContent(); - -} diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/BComponent.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/BComponent.java deleted file mode 100644 index 7e425c740f..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/BComponent.java +++ /dev/null @@ -1,29 +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.vtest.javaapi.apis.componentcontext; - -/** - * Simple Service B. - */ -public interface BComponent { - - String getName(); - -} diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/BService.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/BService.java deleted file mode 100644 index d7799bb3aa..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/BService.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.vtest.javaapi.apis.componentcontext; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * Simple Service B. - */ -@Remotable -public interface BService { - - String getBName(); - - String getSelfReferenceWithServiceName(); - -} diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/CService.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/CService.java deleted file mode 100644 index d0da012f6f..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/CService.java +++ /dev/null @@ -1,29 +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.vtest.javaapi.apis.componentcontext; - -/** - * Simple Service C. - */ -public interface CService { - - String getCName(); - -} diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/DComponent.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/DComponent.java deleted file mode 100644 index 079d859f74..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/DComponent.java +++ /dev/null @@ -1,29 +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.vtest.javaapi.apis.componentcontext; - -import org.oasisopen.sca.annotation.Remotable; - -@Remotable -public interface DComponent { - - public String getName(); - -} diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/AComponentImpl.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/AComponentImpl.java deleted file mode 100644 index 06a71c29ac..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/AComponentImpl.java +++ /dev/null @@ -1,124 +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.vtest.javaapi.apis.componentcontext.impl; - -import org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext.AComponent; -import org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext.BService; -import org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext.DComponent; -import org.oasisopen.sca.CallableReference; -import org.oasisopen.sca.ComponentContext; -import org.oasisopen.sca.RequestContext; -import org.oasisopen.sca.ServiceReference; -import org.oasisopen.sca.annotation.Context; -import org.oasisopen.sca.annotation.EagerInit; -import org.oasisopen.sca.annotation.Init; -import org.oasisopen.sca.annotation.Property; -import org.oasisopen.sca.annotation.Reference; -import org.oasisopen.sca.annotation.Scope; -import org.oasisopen.sca.annotation.Service; - -@Service(AComponent.class) -@Scope("COMPOSITE") -@EagerInit -public class AComponentImpl implements AComponent { - - public static String rcContent = null; - - protected ComponentContext componentContext; - - @Reference - protected BService bReference; - - @Reference - protected DComponent dReference; - - @Property(name="aProperty", required=true) - protected String aProperty; - - public String getName() { - return "ComponentA"; - } - - @Context - public void setComponentContext(ComponentContext context) { - this.componentContext = context; - } - - @Init - public void init() { - RequestContext rc = componentContext.getRequestContext(); - if (rc != null) { - rcContent = "NotNull"; - } else { - rcContent = "Null"; - } - } - - public String getContextURI() { - return componentContext.getURI(); - } - - public String getServiceBName() { - return componentContext.getService(BService.class, "bReference").getBName(); - } - - public String getServiceReferenceBName() { - ServiceReference bSR = componentContext.getServiceReference(BService.class, "bReference"); - return bSR.getService().getBName(); - } - - public String getSelfReferenceName() { - ServiceReference aSR = componentContext.createSelfReference(AComponent.class); - return aSR.getService().getName(); - } - - public String getProperty() { - return componentContext.getProperty(String.class, "aProperty"); - } - - public String getRequestContextServiceName() { - return componentContext.getRequestContext().getServiceName(); - } - - public String getCastCallableReferenceServiceName() { - BService b = componentContext.getService(BService.class, "bReference"); - CallableReference bCR = componentContext.cast(b); - return bCR.getService().getBName(); - } - - public String getCastServiceReferenceServiceName() { - BService b = componentContext.getService(BService.class, "bReference"); - ServiceReference bSR = componentContext.cast(b); - return bSR.getService().getBName(); - } - - public void illegalCast() { - componentContext.cast(""); - } - - public String testServiceLookup() { - return componentContext.getService(DComponent.class, "dReference").getName(); - } - - public String getRequestContextContent() { - return rcContent; - } - -} diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/AUnannotatedComponentImpl.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/AUnannotatedComponentImpl.java deleted file mode 100644 index e508687965..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/AUnannotatedComponentImpl.java +++ /dev/null @@ -1,121 +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.vtest.javaapi.apis.componentcontext.impl; - -import org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext.AComponent; -import org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext.BService; -import org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext.DComponent; -import org.oasisopen.sca.CallableReference; -import org.oasisopen.sca.ComponentContext; -import org.oasisopen.sca.RequestContext; -import org.oasisopen.sca.ServiceReference; -import org.oasisopen.sca.annotation.Context; -import org.oasisopen.sca.annotation.EagerInit; -import org.oasisopen.sca.annotation.Init; -import org.oasisopen.sca.annotation.Property; -import org.oasisopen.sca.annotation.Reference; -import org.oasisopen.sca.annotation.Scope; -import org.oasisopen.sca.annotation.Service; - -@Service(AComponent.class) -@Scope("COMPOSITE") -@EagerInit -public class AUnannotatedComponentImpl implements AComponent { - - public static String rcContent = null; - - protected ComponentContext componentContext; - - protected BService bReference; - - protected DComponent dReference; - - protected String aProperty; - - public String getName() { - return "ComponentA"; - } - - @Context - public void setComponentContext(ComponentContext context) { - this.componentContext = context; - } - - @Init - public void init() { - RequestContext rc = componentContext.getRequestContext(); - if (rc != null) { - rcContent = "NotNull"; - } else { - rcContent = "Null"; - } - } - - public String getContextURI() { - return componentContext.getURI(); - } - - public String getServiceBName() { - return componentContext.getService(BService.class, "bReference").getBName(); - } - - public String getServiceReferenceBName() { - ServiceReference bSR = componentContext.getServiceReference(BService.class, "bReference"); - return bSR.getService().getBName(); - } - - public String getSelfReferenceName() { - ServiceReference aSR = componentContext.createSelfReference(AComponent.class); - return aSR.getService().getName(); - } - - public String getProperty() { - return componentContext.getProperty(String.class, "aProperty"); - } - - public String getRequestContextServiceName() { - return componentContext.getRequestContext().getServiceName(); - } - - public String getCastCallableReferenceServiceName() { - BService b = componentContext.getService(BService.class, "bReference"); - CallableReference bCR = componentContext.cast(b); - return bCR.getService().getBName(); - } - - public String getCastServiceReferenceServiceName() { - BService b = componentContext.getService(BService.class, "bReference"); - ServiceReference bSR = componentContext.cast(b); - return bSR.getService().getBName(); - } - - public void illegalCast() { - componentContext.cast(""); - } - - public String testServiceLookup() { - return componentContext.getService(DComponent.class, "dReference").getName(); - } - - public String getRequestContextContent() { - return rcContent; - } - -} diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/BComponentImpl.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/BComponentImpl.java deleted file mode 100644 index 157864fd27..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/BComponentImpl.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.vtest.javaapi.apis.componentcontext.impl; - -import org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext.BService; -import org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext.CService; -import org.oasisopen.sca.ComponentContext; -import org.oasisopen.sca.ServiceReference; -import org.oasisopen.sca.annotation.Context; -import org.oasisopen.sca.annotation.Service; - -@Service(interfaces={BService.class, CService.class}) -public class BComponentImpl implements BService, CService { - - protected ComponentContext componentContext; - - @Context - public void setComponentContext(ComponentContext context) { - this.componentContext = context; - } - - public String getBName() { - return "ServiceB"; - } - - public String getCName() { - return "ServiceC"; - } - - public String getSelfReferenceWithServiceName() { - ServiceReference cSR = componentContext.createSelfReference(CService.class, "CService"); - return cSR.getService().getCName(); - } - -} diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/DComponentImpl.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/DComponentImpl.java deleted file mode 100644 index 9432c70ff3..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/DComponentImpl.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.vtest.javaapi.apis.componentcontext.impl; - -import org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext.DComponent; -import org.oasisopen.sca.annotation.Service; - -@Service(DComponent.class) -public class DComponentImpl implements DComponent { - - public String getName() { - return "ComponentD"; - } - -} diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/componentcontext/src/main/resources/ab.composite b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/componentcontext/src/main/resources/ab.composite deleted file mode 100644 index 19f110d5dc..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/componentcontext/src/main/resources/ab.composite +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - PropertyA - - - - - - - PropertyA - - - - - - - - - - - diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/componentcontext/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/ComponentContextTestCase.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/componentcontext/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/ComponentContextTestCase.java deleted file mode 100644 index e9352a5c06..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/componentcontext/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/ComponentContextTestCase.java +++ /dev/null @@ -1,191 +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.vtest.javaapi.apis.componentcontext; - -import org.apache.tuscany.sca.vtest.utilities.ServiceFinder; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Ignore; -import org.junit.Test; - -import org.oasisopen.sca.ServiceRuntimeException; - -/** - * This test class tests the ComponentContext interface described in 1.7.1 of - * the SCA Java Annotations & APIs Specification 1.0. Relevant sections of 1.4 - * will also be covered here. - */ -public class ComponentContextTestCase { - - protected static String compositeName = "ab.composite"; - protected static AComponent a; - protected static AComponent aUnannotated; - protected static BService b; - - @BeforeClass - public static void init() throws Exception { - try { - System.out.println("Setting up"); - ServiceFinder.init(compositeName); - a = ServiceFinder.getService(AComponent.class, "AComponent"); - aUnannotated = ServiceFinder.getService(AComponent.class, "AUnannotatedComponent"); - b = ServiceFinder.getService(BService.class, "BComponent/BService"); - } catch (Exception e) { - e.printStackTrace(); - } - } - - @AfterClass - public static void destroy() throws Exception { - System.out.println("Cleaning up"); - ServiceFinder.cleanup(); - } - - /** - * Lines 776
- * getURI() - Returns the absolute URI of the component within the SCA - * domain. - * - * @throws Exception - */ - @Test - public void testGetURI() throws Exception { - Assert.assertEquals("AComponent", a.getContextURI()); - Assert.assertEquals("AUnannotatedComponent", aUnannotated.getContextURI()); - } - - /** - * Lines 778
- * getService(Class<B> businessInterface, String referenceName) ? - * Returns a proxy for the reference defined by the current component. - * - * @throws Exception - */ - @Test - public void testGetService() throws Exception { - Assert.assertEquals(a.getServiceBName(), "ServiceB"); - } - - /** - * Lines 780
- * getServiceReference(Class<B> businessInterface, String - * referenceName) ? Returns a ServiceReference defined by the current - * component. - * - * @throws Exception - */ - @Test - public void testGetServiceReference() throws Exception { - Assert.assertEquals(a.getServiceReferenceBName(), "ServiceB"); - } - - /** - * Lines 783
- * createSelfReference(Class<B> businessInterface) ? Returns a - * ServiceReference that can be used to invoke this component over the - * designated service. - * - * @throws Exception - */ - @Test - public void testCreateSelfReference() throws Exception { - Assert.assertEquals(a.getSelfReferenceName(), "ComponentA"); - } - - /** - * Lines 785
- * getSelfReference(Class<B> businessInterface, String serviceName) - - * Returns a ServiceReference that can be used to invoke this component over - * the designated service. Service name explicitly declares the service name - * to invoke. - * - * @throws Exception - */ - @Test - public void testCreateSelfReferenceWithServiceName() throws Exception { - Assert.assertEquals("ServiceC", b.getSelfReferenceWithServiceName()); - } - - /** - * Lines 788
- * getProperty (Class<B> type, String propertyName) - Returns the - * value of an SCA property defined by this component. - * - * @throws Exception - */ - @Test - public void testGetProperty() throws Exception { - Assert.assertEquals("PropertyA", a.getProperty()); - } - - /** - * Lines 793
- * getRequestContext() - Returns the context for the current SCA service - * request, or null if there is no current request or if the context is - * unavailable. - * - * @throws Exception - */ - @Test - public void testGetRequestContext() throws Exception { - Assert.assertEquals("AComponent", a.getRequestContextServiceName()); - Assert.assertEquals("NotNull", a.getRequestContextContent()); - } - - /** - * Lines 790,794
- * cast(B target) - Casts a type-safe reference to a CallableReference. - * - * @throws Exception - */ - @Test - public void testCast() throws Exception { - Assert.assertEquals("ServiceB", a.getCastCallableReferenceServiceName()); - Assert.assertEquals("ServiceB", a.getCastServiceReferenceServiceName()); - - String check = ""; - try { - a.illegalCast(); - } catch (IllegalArgumentException iae) { - check = "IllegalCast"; - } catch (ServiceRuntimeException sre) { - if (sre.getCause() instanceof IllegalArgumentException) { - check = "IllegalCast"; - } - } - Assert.assertEquals("IllegalCast", check); - } - - /** - * Lines 342-344
- * When a component implementation needs access to a service where the - * reference to the service is not known at compile time, the reference can - * be located using the component?s ComponentContext. - * - * @throws Exception - */ - @Test - @Ignore("TUSCANY-2609") - public void testServiceLookup() throws Exception { - Assert.assertEquals("ComponentD", a.testServiceLookup()); - } - -} diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/conversation/pom.xml b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/conversation/pom.xml deleted file mode 100644 index 4c73729040..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/conversation/pom.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - java-api-apis - 2.0-M2-SNAPSHOT - ../pom.xml - - vtest-java-api-apis-conversation - Apache Tuscany SCA Java APIs and Annotations Verification Tests - APIs - Conversation - - - - org.apache.tuscany.sca - tuscany-host-embedded - 2.0-M2-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-implementation-java-runtime - 2.0-M2-SNAPSHOT - runtime - - - diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/conversation/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/conversation/AComponent.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/conversation/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/conversation/AComponent.java deleted file mode 100644 index 845c10303e..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/conversation/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/conversation/AComponent.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.vtest.javaapi.apis.conversation; - -import org.oasisopen.sca.annotation.Conversational; - -/** - * Simple Service A. - */ -@Conversational -public interface AComponent { - - public String getName(); - - public void testConversation(); - -} diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/conversation/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/conversation/BComponent.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/conversation/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/conversation/BComponent.java deleted file mode 100644 index a3148aa0d7..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/conversation/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/conversation/BComponent.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.vtest.javaapi.apis.conversation; - -import org.oasisopen.sca.annotation.Conversational; -import org.oasisopen.sca.annotation.EndsConversation; - -/** - * Simple Service B. - */ -@Conversational -public interface BComponent { - - public String getName(); - - public void testCustomConversationID(); - public void testGeneratedConversationID(Object id); - - @EndsConversation - public void endsConversation(); - -} diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/conversation/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/conversation/impl/AComponentImpl.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/conversation/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/conversation/impl/AComponentImpl.java deleted file mode 100644 index 7160121388..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/conversation/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/conversation/impl/AComponentImpl.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.vtest.javaapi.apis.conversation.impl; - -import org.apache.tuscany.sca.vtest.javaapi.apis.conversation.AComponent; -import org.apache.tuscany.sca.vtest.javaapi.apis.conversation.BComponent; -import org.junit.Assert; -import org.oasisopen.sca.CallableReference; -import org.oasisopen.sca.ComponentContext; -import org.oasisopen.sca.Conversation; -import org.oasisopen.sca.ServiceReference; -import org.oasisopen.sca.annotation.Context; -import org.oasisopen.sca.annotation.ConversationID; -import org.oasisopen.sca.annotation.Reference; -import org.oasisopen.sca.annotation.Scope; -import org.oasisopen.sca.annotation.Service; - -@Service(AComponent.class) -@Scope("CONVERSATION") -public class AComponentImpl implements AComponent { - - protected ComponentContext componentContext; - - @Reference - protected CallableReference bReference; - - @ConversationID - protected String cid; - - public String getName() { - return "ComponentA"; - } - - @Context - public void setComponentContext(ComponentContext context) { - this.componentContext = context; - } - - public void testConversation() { - ServiceReference bSR = componentContext.getServiceReference(BComponent.class, "bReference"); - bSR.setConversationID("AConversationID"); - bSR.getService().testCustomConversationID(); - - Conversation bc = bSR.getConversation(); - Assert.assertEquals("AConversationID", bc.getConversationID()); - bc.end(); - - Assert.assertEquals("ComponentB", bReference.getService().getName()); - bReference.getService().testGeneratedConversationID(bReference.getConversation().getConversationID()); - bReference.getConversation().end(); - - Assert.assertEquals(1, BComponentImpl.customInitCount); - Assert.assertEquals(1, BComponentImpl.customDestroyCount); - } - -} diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/conversation/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/conversation/impl/BComponentImpl.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/conversation/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/conversation/impl/BComponentImpl.java deleted file mode 100644 index c487559ca1..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/conversation/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/conversation/impl/BComponentImpl.java +++ /dev/null @@ -1,78 +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.vtest.javaapi.apis.conversation.impl; - -import org.apache.tuscany.sca.vtest.javaapi.apis.conversation.BComponent; -import org.junit.Assert; -import org.oasisopen.sca.ComponentContext; -import org.oasisopen.sca.annotation.Context; -import org.oasisopen.sca.annotation.ConversationID; -import org.oasisopen.sca.annotation.Destroy; -import org.oasisopen.sca.annotation.Init; -import org.oasisopen.sca.annotation.Scope; -import org.oasisopen.sca.annotation.Service; - -@Service(BComponent.class) -@Scope("CONVERSATION") -public class BComponentImpl implements BComponent { - - public static int customInitCount = 0; - public static int customDestroyCount = 0; - - protected ComponentContext componentContext; - - @ConversationID - protected String cid; - - @Context - public void setComponentContext(ComponentContext context) { - this.componentContext = context; - } - - public String getName() { - return "ComponentB"; - } - - public void testCustomConversationID() { - Assert.assertEquals("AConversationID", cid); - } - - public void testGeneratedConversationID(Object id) { - Assert.assertEquals(id.toString(), cid); - } - - public void endsConversation() { - } - - @Init - public void initB() { - if (cid.equals("AConversationID")) { - customInitCount++; - } - } - - @Destroy - public void destroyB() { - if (cid.equals("AConversationID")) { - customDestroyCount++; - } - } - -} diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/conversation/src/main/resources/conversation.composite b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/conversation/src/main/resources/conversation.composite deleted file mode 100644 index 87cab2f479..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/conversation/src/main/resources/conversation.composite +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/conversation/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/conversation/ConversationTestCase.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/conversation/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/conversation/ConversationTestCase.java deleted file mode 100644 index 9b46ac5e08..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/conversation/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/conversation/ConversationTestCase.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.vtest.javaapi.apis.conversation; - -import org.apache.tuscany.sca.vtest.utilities.ServiceFinder; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * This test class tests the Conversation interface described in 1.7.5 of the - * SCA Java Annotations & APIs Specification 1.0. - */ -public class ConversationTestCase { - - protected static String compositeName = "conversation.composite"; - protected static AComponent a; - protected static BComponent b; - - @BeforeClass - public static void init() throws Exception { - try { - System.out.println("Setting up"); - ServiceFinder.init(compositeName); - a = ServiceFinder.getService(AComponent.class, "AComponent"); - b = ServiceFinder.getService(BComponent.class, "BComponent"); - } catch (Exception e) { - e.printStackTrace(); - } - } - - @AfterClass - public static void destroy() throws Exception { - System.out.println("Cleaning up"); - ServiceFinder.cleanup(); - } - - /** - * Lines 941, 942
- * getConversationID() – Returns the identifier for this conversation. If a - * user-defined identity had been supplied for this reference then its value - * will be returned; otherwise the identity generated by the system when the - * conversation was initiated will be returned.
- * end() – Ends this conversation. - * - * @throws Exception - */ - @Test - public void testConversation() throws Exception { - a.testConversation(); - } - -} diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/exception/pom.xml b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/exception/pom.xml deleted file mode 100644 index 111af59738..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/exception/pom.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - java-api-apis - 2.0-M2-SNAPSHOT - ../pom.xml - - vtest-java-api-apis-exception - Apache Tuscany SCA Java APIs and Annotations Verification Tests - APIs - Exception - - - - org.apache.tuscany.sca - tuscany-host-embedded - 2.0-M2-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-implementation-java-runtime - 2.0-M2-SNAPSHOT - runtime - - - diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/AComponent.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/AComponent.java deleted file mode 100644 index 90582e88a2..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/AComponent.java +++ /dev/null @@ -1,40 +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.vtest.javaapi.apis.exception; - -import org.oasisopen.sca.annotation.Conversational; - -/** - * Simple Service A. - */ -@Conversational -public interface AComponent { - - public String getName(); - - public void testConversation(); - public void testCallBack(); - - public boolean testServiceRuntimeException(); - public boolean testServiceUnavailableException(); - - public boolean testCheckedException(); - -} diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/BCallback.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/BCallback.java deleted file mode 100644 index c1c1c6544c..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/BCallback.java +++ /dev/null @@ -1,26 +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.vtest.javaapi.apis.exception; - -public interface BCallback { - - public void processResults(String result); - -} diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/BComponent.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/BComponent.java deleted file mode 100644 index 11886277ad..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/BComponent.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.vtest.javaapi.apis.exception; - -import org.oasisopen.sca.annotation.Callback; - -/** - * Simple Service B. - */ -@Callback(BCallback.class) -public interface BComponent { - - public String getName(); - - public void testCallback(); - public void testRedirectedCallback(); - -} diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/CComponent.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/CComponent.java deleted file mode 100644 index 466a32731a..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/CComponent.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.vtest.javaapi.apis.exception; - -import org.oasisopen.sca.annotation.Conversational; - -/** - * Simple Service C. - */ -@Conversational -public interface CComponent { - - public String getName(); - - public void testConversation(); - -} diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/DComponent.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/DComponent.java deleted file mode 100644 index c0aed7a707..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/DComponent.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.vtest.javaapi.apis.exception; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * Simple Remote Service D. - */ -@Remotable -public interface DComponent { - - public String getName(); - public void testException() throws DException; - -} diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/DException.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/DException.java deleted file mode 100644 index 82873ed96d..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/DException.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.vtest.javaapi.apis.exception; - -public class DException extends Exception { - - private static final long serialVersionUID = -3819913841563109423L; - - public DException(String message) { - super(message); - } - -} diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/impl/AComponentImpl.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/impl/AComponentImpl.java deleted file mode 100644 index 1190e6900f..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/impl/AComponentImpl.java +++ /dev/null @@ -1,128 +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.vtest.javaapi.apis.exception.impl; - -import org.apache.tuscany.sca.vtest.javaapi.apis.exception.AComponent; -import org.apache.tuscany.sca.vtest.javaapi.apis.exception.BComponent; -import org.apache.tuscany.sca.vtest.javaapi.apis.exception.CComponent; -import org.apache.tuscany.sca.vtest.javaapi.apis.exception.DComponent; -import org.apache.tuscany.sca.vtest.javaapi.apis.exception.DException; -import org.junit.Assert; -import org.oasisopen.sca.CallableReference; -import org.oasisopen.sca.ComponentContext; -import org.oasisopen.sca.ConversationEndedException; -import org.oasisopen.sca.NoRegisteredCallbackException; -import org.oasisopen.sca.ServiceReference; -import org.oasisopen.sca.ServiceRuntimeException; -import org.oasisopen.sca.annotation.Context; -import org.oasisopen.sca.annotation.ConversationID; -import org.oasisopen.sca.annotation.Destroy; -import org.oasisopen.sca.annotation.Reference; -import org.oasisopen.sca.annotation.Scope; -import org.oasisopen.sca.annotation.Service; - -@Service(AComponent.class) -@Scope("CONVERSATION") -public class AComponentImpl implements AComponent { - - protected ComponentContext componentContext; - - @Reference - protected CallableReference bReference; - - @Reference - protected ServiceReference cReference; - - @Reference - protected ServiceReference dReference; - - @ConversationID - protected String cid; - - public String getName() { - return "ComponentA"; - } - - @Context - public void setComponentContext(ComponentContext context) { - this.componentContext = context; - } - - public void testConversation() { - ServiceReference cSR = componentContext.getServiceReference(CComponent.class, "cReference"); - cSR.setConversationID("AConversationID"); - Assert.assertEquals("ComponentC", cSR.getService().getName()); - - try { - Thread.sleep(1100); - cSR.getService().testConversation(); - - Assert.fail(); - } catch (InterruptedException ie) { - ie.printStackTrace(); - } catch (ConversationEndedException cee) { - // Expected - } - } - - public void testCallBack() { - ServiceReference bSR = componentContext.getServiceReference(BComponent.class, "bReference"); - bSR.setCallbackID("ComponentACallBack"); - - try { - bSR.getService().testCallback(); - Assert.fail(); - } catch (NoRegisteredCallbackException e) { - // Expected - } - } - - public boolean testServiceRuntimeException() { - try { - componentContext.getServiceReference(BComponent.class, "dummyBReference").getService().getName(); - } catch (ServiceRuntimeException sre) { - return true; - } - - return false; - } - - public boolean testServiceUnavailableException() { - return false; - } - - public boolean testCheckedException() { - try { - dReference.getService().testException(); - } catch (DException e) { - if (e.getMessage().equals("ADException")) { - return true; - } - } - - return false; - } - - @Destroy - public void destroy() { - System.out.println("This is a Destroy of AComponent .."); - } - -} diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/impl/BComponentImpl.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/impl/BComponentImpl.java deleted file mode 100644 index eca4b54109..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/impl/BComponentImpl.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.vtest.javaapi.apis.exception.impl; - -import org.apache.tuscany.sca.vtest.javaapi.apis.exception.BCallback; -import org.apache.tuscany.sca.vtest.javaapi.apis.exception.BComponent; -import org.junit.Assert; -import org.oasisopen.sca.CallableReference; -import org.oasisopen.sca.ComponentContext; -import org.oasisopen.sca.annotation.Callback; -import org.oasisopen.sca.annotation.Context; -import org.oasisopen.sca.annotation.Service; - -@Service(BComponent.class) -public class BComponentImpl implements BComponent { - - protected ComponentContext componentContext; - - @Callback - protected BCallback callback; - - @Context - public void setComponentContext(ComponentContext context) { - this.componentContext = context; - } - - public String getName() { - return "ComponentB"; - } - - public void testCallback() { - callback = componentContext.getRequestContext().getCallback(); - callback.processResults("CallBackFromB"); - - CallableReference bCR = componentContext.getRequestContext().getCallbackReference(); - Assert.assertEquals("ComponentACallBack", bCR.getCallbackID()); - } - - public void testRedirectedCallback() { - callback = componentContext.getRequestContext().getCallback(); - callback.processResults("RedirectedCallBackFromB"); - - CallableReference bCR = componentContext.getRequestContext().getCallbackReference(); - Assert.assertEquals("RedirectedCallBack", bCR.getCallbackID()); - } - -} diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/impl/CComponentImpl.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/impl/CComponentImpl.java deleted file mode 100644 index 57a34716e6..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/impl/CComponentImpl.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.vtest.javaapi.apis.exception.impl; - -import org.apache.tuscany.sca.vtest.javaapi.apis.exception.CComponent; -import org.junit.Assert; -import org.oasisopen.sca.RequestContext; -import org.oasisopen.sca.annotation.Context; -import org.oasisopen.sca.annotation.ConversationAttributes; -import org.oasisopen.sca.annotation.ConversationID; -import org.oasisopen.sca.annotation.Scope; -import org.oasisopen.sca.annotation.Service; - -@Service(CComponent.class) -@Scope("CONVERSATION") -@ConversationAttributes(maxIdleTime="1 seconds") -public class CComponentImpl implements CComponent { - - @Context - protected RequestContext requestContext; - - @ConversationID - protected String cid; - - public String getName() { - return "ComponentC"; - } - - public void testConversation() { - Assert.assertEquals("AConversationID", cid); - } - -} diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/impl/DComponentImpl.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/impl/DComponentImpl.java deleted file mode 100644 index c1f5a56a9a..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/impl/DComponentImpl.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.vtest.javaapi.apis.exception.impl; - -import org.apache.tuscany.sca.vtest.javaapi.apis.exception.DComponent; -import org.apache.tuscany.sca.vtest.javaapi.apis.exception.DException; -import org.oasisopen.sca.annotation.Service; - -@Service(DComponent.class) -public class DComponentImpl implements DComponent { - - public String getName() { - return "ComponentD"; - } - - public void testException() throws DException { - throw new DException("ADException"); - } - -} diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/exception/src/main/resources/exception.composite b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/exception/src/main/resources/exception.composite deleted file mode 100644 index 5bd933ce96..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/exception/src/main/resources/exception.composite +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/exception/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/ExceptionTestCase.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/exception/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/ExceptionTestCase.java deleted file mode 100644 index da7b1da0fa..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/exception/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/ExceptionTestCase.java +++ /dev/null @@ -1,132 +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.vtest.javaapi.apis.exception; - -import org.apache.tuscany.sca.host.embedded.SCADomain; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Ignore; -import org.junit.Test; - -/** - * This test class tests the Exceptions described in 1.7.6, 1.7.7, 1.7.8, and 1.7.9 of the SCA Java Annotations & APIs Specification 1.0. - * This also covers 1.5 of the specification. - */ -public class ExceptionTestCase { - - protected static SCADomain domain; - protected static String compositeName = "exception.composite"; - protected static AComponent a; - protected static BComponent b; - - @BeforeClass - public static void init() throws Exception { - try { - System.out.println("Setting up"); - domain = SCADomain.newInstance(compositeName); - a = domain.getService(AComponent.class, "AComponent"); - b = domain.getService(BComponent.class, "BComponent"); - } catch (Exception e) { - e.printStackTrace(); - } - } - - @AfterClass - public static void destroy() throws Exception { - System.out.println("Cleaning up"); - if (domain != null) { - domain.close(); - } - } - - /** - * Lines 951
- * NoRegisteredCallbackException. - * - * @throws Exception - */ - @Test - public void testNoRegisteredCallbackException() throws Exception { - a.testCallBack(); - } - - /** - * Lines 960
- * ServiceRuntimeException - This exception signals problems in the management of SCA component execution. - * - * @throws Exception - */ - @Test - public void testServiceRuntimeException() throws Exception { - Assert.assertTrue(a.testServiceRuntimeException()); - } - - /** - * Lines 970
- * ServiceUnavailableException – This exception signals problems in the interaction with remote services. - * - * @throws Exception - */ - @Test - //@Ignore - public void testServiceUnavailableException() throws Exception { - domain.getComponentManager().stopComponent("AComponent"); - - try { - a.getName(); - } catch (Exception e) { - e.printStackTrace(); - } - - try { - AComponent ac = domain.getService(AComponent.class, "AComponent"); - ac.getName(); - } catch (Exception e) { - e.printStackTrace(); - } - - domain.getComponentManager().startComponent("AComponent"); - } - - /** - * Lines 983
- * ConversationEndedException. - * - * @throws Exception - */ - @Test - public void testConversationEndedException() throws Exception { - a.testConversation(); - } - - /** - * Lines 360-361
- * Business exceptions are thrown by the implementation of the called service method, - * and are defined as checked exceptions on the interface that types the service. - * - * @throws Exception - */ - @Test - public void testCheckedException() throws Exception { - Assert.assertTrue(a.testCheckedException()); - } - -} diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/pom.xml b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/pom.xml deleted file mode 100644 index edf913ed7f..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/pom.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - vtest-java-api - 2.0-M2-SNAPSHOT - ../pom.xml - - java-api-apis - pom - - Apache Tuscany SCA Java APIs and Annotations Verification Tests - APIs - - - - org.apache.tuscany.sca - tuscany-host-embedded - 2.0-M2-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-implementation-java-runtime - 2.0-M2-SNAPSHOT - runtime - - - - - - default - - true - - - componentcontext - requestcontext - callablereference - servicereference - conversation - exception - - - - diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/requestcontext/pom.xml b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/requestcontext/pom.xml deleted file mode 100644 index 6743e85f30..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/requestcontext/pom.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - java-api-apis - 2.0-M2-SNAPSHOT - ../pom.xml - - vtest-java-api-apis-requestcontext - Apache Tuscany SCA Java APIs and Annotations Verification Tests - APIs - RequestContext - - - - org.apache.tuscany.sca - tuscany-host-embedded - 2.0-M2-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-implementation-java-runtime - 2.0-M2-SNAPSHOT - runtime - - - diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/requestcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/AComponent.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/requestcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/AComponent.java deleted file mode 100644 index 6fec5cada3..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/requestcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/AComponent.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.vtest.javaapi.apis.requestcontext; - -/** - * Simple Service A. - */ -public interface AComponent { - - public String getName(); - - public boolean isJAASSubject(); - public String getServiceName(); - public String getCallbackResult(); - public String getServiceReferenceName(); - public String getCallbackServiceReferenceName(); - -} diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/requestcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/BCallback.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/requestcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/BCallback.java deleted file mode 100644 index 4dd2088f90..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/requestcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/BCallback.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.vtest.javaapi.apis.requestcontext; - -public interface BCallback { - - public String getCallbackName(); - public void processResults(String result); - -} diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/requestcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/BComponent.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/requestcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/BComponent.java deleted file mode 100644 index d913e95a53..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/requestcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/BComponent.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.vtest.javaapi.apis.requestcontext; - -import org.oasisopen.sca.annotation.Callback; - -/** - * Simple Service B. - */ -@Callback(BCallback.class) -public interface BComponent { - - public String getName(); - - public void testCallback(); - public String getServiceReferenceName(); - -} diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/requestcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/impl/AComponentImpl.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/requestcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/impl/AComponentImpl.java deleted file mode 100644 index 5d3cbf6e3d..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/requestcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/impl/AComponentImpl.java +++ /dev/null @@ -1,102 +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.vtest.javaapi.apis.requestcontext.impl; - -import javax.security.auth.Subject; - -import org.apache.tuscany.sca.vtest.javaapi.apis.requestcontext.AComponent; -import org.apache.tuscany.sca.vtest.javaapi.apis.requestcontext.BCallback; -import org.apache.tuscany.sca.vtest.javaapi.apis.requestcontext.BComponent; -import org.oasisopen.sca.CallableReference; -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.Service; - -@Service(AComponent.class) -public class AComponentImpl implements AComponent, BCallback { - - private static Object monitor = new Object(); - private static String returnMessage = null; - private static CallableReference cbCR; - - protected ComponentContext componentContext; - - @Reference - protected BComponent bReference; - - public String getName() { - return "ComponentA"; - } - - @Context - public void setComponentContext(ComponentContext context) { - this.componentContext = context; - } - - public boolean isJAASSubject() { - return componentContext.getRequestContext().getSecuritySubject() instanceof Subject; - } - - public String getServiceName() { - return componentContext.getRequestContext().getServiceName(); - } - - public String getCallbackResult() { - ServiceReference bSR = componentContext.getServiceReference(BComponent.class, "bReference"); - String cbID = "ComponentACallBack"; - bSR.setCallbackID(cbID); - bSR.getService().testCallback(); - - // Wait for 30s max. - int count = 0; - synchronized(monitor) { - while (returnMessage == null && count++ < 30) { - try { - monitor.wait(1000L); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - } - - return returnMessage; - } - - public void processResults(String result) { - returnMessage = result; - cbCR = componentContext.getRequestContext().getServiceReference(); - } - - public String getServiceReferenceName() { - CallableReference aCR = componentContext.getRequestContext().getServiceReference(); - return aCR.getService().getName(); - } - - public String getCallbackServiceReferenceName() { - return cbCR.getService().getCallbackName(); - } - - public String getCallbackName() { - return "CallBackB"; - } - -} diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/requestcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/impl/BComponentImpl.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/requestcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/impl/BComponentImpl.java deleted file mode 100644 index d358736daa..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/requestcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/impl/BComponentImpl.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 org.apache.tuscany.sca.vtest.javaapi.apis.requestcontext.impl; - -import org.apache.tuscany.sca.vtest.javaapi.apis.requestcontext.BCallback; -import org.apache.tuscany.sca.vtest.javaapi.apis.requestcontext.BComponent; -import org.junit.Assert; -import org.oasisopen.sca.CallableReference; -import org.oasisopen.sca.ComponentContext; -import org.oasisopen.sca.annotation.Callback; -import org.oasisopen.sca.annotation.Context; -import org.oasisopen.sca.annotation.Service; - -@Service(BComponent.class) -public class BComponentImpl implements BComponent { - - protected ComponentContext componentContext; - - @Callback - protected BCallback callback; - - @Context - public void setComponentContext(ComponentContext context) { - this.componentContext = context; - } - - public String getName() { - return "ComponentB"; - } - - public void testCallback() { - callback = componentContext.getRequestContext().getCallback(); - callback.processResults("CallBackFromB"); - - CallableReference bCR = componentContext.getRequestContext().getCallbackReference(); - Assert.assertEquals("ComponentACallBack", bCR.getCallbackID()); - } - - public String getServiceReferenceName() { - CallableReference bCR = componentContext.getRequestContext().getServiceReference(); - return bCR.getService().getName(); - } - -} diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/requestcontext/src/main/resources/requestcontext.composite b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/requestcontext/src/main/resources/requestcontext.composite deleted file mode 100644 index 4aa5eeb25a..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/requestcontext/src/main/resources/requestcontext.composite +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/requestcontext/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/RequestContextTestCase.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/requestcontext/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/RequestContextTestCase.java deleted file mode 100644 index e3b761bd37..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/requestcontext/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/RequestContextTestCase.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.vtest.javaapi.apis.requestcontext; - -import org.apache.tuscany.sca.vtest.utilities.ServiceFinder; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Ignore; -import org.junit.Test; - -/** - * This test class tests the RequestContext interface described in 1.7.2 of the - * SCA Java Annotations & APIs Specification 1.0. - */ -public class RequestContextTestCase { - - protected static String compositeName = "requestcontext.composite"; - protected static AComponent a; - protected static BComponent b; - - @BeforeClass - public static void init() throws Exception { - try { - System.out.println("Setting up"); - ServiceFinder.init(compositeName); - a = ServiceFinder.getService(AComponent.class, "AComponent"); - b = ServiceFinder.getService(BComponent.class, "BComponent"); - } catch (Exception e) { - e.printStackTrace(); - } - } - - @AfterClass - public static void destroy() throws Exception { - System.out.println("Cleaning up"); - ServiceFinder.cleanup(); - } - - /** - * Lines 858
- * getSecuritySubject() – Returns the JAAS Subject of the current request. - * - * @throws Exception - */ - @Ignore("TUSCANY-2608") - public void testGetSecuritySubject() throws Exception { - Assert.assertTrue(a.isJAASSubject()); - } - - /** - * Lines 860
- * getServiceName() – Returns the name of the service on the Java - * implementation the request came in on. - * - * @throws Exception - */ - @Test - public void testGetServiceName() throws Exception { - Assert.assertEquals("AComponent", a.getServiceName()); - } - - /** - * Lines 861, 862
- * getCallbackReference() – Returns a callable reference to the callback as - * specified by the caller. getCallback() – Returns a proxy for the callback - * as specified by the caller. - * - * @throws Exception - */ - @Test - public void testGetCallback() throws Exception { - Assert.assertEquals("CallBackFromB", a.getCallbackResult()); - } - - /** - * Lines 863
- * getServiceReference() – When invoked during the execution of a service - * operation, this API MUST return a CallableReference that represents the - * service. When invoked during the execution of a callback operation, this - * API MUST return a CallableReference that represents the callback service. - * - * @throws Exception - */ - @Test - public void testGetServiceReference() throws Exception { - Assert.assertEquals("ComponentA", a.getServiceReferenceName()); - Assert.assertEquals("ComponentB", b.getServiceReferenceName()); - Assert.assertEquals("CallBackB", a.getCallbackServiceReferenceName()); - } - -} diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/servicereference/pom.xml b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/servicereference/pom.xml deleted file mode 100644 index da38ad68a1..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/servicereference/pom.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - java-api-apis - 2.0-M2-SNAPSHOT - ../pom.xml - - vtest-java-api-apis-servicereference - Apache Tuscany SCA Java APIs and Annotations Verification Tests - APIs - ServiceReference - - - - org.apache.tuscany.sca - tuscany-host-embedded - 2.0-M2-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-implementation-java-runtime - 2.0-M2-SNAPSHOT - runtime - - - diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/AComponent.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/AComponent.java deleted file mode 100644 index 6de5d6810e..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/AComponent.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.vtest.javaapi.apis.servicereference; - -import org.oasisopen.sca.annotation.Conversational; - -/** - * Simple Service A. - */ -@Conversational -public interface AComponent { - - public String getName(); - - public void testConversationID(); - public String getCallbackResult(); - public void redirectCallback(); - public void testGetCallback(); - -} diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/BCallback.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/BCallback.java deleted file mode 100644 index f8c5c1272f..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/BCallback.java +++ /dev/null @@ -1,26 +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.vtest.javaapi.apis.servicereference; - -public interface BCallback { - - public void processResults(String result); - -} diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/BComponent.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/BComponent.java deleted file mode 100644 index 65a444d100..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/BComponent.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.vtest.javaapi.apis.servicereference; - -import org.oasisopen.sca.annotation.Callback; -import org.oasisopen.sca.annotation.Conversational; - -/** - * Simple Service B. - */ -@Conversational -@Callback(BCallback.class) -public interface BComponent { - - public String getName(); - - public void testCallback(); - public void testConversationID(); - public void testRedirectedCallback(); - -} diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/CComponent.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/CComponent.java deleted file mode 100644 index 28c90e2071..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/CComponent.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.vtest.javaapi.apis.servicereference; - -/** - * Simple Service C. - */ -public interface CComponent extends BCallback { - -} diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/impl/AComponentImpl.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/impl/AComponentImpl.java deleted file mode 100644 index 86dc80a4e1..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/impl/AComponentImpl.java +++ /dev/null @@ -1,119 +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.vtest.javaapi.apis.servicereference.impl; - -import org.apache.tuscany.sca.vtest.javaapi.apis.servicereference.AComponent; -import org.apache.tuscany.sca.vtest.javaapi.apis.servicereference.BCallback; -import org.apache.tuscany.sca.vtest.javaapi.apis.servicereference.BComponent; -import org.apache.tuscany.sca.vtest.javaapi.apis.servicereference.CComponent; -import org.junit.Assert; -import org.oasisopen.sca.CallableReference; -import org.oasisopen.sca.ComponentContext; -import org.oasisopen.sca.ServiceReference; -import org.oasisopen.sca.annotation.Context; -import org.oasisopen.sca.annotation.ConversationID; -import org.oasisopen.sca.annotation.Reference; -import org.oasisopen.sca.annotation.Scope; -import org.oasisopen.sca.annotation.Service; - -@Service(AComponent.class) -@Scope("CONVERSATION") -public class AComponentImpl implements AComponent, BCallback { - - private static Object monitor = new Object(); - private static String returnMessage = null; - - protected ComponentContext componentContext; - - @Reference - protected CallableReference bReference; - - @Reference - protected ServiceReference cReference; - - @ConversationID - protected String cid; - - public String getName() { - return "ComponentA"; - } - - @Context - public void setComponentContext(ComponentContext context) { - this.componentContext = context; - } - - public void testConversationID() { - ServiceReference bSR = componentContext.getServiceReference(BComponent.class, "bReference"); - bSR.setConversationID("AConversationID"); - bSR.getService().testConversationID(); - - Assert.assertEquals("AConversationID", bSR.getConversation().getConversationID()); - } - - public String getCallbackResult() { - ServiceReference bSR = componentContext.getServiceReference(BComponent.class, "bReference"); - String cbID = "ComponentACallBack"; - bSR.setCallbackID(cbID); - bSR.getService().testCallback(); - - // Wait for 30s max. - int count = 0; - synchronized(monitor) { - while (returnMessage == null && count++ < 30) { - try { - monitor.wait(1000L); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - } - - return returnMessage; - } - - public void processResults(String result) { - returnMessage = result; - } - - public void redirectCallback() { - ServiceReference bSR = componentContext.getServiceReference(BComponent.class, "bReference"); - bSR.setCallbackID("RedirectedCallBack"); - bSR.setCallback(cReference); - bSR.getService().testRedirectedCallback(); - } - - public void testGetCallback() { - ServiceReference bSR = componentContext.getServiceReference(BComponent.class, "bReference"); - bSR.setCallback(cReference); - Assert.assertEquals(cReference, bSR.getCallback()); - - TestObject aCallback = new TestObject(); - bSR.setCallback(aCallback); - Assert.assertEquals(aCallback, bSR.getCallback()); - Assert.assertEquals(1, ((TestObject) bSR.getCallback()).getId()); - - TestObject bCallback = new TestObject(); - bSR.setCallback(bCallback); - Assert.assertEquals(bCallback, bSR.getCallback()); - Assert.assertEquals(2, ((TestObject) bSR.getCallback()).getId()); - } - -} diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/impl/BComponentImpl.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/impl/BComponentImpl.java deleted file mode 100644 index c5af80291e..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/impl/BComponentImpl.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 org.apache.tuscany.sca.vtest.javaapi.apis.servicereference.impl; - -import org.apache.tuscany.sca.vtest.javaapi.apis.servicereference.BCallback; -import org.apache.tuscany.sca.vtest.javaapi.apis.servicereference.BComponent; -import org.junit.Assert; -import org.oasisopen.sca.CallableReference; -import org.oasisopen.sca.ComponentContext; -import org.oasisopen.sca.annotation.Callback; -import org.oasisopen.sca.annotation.Context; -import org.oasisopen.sca.annotation.ConversationID; -import org.oasisopen.sca.annotation.Scope; -import org.oasisopen.sca.annotation.Service; - -@Service(BComponent.class) -@Scope("CONVERSATION") -public class BComponentImpl implements BComponent { - - protected ComponentContext componentContext; - - @Callback - protected BCallback callback; - - @ConversationID - protected String cid; - - @Context - public void setComponentContext(ComponentContext context) { - this.componentContext = context; - } - - public String getName() { - return "ComponentB"; - } - - public void testCallback() { - callback = componentContext.getRequestContext().getCallback(); - callback.processResults("CallBackFromB"); - - CallableReference bCR = componentContext.getRequestContext().getCallbackReference(); - Assert.assertEquals("ComponentACallBack", bCR.getCallbackID()); - } - - public void testConversationID() { - Assert.assertEquals("AConversationID", cid); - } - - public void testRedirectedCallback() { - callback = componentContext.getRequestContext().getCallback(); - callback.processResults("RedirectedCallBackFromB"); - - CallableReference bCR = componentContext.getRequestContext().getCallbackReference(); - Assert.assertEquals("RedirectedCallBack", bCR.getCallbackID()); - } - -} diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/impl/CComponentImpl.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/impl/CComponentImpl.java deleted file mode 100644 index 563d3ceab6..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/impl/CComponentImpl.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.vtest.javaapi.apis.servicereference.impl; - -import org.apache.tuscany.sca.vtest.javaapi.apis.servicereference.CComponent; -import org.junit.Assert; -import org.oasisopen.sca.RequestContext; -import org.oasisopen.sca.annotation.Context; -import org.oasisopen.sca.annotation.Service; - -@Service(CComponent.class) -public class CComponentImpl implements CComponent { - - @Context - protected RequestContext requestContext; - - public void processResults(String result) { - Assert.assertEquals("RedirectedCallBackFromB", result); - } - -} diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/impl/TestObject.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/impl/TestObject.java deleted file mode 100644 index ba3edf13ae..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/impl/TestObject.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.vtest.javaapi.apis.servicereference.impl; - -public class TestObject { - - public static int count = 0; - - private int id; - - public TestObject() { - count++; - id = count; - } - - public int getId() { - return id; - } - -} diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/servicereference/src/main/resources/servicereference.composite b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/servicereference/src/main/resources/servicereference.composite deleted file mode 100644 index 9bded61947..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/servicereference/src/main/resources/servicereference.composite +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/servicereference/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/ServiceReferenceTestCase.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/servicereference/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/ServiceReferenceTestCase.java deleted file mode 100644 index fda917d60a..0000000000 --- a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/apis/servicereference/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/ServiceReferenceTestCase.java +++ /dev/null @@ -1,106 +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.vtest.javaapi.apis.servicereference; - -import org.apache.tuscany.sca.vtest.utilities.ServiceFinder; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * This test class tests the ServiceReference interface described in 1.7.4 of - * the SCA Java Annotations & APIs Specification 1.0. - */ -public class ServiceReferenceTestCase { - - protected static String compositeName = "servicereference.composite"; - protected static AComponent a; - protected static BComponent b; - - @BeforeClass - public static void init() throws Exception { - try { - System.out.println("Setting up"); - ServiceFinder.init(compositeName); - a = ServiceFinder.getService(AComponent.class, "AComponent"); - b = ServiceFinder.getService(BComponent.class, "BComponent"); - } catch (Exception e) { - e.printStackTrace(); - } - } - - @AfterClass - public static void destroy() throws Exception { - System.out.println("Cleaning up"); - ServiceFinder.cleanup(); - } - - /** - * Lines 915-916
- * getConversationID() - Returns the id supplied by the user that will be - * associated with conversations initiated through this reference.
- * setConversationID(Object conversationId) – Set the id to associate with - * any conversation started through this reference. If the value supplied is - * null then the id will be generated by the implementation. Throws an - * IllegalStateException if a conversation is currently associated with this - * reference. - * - * @throws Exception - */ - @Test - public void testConversationID() throws Exception { - a.testConversationID(); - } - - /** - * Lines 917
- * setCallbackID(Object callbackID) – Sets the callback ID. - * - * @throws Exception - */ - @Test - public void testSetCallbackID() throws Exception { - Assert.assertEquals("CallBackFromB", a.getCallbackResult()); - } - - /** - * Lines 918
- * getCallback() – Returns the callback object. - * - * @throws Exception - */ - @Test - public void testGetCallback() throws Exception { - a.testGetCallback(); - } - - /** - * Lines 919
- * setCallback(Object callback) – Sets the callback object. - * - * @throws Exception - */ - @Test - public void testSetCallback() throws Exception { - a.redirectCallback(); - } - -} -- cgit v1.2.3