From 71fd423003d26bd5ca56966cadb1314b790c19f6 Mon Sep 17 00:00:00 2001 From: antelder Date: Thu, 19 Mar 2009 10:32:50 +0000 Subject: [maven-release-plugin] copy for tag 2.0-M2 git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@755900 13f79535-47bb-0310-9956-ffa450edef68 --- .../vtest/java-api/conversation/parameters/pom.xml | 46 +++++++++++++++ .../javaapi/conversation/parameters/AService.java | 28 +++++++++ .../javaapi/conversation/parameters/BService.java | 34 +++++++++++ .../javaapi/conversation/parameters/CService.java | 32 ++++++++++ .../conversation/parameters/impl/AServiceImpl.java | 47 +++++++++++++++ .../conversation/parameters/impl/BServiceImpl.java | 40 +++++++++++++ .../conversation/parameters/impl/CServiceImpl.java | 44 ++++++++++++++ .../src/main/resources/parameters.composite | 40 +++++++++++++ .../parameters/ConversationParametersTestCase.java | 69 ++++++++++++++++++++++ 9 files changed, 380 insertions(+) create mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/conversation/parameters/pom.xml create mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/conversation/parameters/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/AService.java create mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/conversation/parameters/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/BService.java create mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/conversation/parameters/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/CService.java create mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/conversation/parameters/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/impl/AServiceImpl.java create mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/conversation/parameters/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/impl/BServiceImpl.java create mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/conversation/parameters/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/impl/CServiceImpl.java create mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/conversation/parameters/src/main/resources/parameters.composite create mode 100644 sandbox/ant/sca/tags/2.0-M2/vtest/java-api/conversation/parameters/src/test/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/ConversationParametersTestCase.java (limited to 'sandbox/ant/sca/tags/2.0-M2/vtest/java-api/conversation/parameters') diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/conversation/parameters/pom.xml b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/conversation/parameters/pom.xml new file mode 100644 index 0000000000..611f4945b9 --- /dev/null +++ b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/conversation/parameters/pom.xml @@ -0,0 +1,46 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + java-api-annotations + 2.0-M2-SNAPSHOT + ../pom.xml + + vtest-java-api-conversation-parameters + Apache Tuscany SCA Java APIs and Annotations Verification Tests - Conversation - Parameters + + + + 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/conversation/parameters/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/AService.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/conversation/parameters/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/AService.java new file mode 100644 index 0000000000..bd19b504d9 --- /dev/null +++ b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/conversation/parameters/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/AService.java @@ -0,0 +1,28 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.vtest.javaapi.conversation.parameters; + +/** + * Simple Remotable Service + */ +public interface AService { + + public void setBStateThenGetCState(); + +} diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/conversation/parameters/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/BService.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/conversation/parameters/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/BService.java new file mode 100644 index 0000000000..c404b91673 --- /dev/null +++ b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/conversation/parameters/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/BService.java @@ -0,0 +1,34 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.vtest.javaapi.conversation.parameters; + +import org.oasisopen.sca.annotation.Conversational; +import org.oasisopen.sca.annotation.Remotable; + +/** + * Simple Local Service + */ +@Remotable +@Conversational +public interface BService { + + public void setState(String someState); + public String getState(); + +} diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/conversation/parameters/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/CService.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/conversation/parameters/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/CService.java new file mode 100644 index 0000000000..d9f32dcfea --- /dev/null +++ b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/conversation/parameters/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/CService.java @@ -0,0 +1,32 @@ +/* + * 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.conversation.parameters; + +import org.oasisopen.sca.ServiceReference; + +/** + * Simple Local Service + */ +public interface CService { + + public void setState(String someState); + public String getState(); + public Object continueConversation(ServiceReference bref); + +} diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/conversation/parameters/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/impl/AServiceImpl.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/conversation/parameters/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/impl/AServiceImpl.java new file mode 100644 index 0000000000..920d1294b3 --- /dev/null +++ b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/conversation/parameters/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/impl/AServiceImpl.java @@ -0,0 +1,47 @@ +/* + * 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.conversation.parameters.impl; + +import junit.framework.Assert; + +import org.apache.tuscany.sca.vtest.javaapi.conversation.parameters.AService; +import org.apache.tuscany.sca.vtest.javaapi.conversation.parameters.BService; +import org.apache.tuscany.sca.vtest.javaapi.conversation.parameters.CService; +import org.oasisopen.sca.ServiceReference; +import org.oasisopen.sca.annotation.Reference; +import org.oasisopen.sca.annotation.Service; + +@Service(AService.class) +public class AServiceImpl implements AService { + + @Reference + protected ServiceReference b; + + @Reference + protected CService c; + + public void setBStateThenGetCState() { + String someState = "set by A"; + b.getService().setState(someState); + Assert.assertEquals(someState, c.continueConversation(b)); + } + + +} diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/conversation/parameters/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/impl/BServiceImpl.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/conversation/parameters/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/impl/BServiceImpl.java new file mode 100644 index 0000000000..98cf59c084 --- /dev/null +++ b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/conversation/parameters/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/impl/BServiceImpl.java @@ -0,0 +1,40 @@ +/* + * 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.conversation.parameters.impl; + +import org.apache.tuscany.sca.vtest.javaapi.conversation.parameters.BService; +import org.oasisopen.sca.annotation.Scope; +import org.oasisopen.sca.annotation.Service; + +@Service(BService.class) +@Scope("CONVERSATION") +public class BServiceImpl implements BService { + + String someState; + + public void setState(String someState) { + this.someState = someState; + } + + public String getState() { + return someState; + } + +} diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/conversation/parameters/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/impl/CServiceImpl.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/conversation/parameters/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/impl/CServiceImpl.java new file mode 100644 index 0000000000..5f223dfcf0 --- /dev/null +++ b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/conversation/parameters/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/impl/CServiceImpl.java @@ -0,0 +1,44 @@ +/* + * 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.conversation.parameters.impl; + +import org.apache.tuscany.sca.vtest.javaapi.conversation.parameters.BService; +import org.apache.tuscany.sca.vtest.javaapi.conversation.parameters.CService; +import org.oasisopen.sca.ServiceReference; +import org.oasisopen.sca.annotation.Service; + +@Service(CService.class) +public class CServiceImpl implements CService { + + String someState; + + public void setState(String someState) { + this.someState = someState; + } + + public String getState() { + return someState; + } + + public String continueConversation(ServiceReference bref) { + return bref.getService().getState(); + } + +} diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/conversation/parameters/src/main/resources/parameters.composite b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/conversation/parameters/src/main/resources/parameters.composite new file mode 100644 index 0000000000..a8500dfb09 --- /dev/null +++ b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/conversation/parameters/src/main/resources/parameters.composite @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + diff --git a/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/conversation/parameters/src/test/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/ConversationParametersTestCase.java b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/conversation/parameters/src/test/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/ConversationParametersTestCase.java new file mode 100644 index 0000000000..929fe06115 --- /dev/null +++ b/sandbox/ant/sca/tags/2.0-M2/vtest/java-api/conversation/parameters/src/test/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/ConversationParametersTestCase.java @@ -0,0 +1,69 @@ +/* + * 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.conversation.parameters; + +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 Service annotation described in section 1.2.1 and + * 1.8.17 + */ +public class ConversationParametersTestCase { + + protected static ServiceFinder serviceFinder; + protected static String compositeName = "parameters.composite"; + protected static AService aService = null; + + @BeforeClass + public static void init() throws Exception { + try { + System.out.println("Setting up"); + ServiceFinder.init(compositeName); + aService = ServiceFinder.getService(AService.class, "AComponent"); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + + @AfterClass + public static void destroy() throws Exception { + + System.out.println("Cleaning up"); + ServiceFinder.cleanup(); + + } + + /** + * Line 423, 424, 425:
+ *

+ * The service reference which represents a single conversation can be + * passed as a parameter to another service, even if that other service is + * remote. This may be used in order to allow one component to continue a + * conversation that had been started by another. + */ + @Test + public void passParameter1() throws Exception { + aService.setBStateThenGetCState(); + } + +} -- cgit v1.2.3