From bdd0a41aed7edf21ec2a65cfa17a86af2ef8c48a Mon Sep 17 00:00:00 2001 From: dims Date: Tue, 17 Jun 2008 00:23:01 +0000 Subject: Move Tuscany from Incubator to top level. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@668359 13f79535-47bb-0310-9956-ffa450edef68 --- .../sca/itest/bindings/bindingsclient/pom.xml | 64 +++++ .../tuscany/sca/itest/SCATestToolService.java | 40 +++ .../src/main/resources/bindingsclient.composite | 47 ++++ .../src/main/resources/wsdl/testtool.wsdl | 272 +++++++++++++++++++++ .../bindingsclient/src/main/webapp/SCATestTool.jsp | 110 +++++++++ .../bindingsclient/src/main/webapp/WEB-INF/web.xml | 10 + .../tuscany/sca/itest/SCATestToolServerTest.java | 27 ++ .../sca/itest/WSBindingsClientTestCase.java | 80 ++++++ .../tuscany/sca/util/SCATestUtilityServerTest.java | 28 +++ 9 files changed, 678 insertions(+) create mode 100644 branches/sca-java-integration/testing/sca/itest/bindings/bindingsclient/pom.xml create mode 100644 branches/sca-java-integration/testing/sca/itest/bindings/bindingsclient/src/main/java/org/apache/tuscany/sca/itest/SCATestToolService.java create mode 100644 branches/sca-java-integration/testing/sca/itest/bindings/bindingsclient/src/main/resources/bindingsclient.composite create mode 100644 branches/sca-java-integration/testing/sca/itest/bindings/bindingsclient/src/main/resources/wsdl/testtool.wsdl create mode 100644 branches/sca-java-integration/testing/sca/itest/bindings/bindingsclient/src/main/webapp/SCATestTool.jsp create mode 100644 branches/sca-java-integration/testing/sca/itest/bindings/bindingsclient/src/main/webapp/WEB-INF/web.xml create mode 100644 branches/sca-java-integration/testing/sca/itest/bindings/bindingsclient/src/test/java/org/apache/tuscany/sca/itest/SCATestToolServerTest.java create mode 100644 branches/sca-java-integration/testing/sca/itest/bindings/bindingsclient/src/test/java/org/apache/tuscany/sca/itest/WSBindingsClientTestCase.java create mode 100644 branches/sca-java-integration/testing/sca/itest/bindings/bindingsclient/src/test/java/org/apache/tuscany/sca/util/SCATestUtilityServerTest.java (limited to 'branches/sca-java-integration/testing/sca/itest/bindings/bindingsclient') diff --git a/branches/sca-java-integration/testing/sca/itest/bindings/bindingsclient/pom.xml b/branches/sca-java-integration/testing/sca/itest/bindings/bindingsclient/pom.xml new file mode 100644 index 0000000000..f9a72ae54b --- /dev/null +++ b/branches/sca-java-integration/testing/sca/itest/bindings/bindingsclient/pom.xml @@ -0,0 +1,64 @@ + + + + + + org.apache.tuscany.testing + sca-itest + 0.1-integration-incubating-SNAPSHOT + ../../pom.xml + + + 4.0.0 + org.apache.tuscany.testing.bindingstest + tuscany-itest-bindings-bindingsclient + jar + SCA FVT Bindings Test Tool JSP Client + + + + + org.apache.tuscany.testing.bindingstest + tuscany-itest-bindings-bindingscomposite + 0.1-integration-incubating-SNAPSHOT + + + + org.apache.tuscany.testing.bindingstest + tuscany-itest-bindings-bindingsutility + 0.1-integration-incubating-SNAPSHOT + + + + org.apache.tuscany.sca.services.databinding + databinding-sdo + 0.1-integration-incubating-SNAPSHOT + + + + commonj + sdo-api-r2.1 + 1.0-incubator-SNAPSHOT + runtime + + + + diff --git a/branches/sca-java-integration/testing/sca/itest/bindings/bindingsclient/src/main/java/org/apache/tuscany/sca/itest/SCATestToolService.java b/branches/sca-java-integration/testing/sca/itest/bindings/bindingsclient/src/main/java/org/apache/tuscany/sca/itest/SCATestToolService.java new file mode 100644 index 0000000000..44801846f6 --- /dev/null +++ b/branches/sca-java-integration/testing/sca/itest/bindings/bindingsclient/src/main/java/org/apache/tuscany/sca/itest/SCATestToolService.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.itest; + +import org.osoa.sca.annotations.Remotable; + +/** + * SCA Test Tool Service + */ + +@Remotable +public interface SCATestToolService { + + public String doOneHopPing(String input); + + public String doTwoHopPing(String input); + + public String doDataTypeTest(String input); + + public String getCallbackBuffer(); + + public void clearCallbackBuffer(); +} diff --git a/branches/sca-java-integration/testing/sca/itest/bindings/bindingsclient/src/main/resources/bindingsclient.composite b/branches/sca-java-integration/testing/sca/itest/bindings/bindingsclient/src/main/resources/bindingsclient.composite new file mode 100644 index 0000000000..ca3ff6494e --- /dev/null +++ b/branches/sca-java-integration/testing/sca/itest/bindings/bindingsclient/src/main/resources/bindingsclient.composite @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + diff --git a/branches/sca-java-integration/testing/sca/itest/bindings/bindingsclient/src/main/resources/wsdl/testtool.wsdl b/branches/sca-java-integration/testing/sca/itest/bindings/bindingsclient/src/main/resources/wsdl/testtool.wsdl new file mode 100644 index 0000000000..22d7070ec3 --- /dev/null +++ b/branches/sca-java-integration/testing/sca/itest/bindings/bindingsclient/src/main/resources/wsdl/testtool.wsdl @@ -0,0 +1,272 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/branches/sca-java-integration/testing/sca/itest/bindings/bindingsclient/src/main/webapp/SCATestTool.jsp b/branches/sca-java-integration/testing/sca/itest/bindings/bindingsclient/src/main/webapp/SCATestTool.jsp new file mode 100644 index 0000000000..8c63a8b6eb --- /dev/null +++ b/branches/sca-java-integration/testing/sca/itest/bindings/bindingsclient/src/main/webapp/SCATestTool.jsp @@ -0,0 +1,110 @@ + +<%-- + * SCATestService.java + * written by Chris Ortiz + * interface class for basic test service + * version .1 9/22/2006 + * + * + --%> + + + + + <%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1" session="true" autoFlush="true" + isThreadSafe="true" isErrorPage="false" + import="org.apache.tuscany.sca.itest.SCATestToolService" + import="java.io.PrintWriter" + import="java.io.StringWriter" + import="org.osoa.sca.CurrentCompositeContext" + import="org.osoa.sca.CompositeContext" + %> + + + SCA FVT Test Service Driver + + + +

