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 --- .../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 | 130 ++++ .../bindingsclient/src/main/webapp/WEB-INF/web.xml | 31 + .../tuscany/sca/itest/SCATestToolServerTest.java | 45 ++ .../sca/itest/WSBindingsClientTestCase.java | 80 +++ .../tuscany/sca/util/SCATestUtilityServerTest.java | 46 ++ .../itest/bindings/bindingscomposite/pom.xml | 58 ++ .../tuscany/sca/itest/SCADataTypeHelper.java | 341 ++++++++++ .../sca/itest/SCADataTypeHelperException.java | 29 + .../sca/itest/SCATestToolCallbackService.java | 27 + .../tuscany/sca/itest/SCATestToolServer.java | 46 ++ .../tuscany/sca/itest/SCATestToolService.java | 39 ++ .../tuscany/sca/itest/SCATestToolServiceImpl.java | 76 +++ .../tuscany/sca/util/SCATestUtilityService.java | 64 ++ .../resources/bindingscomposite-system.composite | 36 ++ .../src/main/resources/bindingscomposite.composite | 49 ++ .../src/main/resources/wsdl/testtool.wsdl | 272 ++++++++ .../src/main/resources/wsdl/testutility.wsdl | 704 +++++++++++++++++++++ .../sca/itest/SCATestToolServerTestCase.java | 45 ++ .../itest/bindings/bindingsutility/pom.xml | 59 ++ .../sca/itest/SCATestToolCallbackService.java | 28 + .../tuscany/sca/util/SCATestUtilityServer.java | 46 ++ .../tuscany/sca/util/SCATestUtilityService.java | 64 ++ .../sca/util/SCATestUtilityServiceImpl.java | 157 +++++ .../resources/bindingsutility-system.composite | 36 ++ .../src/main/resources/bindingsutility.composite | 39 ++ .../src/main/resources/wsdl/testutility.wsdl | 704 +++++++++++++++++++++ .../sca/util/SCATestUtilityServerTestCase.java | 45 ++ .../sca/0.90-rc1-incubating/itest/bindings/pom.xml | 42 ++ 32 files changed, 3761 insertions(+) create mode 100644 tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsclient/pom.xml create mode 100644 tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsclient/src/main/java/org/apache/tuscany/sca/itest/SCATestToolService.java create mode 100644 tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsclient/src/main/resources/bindingsclient.composite create mode 100644 tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsclient/src/main/resources/wsdl/testtool.wsdl create mode 100644 tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsclient/src/main/webapp/SCATestTool.jsp create mode 100644 tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsclient/src/main/webapp/WEB-INF/web.xml create mode 100644 tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsclient/src/test/java/org/apache/tuscany/sca/itest/SCATestToolServerTest.java create mode 100644 tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsclient/src/test/java/org/apache/tuscany/sca/itest/WSBindingsClientTestCase.java create mode 100644 tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsclient/src/test/java/org/apache/tuscany/sca/util/SCATestUtilityServerTest.java create mode 100644 tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingscomposite/pom.xml create mode 100644 tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingscomposite/src/main/java/org/apache/tuscany/sca/itest/SCADataTypeHelper.java create mode 100644 tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingscomposite/src/main/java/org/apache/tuscany/sca/itest/SCADataTypeHelperException.java create mode 100644 tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingscomposite/src/main/java/org/apache/tuscany/sca/itest/SCATestToolCallbackService.java create mode 100644 tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingscomposite/src/main/java/org/apache/tuscany/sca/itest/SCATestToolServer.java create mode 100644 tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingscomposite/src/main/java/org/apache/tuscany/sca/itest/SCATestToolService.java create mode 100644 tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingscomposite/src/main/java/org/apache/tuscany/sca/itest/SCATestToolServiceImpl.java create mode 100644 tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingscomposite/src/main/java/org/apache/tuscany/sca/util/SCATestUtilityService.java create mode 100644 tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingscomposite/src/main/resources/bindingscomposite-system.composite create mode 100644 tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingscomposite/src/main/resources/bindingscomposite.composite create mode 100644 tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingscomposite/src/main/resources/wsdl/testtool.wsdl create mode 100644 tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingscomposite/src/main/resources/wsdl/testutility.wsdl create mode 100644 tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingscomposite/src/test/java/org/apache/tuscany/sca/itest/SCATestToolServerTestCase.java create mode 100644 tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsutility/pom.xml create mode 100644 tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsutility/src/main/java/org/apache/tuscany/sca/itest/SCATestToolCallbackService.java create mode 100644 tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsutility/src/main/java/org/apache/tuscany/sca/util/SCATestUtilityServer.java create mode 100644 tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsutility/src/main/java/org/apache/tuscany/sca/util/SCATestUtilityService.java create mode 100644 tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsutility/src/main/java/org/apache/tuscany/sca/util/SCATestUtilityServiceImpl.java create mode 100644 tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsutility/src/main/resources/bindingsutility-system.composite create mode 100644 tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsutility/src/main/resources/bindingsutility.composite create mode 100644 tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsutility/src/main/resources/wsdl/testutility.wsdl create mode 100644 tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsutility/src/test/java/org/apache/tuscany/sca/util/SCATestUtilityServerTestCase.java create mode 100644 tags/java/sca/0.90-rc1-incubating/itest/bindings/pom.xml (limited to 'tags/java/sca/0.90-rc1-incubating/itest/bindings') diff --git a/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsclient/pom.xml b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsclient/pom.xml new file mode 100644 index 0000000000..3626b05d54 --- /dev/null +++ b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsclient/pom.xml @@ -0,0 +1,64 @@ + + + + + + org.apache.tuscany.testing + sca-itest + 0.90-incubating + ../../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.90-incubating + + + + org.apache.tuscany.testing.bindingstest + tuscany-itest-bindings-bindingsutility + 0.90-incubating + + + + org.apache.tuscany.sca.services.databinding + databinding-sdo + 0.90-incubating + + + + commonj + sdo-api-r2.1 + 1.0-incubating-beta1 + runtime + + + + diff --git a/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsclient/src/main/java/org/apache/tuscany/sca/itest/SCATestToolService.java b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsclient/src/main/java/org/apache/tuscany/sca/itest/SCATestToolService.java new file mode 100644 index 0000000000..44801846f6 --- /dev/null +++ b/tags/java/sca/0.90-rc1-incubating/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/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsclient/src/main/resources/bindingsclient.composite b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsclient/src/main/resources/bindingsclient.composite new file mode 100644 index 0000000000..ca3ff6494e --- /dev/null +++ b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsclient/src/main/resources/bindingsclient.composite @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + diff --git a/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsclient/src/main/resources/wsdl/testtool.wsdl b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsclient/src/main/resources/wsdl/testtool.wsdl new file mode 100644 index 0000000000..22d7070ec3 --- /dev/null +++ b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsclient/src/main/resources/wsdl/testtool.wsdl @@ -0,0 +1,272 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsclient/src/main/webapp/SCATestTool.jsp b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsclient/src/main/webapp/SCATestTool.jsp new file mode 100644 index 0000000000..eb219e4cef --- /dev/null +++ b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsclient/src/main/webapp/SCATestTool.jsp @@ -0,0 +1,130 @@ +<%--/* + * 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. + */ + --%> + + +<%-- + * 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/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsclient/src/main/webapp/WEB-INF/web.xml b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsclient/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000000..fd58cb8b0e --- /dev/null +++ b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsclient/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,31 @@ + + + + + + SCA Test Service Driver + + SCATestTool.jsp + + diff --git a/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsclient/src/test/java/org/apache/tuscany/sca/itest/SCATestToolServerTest.java b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsclient/src/test/java/org/apache/tuscany/sca/itest/SCATestToolServerTest.java new file mode 100644 index 0000000000..8467074c26 --- /dev/null +++ b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsclient/src/test/java/org/apache/tuscany/sca/itest/SCATestToolServerTest.java @@ -0,0 +1,45 @@ +/* + * 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.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/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsclient/src/test/java/org/apache/tuscany/sca/itest/WSBindingsClientTestCase.java b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsclient/src/test/java/org/apache/tuscany/sca/itest/WSBindingsClientTestCase.java new file mode 100644 index 0000000000..b5f076b7e8 --- /dev/null +++ b/tags/java/sca/0.90-rc1-incubating/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/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsclient/src/test/java/org/apache/tuscany/sca/util/SCATestUtilityServerTest.java b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsclient/src/test/java/org/apache/tuscany/sca/util/SCATestUtilityServerTest.java new file mode 100644 index 0000000000..0f6cb912a7 --- /dev/null +++ b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsclient/src/test/java/org/apache/tuscany/sca/util/SCATestUtilityServerTest.java @@ -0,0 +1,46 @@ +/* + * 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.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(); + } + +} diff --git a/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingscomposite/pom.xml b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingscomposite/pom.xml new file mode 100644 index 0000000000..4f0a58a1a5 --- /dev/null +++ b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingscomposite/pom.xml @@ -0,0 +1,58 @@ + + + + + org.apache.tuscany.testing + sca-itest + 0.90-incubating + ../../pom.xml + + 4.0.0 + org.apache.tuscany.testing.bindingstest + tuscany-itest-bindings-bindingscomposite + jar + SCA FVT Bindings Test Tool Service Composite + + + + org.apache.tuscany.sca.services.databinding + databinding-sdo + 0.90-incubating + + + + commonj + sdo-api-r2.1 + 1.0-incubating-beta1 + runtime + + + + + org.apache.tuscany.sdo + tuscany-sdo-impl + 1.0-incubating-beta1 + runtime + + + + + diff --git a/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingscomposite/src/main/java/org/apache/tuscany/sca/itest/SCADataTypeHelper.java b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingscomposite/src/main/java/org/apache/tuscany/sca/itest/SCADataTypeHelper.java new file mode 100644 index 0000000000..efe30c4f4e --- /dev/null +++ b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingscomposite/src/main/java/org/apache/tuscany/sca/itest/SCADataTypeHelper.java @@ -0,0 +1,341 @@ +/* + * 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.math.BigDecimal; +import java.math.BigInteger; +import java.util.Date; +import java.util.GregorianCalendar; +import java.util.Random; +import java.util.Vector; + +import org.apache.tuscany.sca.util.SCATestUtilityService; + +public class SCADataTypeHelper { + + Date date; + Random ran; + SCATestUtilityService scaUtil; // change this to be the service provider + + public SCADataTypeHelper(SCATestUtilityService util) { + date = new Date(); + ran = new Random(date.getTime()); + scaUtil = util; + } + + public StringBuffer test_char() throws SCADataTypeHelperException { + + char x = 'a'; + x += ran.nextInt(26); // get a char a-z + StringBuffer rc = new StringBuffer("\nchar datatype test sending ==> " + x); + try { + char y = scaUtil.echo_char(x); + if (x == y) { + rc.append("\nchar successfully received ==> " + y); + } else { + throw new SCADataTypeHelperException(rc + "\nDatatype exception: char ==> " + y); + } + } catch (Exception e) { + throw new SCADataTypeHelperException("\nRemote exception from scaUtil.echo_char\n" + e.toString()); + } + return rc; + } + + public StringBuffer test_String() throws SCADataTypeHelperException { + + String x = date.toString(); + StringBuffer rc = new StringBuffer("\nString datatype test sending ==> " + x); + try { + String y = scaUtil.echo_String(x); + if (x.equals(y)) { + rc.append("\nString successfully received ==> " + y); + } else { + throw new SCADataTypeHelperException(rc + "\nDatatype exception: String ==> " + y); + } + } catch (Exception e) { + throw new SCADataTypeHelperException("\nRemote exception from scaUtil.echo_String\n" + e.toString()); + } + return rc; + } + + public StringBuffer test_int() throws SCADataTypeHelperException { + + int x = ran.nextInt(); + StringBuffer rc = new StringBuffer("\nint datatype test sending ==> " + x); + try { + int y = scaUtil.echo_int(x); + if (x == y) { + rc.append("\nint successfully received ==> " + y); + } else { + throw new SCADataTypeHelperException(rc + "\nDatatype exception: int ==> " + y); + } + } catch (Exception e) { + throw new SCADataTypeHelperException("\nRemote exception from scaUtil.echo_int\n" + e.toString()); + } + return rc; + } + + public StringBuffer test_boolean() throws SCADataTypeHelperException { + + boolean x = ran.nextBoolean(); + StringBuffer rc = new StringBuffer("\nboolean datatype test sending ==> " + x); + try { + boolean y = scaUtil.echo_boolean(x); + if (x == y) { + rc.append("\nboolean successfully received ==> " + y); + } else { + throw new SCADataTypeHelperException(rc + "\nDatatype exception: boolean ==> " + y); + } + } catch (Exception e) { + throw new SCADataTypeHelperException("\nRemote exception from scaUtil.echo_boolean\n" + e.toString()); + } + return rc; + } + + public StringBuffer test_long() throws SCADataTypeHelperException { + + long x = ran.nextLong(); + StringBuffer rc = new StringBuffer("\nlong datatype test sending ==> " + x); + try { + long y = scaUtil.echo_long(x); + if (x == y) { + rc.append("\nlong successfully received ==> " + y); + } else { + throw new SCADataTypeHelperException(rc + "\nDatatype exception: long ==> " + y); + } + } catch (Exception e) { + throw new SCADataTypeHelperException("\nRemote exception from scaUtil.echo_long\n" + e.toString()); + } + return rc; + } + + public StringBuffer test_short() throws SCADataTypeHelperException { + + short x = (short)ran.nextInt(); + StringBuffer rc = new StringBuffer("\nshort datatype test sending ==> " + x); + try { + short y = scaUtil.echo_short(x); + if (x == y) { + rc.append("\nshort successfully received ==> " + y); + } else { + throw new SCADataTypeHelperException(rc + "\nDatatype exception: short ==> " + y); + } + } catch (Exception e) { + throw new SCADataTypeHelperException("\nRemote exception from scaUtil.echo_short\n" + e.toString()); + } + return rc; + } + + public StringBuffer test_float() throws SCADataTypeHelperException { + + float x = ran.nextFloat(); + StringBuffer rc = new StringBuffer("\nfloat datatype test sending ==> " + x); + try { + float y = scaUtil.echo_float(x); + if (x == y) { + rc.append("\nfloat successfully received ==> " + y); + } else { + throw new SCADataTypeHelperException(rc + "\nDatatype exception: float ==> " + y); + } + } catch (Exception e) { + throw new SCADataTypeHelperException("\nRemote exception from scaUtil.echo_float " + e.toString()); + } + return rc; + } + + public StringBuffer test_double() throws SCADataTypeHelperException { + + double x = ran.nextDouble(); + StringBuffer rc = new StringBuffer("\ndouble datatype test sending ==> " + x); + try { + double y = scaUtil.echo_double(x); + if (x == y) { + rc.append("\ndouble successfully received ==> " + y); + } else { + throw new SCADataTypeHelperException(rc + "\nDatatype exception: double ==> " + y); + } + } catch (Exception e) { + throw new SCADataTypeHelperException("\nRemote exception from scaUtil.echo_double\n" + e.toString()); + } + return rc; + } + + public StringBuffer test_BigInteger() throws SCADataTypeHelperException { + + BigInteger x = new BigInteger(ran.nextInt(32) + 32, ran); // between + // 32 - 64 + // bitLength + StringBuffer rc = new StringBuffer("\nBigInteger datatype test sending ==> " + x); + try { + BigInteger y = scaUtil.echo_BigInteger(x); + if (x.equals(y)) { + rc.append("\nBigInteger successfully received ==> " + y); + } else { + throw new SCADataTypeHelperException("\n" + rc + "\nDatatype exception: BigInteger ==> " + y); + } + } catch (Exception e) { + throw new SCADataTypeHelperException("\nRemote exception from scaUtil.echo_BigInteger\n" + e.toString()); + } + return rc; + } + + public StringBuffer test_BigDecimal() throws SCADataTypeHelperException { + + BigDecimal x = new BigDecimal(ran.nextDouble()); + StringBuffer rc = new StringBuffer("\nBigDecimal datatype test sending ==> " + x); + try { + BigDecimal y = scaUtil.echo_BigDecimal(x); + if (x.equals(y)) { + rc.append("\nBigDecimal successfully received ==> " + y); + } else { + throw new SCADataTypeHelperException("\n" + rc + "\nDatatype exception: BigDecimal ==> " + y); + } + } catch (Exception e) { + throw new SCADataTypeHelperException("\nRemote exception from scaUtil.echo_BigDecimal\n" + e.toString()); + } + return rc; + } + + private StringBuffer test_Vector() throws SCADataTypeHelperException { + + Vector vector = new Vector(); + vector.addElement("DanW"); + vector.addElement(new Float(2000F)); + vector.addElement(new Short((short)11)); + StringBuffer rc = new StringBuffer("\nVector datatype test sending ==> " + vector.toString()); + boolean passed = true; + try { + Vector y = scaUtil.echo_Vector(vector); + if (((String)y.elementAt(0)).equals("DanW")) { + rc.append("\nVector element 0 string " + y.elementAt(0) + " successfully recieved"); + } else { + passed = false; + } + if ((((Float)y.elementAt(1)).equals((Float)vector.elementAt(1)))) { + rc.append("\nVector element 1 Float " + y.elementAt(1) + " successfully recieved"); + } else { + passed = false; + } + if (y.elementAt(2).equals(vector.elementAt(2))) { + rc.append("\nVector element 2 (Short) " + y.elementAt(2) + " successfully received"); + } else { + passed = false; + } + if (!passed) { + // + // one of the tests failed + // + rc.append("\nVector element 0 (String) " + y.elementAt(0) + " should be \"DanW\""); + rc.append("\nVector element 1 (Float) " + y.elementAt(1) + " should be \"2000F\""); + rc.append("\nVector element 2 (Short) " + y.elementAt(2) + " should be \"11\""); + throw new SCADataTypeHelperException("\n" + rc + "\nDataType exception: Vector ==> " + y); + } + } catch (Exception e) { + throw new SCADataTypeHelperException("\nRemote exception from scaUtil.echo_Vector\n" + e.toString()); + } + return rc; + } + + public StringBuffer test_GregorianCalendar() throws SCADataTypeHelperException { + + GregorianCalendar x = new GregorianCalendar(); + StringBuffer rc = new StringBuffer("\nGregorianCalendar datatype test sending ==> " + x.toString()); + try { + GregorianCalendar y = scaUtil.echo_GregorianCalendar(x); + if (x.equals(y)) { + rc.append("\nGregorianCalendar successfully received ==> " + y); + } else { + throw new SCADataTypeHelperException("\n" + rc + "\nDatatype exception: GregorianCalendar ==> " + y); + } + } catch (Exception e) { + throw new SCADataTypeHelperException("\nRemote exception from scaUtil.echo_GregorianCalendar\n" + e + .toString()); + } + return rc; + } + + public StringBuffer doDataType() { + + StringBuffer rc = new StringBuffer(); + try { + rc.append(test_boolean()); + } catch (SCADataTypeHelperException e) { + rc.append("\n" + e.toString() + "\n"); + } + try { + rc.append(test_char()); + } catch (SCADataTypeHelperException e) { + rc.append("\n" + e.toString() + "\n"); + } + try { + rc.append(test_String()); + } catch (SCADataTypeHelperException e) { + rc.append("\n" + e.toString() + "\n"); + } + try { + rc.append(test_int()); + } catch (SCADataTypeHelperException e) { + rc.append("\n" + e.toString()); + } + try { + rc.append(test_long()); + } catch (SCADataTypeHelperException e) { + rc.append("\n" + e.toString() + "\n"); + } + try { + rc.append(test_short()); + } catch (SCADataTypeHelperException e) { + rc.append("\n" + e.toString() + "\n"); + } + try { + rc.append(test_float()); + } catch (SCADataTypeHelperException e) { + rc.append("\n" + e.toString() + "\n"); + } + try { + rc.append(test_double()); + } catch (SCADataTypeHelperException e) { + rc.append("\n" + e.toString() + "\n"); + } + try { + rc.append(test_BigInteger()); + } catch (SCADataTypeHelperException e) { + rc.append("\n" + e.toString() + "\n"); + } + try { + rc.append(test_BigDecimal()); + } catch (SCADataTypeHelperException e) { + rc.append("\n" + e.toString() + "\n"); + } + try { + rc.append(test_Vector()); + } catch (SCADataTypeHelperException e) { + rc.append("\n" + e.toString() + "\n"); + } + try { + rc.append(test_GregorianCalendar()); + } catch (SCADataTypeHelperException e) { + rc.append("\n" + e.toString() + "\n"); + } catch (Exception e) { + rc.append("\n" + e.toString() + "\n"); + } + + return rc; + } +} diff --git a/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingscomposite/src/main/java/org/apache/tuscany/sca/itest/SCADataTypeHelperException.java b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingscomposite/src/main/java/org/apache/tuscany/sca/itest/SCADataTypeHelperException.java new file mode 100644 index 0000000000..074fba8057 --- /dev/null +++ b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingscomposite/src/main/java/org/apache/tuscany/sca/itest/SCADataTypeHelperException.java @@ -0,0 +1,29 @@ +/* + * 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; + +public class SCADataTypeHelperException extends Exception { + + public SCADataTypeHelperException() { + } + + public SCADataTypeHelperException(String msg) { + super(msg); + } +} diff --git a/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingscomposite/src/main/java/org/apache/tuscany/sca/itest/SCATestToolCallbackService.java b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingscomposite/src/main/java/org/apache/tuscany/sca/itest/SCATestToolCallbackService.java new file mode 100644 index 0000000000..c55e22c905 --- /dev/null +++ b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingscomposite/src/main/java/org/apache/tuscany/sca/itest/SCATestToolCallbackService.java @@ -0,0 +1,27 @@ +/* + * 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; + +/** + * SCA Test Tool Callback Service + */ +public interface SCATestToolCallbackService { + + public void pingCallBack(String reply); +} diff --git a/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingscomposite/src/main/java/org/apache/tuscany/sca/itest/SCATestToolServer.java b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingscomposite/src/main/java/org/apache/tuscany/sca/itest/SCATestToolServer.java new file mode 100644 index 0000000000..44e799a566 --- /dev/null +++ b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingscomposite/src/main/java/org/apache/tuscany/sca/itest/SCATestToolServer.java @@ -0,0 +1,46 @@ +/* + * 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.io.IOException; + +import org.apache.tuscany.api.SCARuntime; + +public class SCATestToolServer { + + /** + * @param args + */ + public static void main(String[] args) { + + SCARuntime.start("bindingscomposite-system.composite", "bindingscomposite.composite"); + + try { + System.out.println("SCATestTool server started"); + System.in.read(); + } catch (IOException e) { + e.printStackTrace(); + } + + SCARuntime.stop(); + System.out.println("SCATestTool server stopped"); + } + +} diff --git a/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingscomposite/src/main/java/org/apache/tuscany/sca/itest/SCATestToolService.java b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingscomposite/src/main/java/org/apache/tuscany/sca/itest/SCATestToolService.java new file mode 100644 index 0000000000..67b7e8eb64 --- /dev/null +++ b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingscomposite/src/main/java/org/apache/tuscany/sca/itest/SCATestToolService.java @@ -0,0 +1,39 @@ +/* + * 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/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingscomposite/src/main/java/org/apache/tuscany/sca/itest/SCATestToolServiceImpl.java b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingscomposite/src/main/java/org/apache/tuscany/sca/itest/SCATestToolServiceImpl.java new file mode 100644 index 0000000000..e207a23927 --- /dev/null +++ b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingscomposite/src/main/java/org/apache/tuscany/sca/itest/SCATestToolServiceImpl.java @@ -0,0 +1,76 @@ +/* + * 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.apache.tuscany.sca.util.SCATestUtilityService; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +/** + * SCA Test Service Implementation + */ + +@Service(SCATestToolService.class) +public class SCATestToolServiceImpl implements SCATestToolService, SCATestToolCallbackService { + @Reference + public SCATestUtilityService scaTestUtil; + + private String callbackBuffer = null; + + public String doOneHopPing(String input) { + System.out.println("Invoking SCATestToolServiceImpl.doOneHopPing()"); + StringBuffer rc = new StringBuffer(); + rc.append("doOneHopPing(): "); + rc.append(input); + return rc.toString(); + } + + public String doTwoHopPing(String input) { + System.out.println("Invoking SCATestToolServiceImpl.doTwoHopPing()"); + StringBuffer rc = new StringBuffer(); + rc.append("doTwoHopPing(): "); + rc.append(input); + rc.append(" --> "); + rc.append(scaTestUtil.ping(input)); + return rc.toString(); + } + + public String doDataTypeTest(String input) { + StringBuffer rc = new StringBuffer(); + rc.append("doDataTypeTest(): "); + rc.append(input); + rc.append(" --> "); + SCADataTypeHelper dataHelper = new SCADataTypeHelper(scaTestUtil); + rc.append(dataHelper.doDataType()); + return rc.toString(); + } + + public void pingCallBack(String reply) { + callbackBuffer = reply; + } + + public String getCallbackBuffer() { + return callbackBuffer; + } + + public void clearCallbackBuffer() { + callbackBuffer = null; + } + +} diff --git a/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingscomposite/src/main/java/org/apache/tuscany/sca/util/SCATestUtilityService.java b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingscomposite/src/main/java/org/apache/tuscany/sca/util/SCATestUtilityService.java new file mode 100644 index 0000000000..0ceb553727 --- /dev/null +++ b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingscomposite/src/main/java/org/apache/tuscany/sca/util/SCATestUtilityService.java @@ -0,0 +1,64 @@ +/* + * 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.util; + +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Vector; +import java.util.GregorianCalendar; + +import org.apache.tuscany.sca.itest.SCATestToolCallbackService; +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Remotable; + +/** + * SCA Test Utility Service + */ + +@Remotable +public interface SCATestUtilityService { + public String ping(String input); + + @Callback(SCATestToolCallbackService.class) + public void asyncping(); + + public int echo_int(int input); + + public short echo_short(short input); + + public long echo_long(long input); + + public float echo_float(float input); + + public double echo_double(double input); + + public boolean echo_boolean(boolean input); + + public char echo_char(char input); + + public String echo_String(String input); + + public BigDecimal echo_BigDecimal(BigDecimal input); + + public BigInteger echo_BigInteger(BigInteger input); + + public Vector echo_Vector(Vector input); + + public GregorianCalendar echo_GregorianCalendar(GregorianCalendar input); +} diff --git a/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingscomposite/src/main/resources/bindingscomposite-system.composite b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingscomposite/src/main/resources/bindingscomposite-system.composite new file mode 100644 index 0000000000..c288471c14 --- /dev/null +++ b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingscomposite/src/main/resources/bindingscomposite-system.composite @@ -0,0 +1,36 @@ + + + + + + + + + + 8080 + + + diff --git a/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingscomposite/src/main/resources/bindingscomposite.composite b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingscomposite/src/main/resources/bindingscomposite.composite new file mode 100644 index 0000000000..33f9f713c2 --- /dev/null +++ b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingscomposite/src/main/resources/bindingscomposite.composite @@ -0,0 +1,49 @@ + + + + + + + + + + + SCATestToolWSServiceComponent + + + + + + SCATestUtilityWSReference + + + + + + + + + + diff --git a/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingscomposite/src/main/resources/wsdl/testtool.wsdl b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingscomposite/src/main/resources/wsdl/testtool.wsdl new file mode 100644 index 0000000000..729593518d --- /dev/null +++ b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingscomposite/src/main/resources/wsdl/testtool.wsdl @@ -0,0 +1,272 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingscomposite/src/main/resources/wsdl/testutility.wsdl b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingscomposite/src/main/resources/wsdl/testutility.wsdl new file mode 100644 index 0000000000..32d9050a61 --- /dev/null +++ b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingscomposite/src/main/resources/wsdl/testutility.wsdl @@ -0,0 +1,704 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingscomposite/src/test/java/org/apache/tuscany/sca/itest/SCATestToolServerTestCase.java b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingscomposite/src/test/java/org/apache/tuscany/sca/itest/SCATestToolServerTestCase.java new file mode 100644 index 0000000000..f6fe13c112 --- /dev/null +++ b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingscomposite/src/test/java/org/apache/tuscany/sca/itest/SCATestToolServerTestCase.java @@ -0,0 +1,45 @@ +/* + * 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.io.IOException; +import java.net.Socket; + +import junit.framework.TestCase; + +import org.apache.tuscany.api.SCARuntime; + +public class SCATestToolServerTestCase 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/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsutility/pom.xml b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsutility/pom.xml new file mode 100644 index 0000000000..c50c3bca85 --- /dev/null +++ b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsutility/pom.xml @@ -0,0 +1,59 @@ + + + + + org.apache.tuscany.testing + sca-itest + 0.90-incubating + ../../pom.xml + + + 4.0.0 + org.apache.tuscany.testing.bindingstest + tuscany-itest-bindings-bindingsutility + jar + SCA FVT Bindings Test Tool Utility Composite + + + + org.apache.tuscany.sca.services.databinding + databinding-sdo + 0.90-incubating + + + + commonj + sdo-api-r2.1 + 1.0-incubating-beta1 + runtime + + + + + org.apache.tuscany.sdo + tuscany-sdo-impl + 1.0-incubating-beta1 + runtime + + + + + diff --git a/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsutility/src/main/java/org/apache/tuscany/sca/itest/SCATestToolCallbackService.java b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsutility/src/main/java/org/apache/tuscany/sca/itest/SCATestToolCallbackService.java new file mode 100644 index 0000000000..664fb06930 --- /dev/null +++ b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsutility/src/main/java/org/apache/tuscany/sca/itest/SCATestToolCallbackService.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.itest; + +/** + * SCA Test Tool Callback Service + */ + +public interface SCATestToolCallbackService { + + public void pingCallBack(String reply); +} diff --git a/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsutility/src/main/java/org/apache/tuscany/sca/util/SCATestUtilityServer.java b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsutility/src/main/java/org/apache/tuscany/sca/util/SCATestUtilityServer.java new file mode 100644 index 0000000000..cd967e275a --- /dev/null +++ b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsutility/src/main/java/org/apache/tuscany/sca/util/SCATestUtilityServer.java @@ -0,0 +1,46 @@ +/* + * 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.util; + + +import java.io.IOException; + +import org.apache.tuscany.api.SCARuntime; + +public class SCATestUtilityServer { + + /** + * @param args + */ + public static void main(String[] args) { + + SCARuntime.start("bindingsutility-system.composite", "bindingsutility.composite"); + + try { + System.out.println("SCATestUtility server started"); + System.in.read(); + } catch (IOException e) { + e.printStackTrace(); + } + + SCARuntime.stop(); + System.out.println("SCATestUtility server stopped"); + } + +} diff --git a/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsutility/src/main/java/org/apache/tuscany/sca/util/SCATestUtilityService.java b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsutility/src/main/java/org/apache/tuscany/sca/util/SCATestUtilityService.java new file mode 100644 index 0000000000..0ceb553727 --- /dev/null +++ b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsutility/src/main/java/org/apache/tuscany/sca/util/SCATestUtilityService.java @@ -0,0 +1,64 @@ +/* + * 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.util; + +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Vector; +import java.util.GregorianCalendar; + +import org.apache.tuscany.sca.itest.SCATestToolCallbackService; +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Remotable; + +/** + * SCA Test Utility Service + */ + +@Remotable +public interface SCATestUtilityService { + public String ping(String input); + + @Callback(SCATestToolCallbackService.class) + public void asyncping(); + + public int echo_int(int input); + + public short echo_short(short input); + + public long echo_long(long input); + + public float echo_float(float input); + + public double echo_double(double input); + + public boolean echo_boolean(boolean input); + + public char echo_char(char input); + + public String echo_String(String input); + + public BigDecimal echo_BigDecimal(BigDecimal input); + + public BigInteger echo_BigInteger(BigInteger input); + + public Vector echo_Vector(Vector input); + + public GregorianCalendar echo_GregorianCalendar(GregorianCalendar input); +} diff --git a/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsutility/src/main/java/org/apache/tuscany/sca/util/SCATestUtilityServiceImpl.java b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsutility/src/main/java/org/apache/tuscany/sca/util/SCATestUtilityServiceImpl.java new file mode 100644 index 0000000000..e752e4d6e6 --- /dev/null +++ b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsutility/src/main/java/org/apache/tuscany/sca/util/SCATestUtilityServiceImpl.java @@ -0,0 +1,157 @@ +/* + * 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.util; + +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.InetAddress; +import java.util.GregorianCalendar; +import java.util.Properties; +import java.util.Vector; + +import org.osoa.sca.annotations.Service; + +@Service(SCATestUtilityService.class) +public class SCATestUtilityServiceImpl implements SCATestUtilityService { + + // private SCATestToolCallbackService utilCallBack; + + /** + * The setter used by the runtime to set the callback reference + * + * @param myServiceCallback + */ + + // @Callback + // public void setCallback(SCATestToolCallbackService utilCallBack) { + // this.utilCallBack = utilCallBack; + // } + public String ping(String input) { + System.out.println("Invoking SCATestUtilityServiceImpl.ping()"); + StringBuffer rc = new StringBuffer(); + + try { + // get a systems property object + Properties sp = System.getProperties(); + rc.append("Pinged SCA Test Utility Service on: "); + // get operating system info + rc.append(sp.getProperty("os.name")); + rc.append(", " + sp.getProperty("os.version")); + // get network info + rc.append(" - " + InetAddress.getLocalHost().toString()); + } catch (Exception e) { + System.out.println("\nException preparing system infomation for ping service reply\n" + e.toString()); + e.printStackTrace(); + } + return rc.toString(); + } + + public void asyncping() { + + StringBuffer rc = new StringBuffer(); + + try { + // get a systems property object + Properties sp = System.getProperties(); + rc.append("Pinged SCA Test Utility Service on: "); + // get operating system info + rc.append(sp.getProperty("os.name")); + rc.append(", " + sp.getProperty("os.version")); + // get network info + rc.append(" - " + InetAddress.getLocalHost().toString()); + } catch (Exception e) { + System.out.println("\nException preparing system infomation for ping service reply\n" + e.toString()); + e.printStackTrace(); + } + // utilCallBack.pingCallBack(rc.toString()); + } + + public int echo_int(int input) { + int local; + local = input; + return local; + } + + public short echo_short(short input) { + short local; + local = input; + return local; + } + + public long echo_long(long input) { + long local; + local = input; + return local; + } + + public float echo_float(float input) { + float local; + local = input; + return local; + } + + public double echo_double(double input) { + double local; + local = input; + return local; + } + + public boolean echo_boolean(boolean input) { + boolean local; + local = input; + return local; + } + + public char echo_char(char input) { + char local; + local = input; + return local; + } + + public String echo_String(String input) { + String local; + local = input; + return local; + } + + public BigDecimal echo_BigDecimal(BigDecimal input) { + BigDecimal local; + local = input; + return local; + } + + public BigInteger echo_BigInteger(BigInteger input) { + BigInteger local; + local = input; + return local; + } + + public Vector echo_Vector(Vector input) { + Vector local; + local = input; + return local; + } + + public GregorianCalendar echo_GregorianCalendar(GregorianCalendar input) { + GregorianCalendar local; + local = input; + return local; + } + +} diff --git a/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsutility/src/main/resources/bindingsutility-system.composite b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsutility/src/main/resources/bindingsutility-system.composite new file mode 100644 index 0000000000..7126b78572 --- /dev/null +++ b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsutility/src/main/resources/bindingsutility-system.composite @@ -0,0 +1,36 @@ + + + + + + + + + + 8081 + + + diff --git a/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsutility/src/main/resources/bindingsutility.composite b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsutility/src/main/resources/bindingsutility.composite new file mode 100644 index 0000000000..6771b72442 --- /dev/null +++ b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsutility/src/main/resources/bindingsutility.composite @@ -0,0 +1,39 @@ + + + + + + + + + SCATestUtilityWSServiceComponent + + + + + + + + diff --git a/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsutility/src/main/resources/wsdl/testutility.wsdl b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsutility/src/main/resources/wsdl/testutility.wsdl new file mode 100644 index 0000000000..32d9050a61 --- /dev/null +++ b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsutility/src/main/resources/wsdl/testutility.wsdl @@ -0,0 +1,704 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsutility/src/test/java/org/apache/tuscany/sca/util/SCATestUtilityServerTestCase.java b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsutility/src/test/java/org/apache/tuscany/sca/util/SCATestUtilityServerTestCase.java new file mode 100644 index 0000000000..66246fc006 --- /dev/null +++ b/tags/java/sca/0.90-rc1-incubating/itest/bindings/bindingsutility/src/test/java/org/apache/tuscany/sca/util/SCATestUtilityServerTestCase.java @@ -0,0 +1,45 @@ +/* + * 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.util; + + +import java.io.IOException; +import java.net.Socket; + +import org.apache.tuscany.api.SCARuntime; + +import junit.framework.TestCase; + +public class SCATestUtilityServerTestCase 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(); + } + +} diff --git a/tags/java/sca/0.90-rc1-incubating/itest/bindings/pom.xml b/tags/java/sca/0.90-rc1-incubating/itest/bindings/pom.xml new file mode 100644 index 0000000000..34288bd087 --- /dev/null +++ b/tags/java/sca/0.90-rc1-incubating/itest/bindings/pom.xml @@ -0,0 +1,42 @@ + + + + + org.apache.tuscany.testing + sca-itest + 1.0-incubating + ../pom.xml + + + 4.0.0 + org.apache.tuscany.testing + ${testing.version} + bindingstest + pom + SCA FVT Test Tool Suite + + + + bindingscomposite + bindingsutility + bindingsclient + + -- cgit v1.2.3