From 7a7cbbe3fc4f0460e62c91d2af1c511ffcc4a4e5 Mon Sep 17 00:00:00 2001 From: antelder Date: Wed, 24 Aug 2011 10:06:29 +0000 Subject: 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 git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1161035 13f79535-47bb-0310-9956-ffa450edef68 --- .../trunk/testing/itest/async-services/pom.xml | 6 +++ .../src/main/resources/test1AsyncService.composite | 28 ++++++++++ .../src/main/resources/test1Client.composite | 29 +++++++++++ .../sca/itest/Test1DistributedTestCase.java | 60 ++++++++++++++++++++++ 4 files changed, 123 insertions(+) create mode 100644 sca-java-2.x/trunk/testing/itest/async-services/src/main/resources/test1AsyncService.composite create mode 100644 sca-java-2.x/trunk/testing/itest/async-services/src/main/resources/test1Client.composite create mode 100644 sca-java-2.x/trunk/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Test1DistributedTestCase.java (limited to 'sca-java-2.x/trunk/testing') diff --git a/sca-java-2.x/trunk/testing/itest/async-services/pom.xml b/sca-java-2.x/trunk/testing/itest/async-services/pom.xml index f7e5463b6d..bcfbace0b0 100644 --- a/sca-java-2.x/trunk/testing/itest/async-services/pom.xml +++ b/sca-java-2.x/trunk/testing/itest/async-services/pom.xml @@ -52,6 +52,12 @@ 2.0-SNAPSHOT + + org.apache.tuscany.sca + tuscany-domain-hazelcast + 2.0-SNAPSHOT + + org.mortbay.jetty jetty diff --git a/sca-java-2.x/trunk/testing/itest/async-services/src/main/resources/test1AsyncService.composite b/sca-java-2.x/trunk/testing/itest/async-services/src/main/resources/test1AsyncService.composite new file mode 100644 index 0000000000..4d9a1166df --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/async-services/src/main/resources/test1AsyncService.composite @@ -0,0 +1,28 @@ + + + + + + + + + \ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/async-services/src/main/resources/test1Client.composite b/sca-java-2.x/trunk/testing/itest/async-services/src/main/resources/test1Client.composite new file mode 100644 index 0000000000..923e780e06 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/async-services/src/main/resources/test1Client.composite @@ -0,0 +1,29 @@ + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Test1DistributedTestCase.java b/sca-java-2.x/trunk/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Test1DistributedTestCase.java new file mode 100644 index 0000000000..d506441220 --- /dev/null +++ b/sca-java-2.x/trunk/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Test1DistributedTestCase.java @@ -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")); + } + +} -- cgit v1.2.3