SCA FVT Test Tool Client

+ +


Choose Binding type:

+      WS Binding +      EJB Binding +      Default Binding


+
Check Tests to run:

+      Ping First Composite +      Ping Second Composite

+      Data Type Test

+      Async One Way        +      Async Call Back

+ + +
+
+
+ + <% + + String bindingchoice = request.getParameter("bind"); + String[] selected = request.getParameterValues("test"); + + try { + SCATestToolService scaTestTool; + if (bindingchoice.equals("WS")) { + CompositeContext compositeContext = CurrentCompositeContext.getContext(); + scaTestTool = (SCATestToolService) compositeContext.locateService(SCATestToolService.class, "SCATestToolWSReference"); + } else if (bindingchoice.equals("EJB")) { + CompositeContext compositeContext = CurrentCompositeContext.getContext(); + scaTestTool = (SCATestToolService) compositeContext.locateService(SCATestToolService.class, "SCATestToolEJBReference"); + } else { + // assume default binding + CompositeContext compositeContext = CurrentCompositeContext.getContext(); + scaTestTool = (SCATestToolService) compositeContext.locateService(SCATestToolService.class, "SCATestToolSCAReference"); + } + if (selected != null && selected.length != 0) { + for (int i = 0; i < selected.length; i++) { + String value = null; + if (null != selected[i] && selected[i].equals("Ping First Composite")) { + value = scaTestTool.doOneHopPing("brio"); + } else if (null != selected[i] && selected[i].equals("Ping Second Composite")){ + value = scaTestTool.doTwoHopPing("brio"); + } else if (null != selected[i] && selected[i].equals("Data Type Test")){ + value = scaTestTool.doDataTypeTest("brio"); + } else if (null != selected[i] && selected[i].equals("Async One Way")){ + value = "Ut Oh! Test tool not complete for oneway testing"; + } else if (null != selected[i] && selected[i].equals("Async Callback")){ + value = "Ut Oh! Test tool not complete for async testing"; + } else { + value = "Ut Oh! unknown test"; + } + +%> + +
+Results from <%=selected[i]%> test with <%=bindingchoice%> binding: +

<%=value%> + <% + } //for + } //if + + }catch(Exception e){ + e.printStackTrace(); + StringWriter sw= new StringWriter(); + PrintWriter pw= new PrintWriter(sw); + + e.printStackTrace(pw); + pw.flush(); + +%> + Whoops!
+

+    Exception "<%=e.getClass().getName()%>" Exception message: "<%=e.getMessage()%>"
+ <%=sw.toString() %> +
+<% } //catch + +%> + + + \ No newline at end of file diff --git a/branches/sca-java-integration/testing/sca/itest/bindings/bindingsclient/src/main/webapp/WEB-INF/web.xml b/branches/sca-java-integration/testing/sca/itest/bindings/bindingsclient/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000000..b25586f096 --- /dev/null +++ b/branches/sca-java-integration/testing/sca/itest/bindings/bindingsclient/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,10 @@ + + + + SCA Test Service Driver + + SCATestTool.jsp + + diff --git a/branches/sca-java-integration/testing/sca/itest/bindings/bindingsclient/src/test/java/org/apache/tuscany/sca/itest/SCATestToolServerTest.java b/branches/sca-java-integration/testing/sca/itest/bindings/bindingsclient/src/test/java/org/apache/tuscany/sca/itest/SCATestToolServerTest.java new file mode 100644 index 0000000000..7429b25dfc --- /dev/null +++ b/branches/sca-java-integration/testing/sca/itest/bindings/bindingsclient/src/test/java/org/apache/tuscany/sca/itest/SCATestToolServerTest.java @@ -0,0 +1,27 @@ +package org.apache.tuscany.sca.itest; + + +import java.io.IOException; +import java.net.Socket; + +import junit.framework.TestCase; + +import org.apache.tuscany.api.SCARuntime; + +public class SCATestToolServerTest extends TestCase { + + @Override + protected void setUp() throws Exception { + SCARuntime.start("bindingscomposite-system.composite", "bindingscomposite.composite"); + } + + public void testPing() throws IOException { + new Socket("127.0.0.1", 8080); + } + + @Override + protected void tearDown() throws Exception { + SCARuntime.stop(); + } + +} diff --git a/branches/sca-java-integration/testing/sca/itest/bindings/bindingsclient/src/test/java/org/apache/tuscany/sca/itest/WSBindingsClientTestCase.java b/branches/sca-java-integration/testing/sca/itest/bindings/bindingsclient/src/test/java/org/apache/tuscany/sca/itest/WSBindingsClientTestCase.java new file mode 100644 index 0000000000..d14a438ee4 --- /dev/null +++ b/branches/sca-java-integration/testing/sca/itest/bindings/bindingsclient/src/test/java/org/apache/tuscany/sca/itest/WSBindingsClientTestCase.java @@ -0,0 +1,80 @@ +/* + * 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 java.lang.reflect.UndeclaredThrowableException; + +import junit.framework.TestCase; + +import org.apache.tuscany.api.SCARuntime; +import org.apache.tuscany.core.test.SCATestCaseRunner; +import org.apache.tuscany.sca.util.SCATestUtilityServerTest; +import org.osoa.sca.CompositeContext; +import org.osoa.sca.CurrentCompositeContext; + +public class WSBindingsClientTestCase extends TestCase { + private SCATestToolService scaTestTool; + + private SCATestCaseRunner toolServer; + private SCATestCaseRunner utilityServer; + + // Hops over one composite + /*public void testOneHopPing() throws Throwable { + try { + assertTrue(scaTestTool.doOneHopPing("brio").contains("brio")); + } catch (UndeclaredThrowableException e) { + throw (e.getCause()); + } + }*/ + + // Hops over two composites + public void testTwoHopPing() { + assertTrue(scaTestTool.doTwoHopPing("brio").contains("brio")); + } + + protected void setUp() throws Exception { + SCARuntime.start("bindingsclient.composite"); + + toolServer = new SCATestCaseRunner(SCATestToolServerTest.class); + toolServer.setUp(); + utilityServer = new SCATestCaseRunner(SCATestUtilityServerTest.class); + utilityServer.setUp(); + + CompositeContext cc = CurrentCompositeContext.getContext(); + System.out.println("Composite Name = " + cc.getName()); + System.out.println(CurrentCompositeContext.getContext()); + scaTestTool = + (SCATestToolService)CurrentCompositeContext.getContext().locateService(SCATestToolService.class, + "SCATestToolWSReference"); + if (scaTestTool == null) { + System.out.println("Yo Yo It is null"); + } else { + System.out.println("Yo Yo It is not null: " + scaTestTool); + } + + } + + @Override + protected void tearDown() throws Exception { + SCARuntime.stop(); + toolServer.tearDown(); + utilityServer.tearDown(); + } +} diff --git a/branches/sca-java-integration/testing/sca/itest/bindings/bindingsclient/src/test/java/org/apache/tuscany/sca/util/SCATestUtilityServerTest.java b/branches/sca-java-integration/testing/sca/itest/bindings/bindingsclient/src/test/java/org/apache/tuscany/sca/util/SCATestUtilityServerTest.java new file mode 100644 index 0000000000..286ff0f4a1 --- /dev/null +++ b/branches/sca-java-integration/testing/sca/itest/bindings/bindingsclient/src/test/java/org/apache/tuscany/sca/util/SCATestUtilityServerTest.java @@ -0,0 +1,28 @@ +package org.apache.tuscany.sca.util; + + + +import java.io.IOException; +import java.net.Socket; + +import org.apache.tuscany.api.SCARuntime; + +import junit.framework.TestCase; + +public class SCATestUtilityServerTest extends TestCase { + + @Override + protected void setUp() throws Exception { + SCARuntime.start("bindingsutility-system.composite", "bindingsutility.composite"); + } + + public void testPing() throws IOException { + new Socket("127.0.0.1", 8081); + } + + @Override + protected void tearDown() throws Exception { + SCARuntime.stop(); + } + +} -- cgit v1.2.3