You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by an...@apache.org on 2011/08/24 12:06:29 UTC

svn commit: r1161035 - in /tuscany/sca-java-2.x/trunk/testing/itest/async-services: pom.xml src/main/resources/test1AsyncService.composite src/main/resources/test1Client.composite src/test/java/org/apache/tuscany/sca/itest/Test1DistributedTestCase.java

Author: antelder
Date: Wed Aug 24 10:06:29 2011
New Revision: 1161035

URL: http://svn.apache.org/viewvc?rev=1161035&view=rev
Log:
Add an async client-service itest that uses distributed nodes. This is taken out with @Ignore presently as it doesn't work due to some bugs in the Tuscany generated wsdl thats in the endpoint registry

Added:
    tuscany/sca-java-2.x/trunk/testing/itest/async-services/src/main/resources/test1AsyncService.composite
    tuscany/sca-java-2.x/trunk/testing/itest/async-services/src/main/resources/test1Client.composite
    tuscany/sca-java-2.x/trunk/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Test1DistributedTestCase.java
Modified:
    tuscany/sca-java-2.x/trunk/testing/itest/async-services/pom.xml

Modified: tuscany/sca-java-2.x/trunk/testing/itest/async-services/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/async-services/pom.xml?rev=1161035&r1=1161034&r2=1161035&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/async-services/pom.xml (original)
+++ tuscany/sca-java-2.x/trunk/testing/itest/async-services/pom.xml Wed Aug 24 10:06:29 2011
@@ -53,6 +53,12 @@
         </dependency>
         
         <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-domain-hazelcast</artifactId>
+            <version>2.0-SNAPSHOT</version>
+        </dependency>
+
+        <dependency>
             <groupId>org.mortbay.jetty</groupId>
             <artifactId>jetty</artifactId>
             <version>6.1.19</version>

Added: tuscany/sca-java-2.x/trunk/testing/itest/async-services/src/main/resources/test1AsyncService.composite
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/async-services/src/main/resources/test1AsyncService.composite?rev=1161035&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/async-services/src/main/resources/test1AsyncService.composite (added)
+++ tuscany/sca-java-2.x/trunk/testing/itest/async-services/src/main/resources/test1AsyncService.composite Wed Aug 24 10:06:29 2011
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+           targetNamespace="http://docs.oasis-open.org/ns/opencsa/scatests/200903"
+           name="Test1AsyncServiceComposite">
+           
+    <component name="AsyncServiceComponent">
+        <implementation.java class="org.apache.tuscany.sca.itest.Service1AsyncServerImpl2"/>
+    </component>
+
+</composite>
\ No newline at end of file

Added: tuscany/sca-java-2.x/trunk/testing/itest/async-services/src/main/resources/test1Client.composite
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/async-services/src/main/resources/test1Client.composite?rev=1161035&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/async-services/src/main/resources/test1Client.composite (added)
+++ tuscany/sca-java-2.x/trunk/testing/itest/async-services/src/main/resources/test1Client.composite Wed Aug 24 10:06:29 2011
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+           targetNamespace="http://docs.oasis-open.org/ns/opencsa/scatests/200903"
+           name="Test1ClientComposite">
+           
+    <component name="Client">
+		<implementation.java class="org.apache.tuscany.sca.itest.Service1ClientImpl"/>
+        <reference name="service1" target="AsyncServiceComponent" />
+    </component>
+    
+</composite>
\ No newline at end of file

Added: tuscany/sca-java-2.x/trunk/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Test1DistributedTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Test1DistributedTestCase.java?rev=1161035&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Test1DistributedTestCase.java (added)
+++ tuscany/sca-java-2.x/trunk/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Test1DistributedTestCase.java Wed Aug 24 10:06:29 2011
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.itest;
+
+import static org.junit.Assert.assertEquals;
+
+import java.net.URI;
+
+import org.apache.tuscany.sca.Node;
+import org.apache.tuscany.sca.TuscanyRuntime;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.oasisopen.sca.NoSuchServiceException;
+
+@Ignore
+public class Test1DistributedTestCase {
+
+    private static final URI DOMAIN = URI.create("uri:Test1DistributedTestCase?bind=127.0.0.1:8765");
+    protected Node clientNode, serviceNode;
+
+    @Before
+    public void setUp() throws Exception {
+        clientNode = TuscanyRuntime.runComposite(DOMAIN, "test1Client.composite", "target/classes");
+        serviceNode = TuscanyRuntime.runComposite(DOMAIN, "test1AsyncService.composite", "target/classes");
+    }
+
+    @After
+    public void tearDown() throws Exception {
+        if (clientNode != null) clientNode.stop();
+        if (serviceNode != null) serviceNode.stop();
+    }
+
+    @Test
+    public void testReference() throws NoSuchServiceException {
+        Service1 test = clientNode.getService(Service1.class, "Client");
+        assertEquals("Service1AsyncServerImpl2.operation1Async foo" + 
+                     "Service1AsyncServerImpl2.operation1Async fooTypeOne" + 
+                     "Service1AsyncServerImpl2.operation1Async fooTypeTwo", 
+                     test.operation1("foo"));
+    }
+
+}