From 3caf8614f25d6b1962e20331fdf423c863bc02f3 Mon Sep 17 00:00:00 2001 From: lresende Date: Wed, 11 Nov 2009 23:13:31 +0000 Subject: Moving 1.x branches git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@835144 13f79535-47bb-0310-9956-ffa450edef68 --- .../sca/itest/SCATestToolCallbackService.java | 28 + .../tuscany/sca/util/SCATestUtilityServer.java | 28 + .../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 | 27 + 8 files changed, 1083 insertions(+) create mode 100644 sca-java-1.x/branches/sca-java-integration/testing/sca/itest/bindings/bindingsutility/src/main/java/org/apache/tuscany/sca/itest/SCATestToolCallbackService.java create mode 100644 sca-java-1.x/branches/sca-java-integration/testing/sca/itest/bindings/bindingsutility/src/main/java/org/apache/tuscany/sca/util/SCATestUtilityServer.java create mode 100644 sca-java-1.x/branches/sca-java-integration/testing/sca/itest/bindings/bindingsutility/src/main/java/org/apache/tuscany/sca/util/SCATestUtilityService.java create mode 100644 sca-java-1.x/branches/sca-java-integration/testing/sca/itest/bindings/bindingsutility/src/main/java/org/apache/tuscany/sca/util/SCATestUtilityServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-integration/testing/sca/itest/bindings/bindingsutility/src/main/resources/bindingsutility-system.composite create mode 100644 sca-java-1.x/branches/sca-java-integration/testing/sca/itest/bindings/bindingsutility/src/main/resources/bindingsutility.composite create mode 100644 sca-java-1.x/branches/sca-java-integration/testing/sca/itest/bindings/bindingsutility/src/main/resources/wsdl/testutility.wsdl create mode 100644 sca-java-1.x/branches/sca-java-integration/testing/sca/itest/bindings/bindingsutility/src/test/java/org/apache/tuscany/sca/util/SCATestUtilityServerTestCase.java (limited to 'sca-java-1.x/branches/sca-java-integration/testing/sca/itest/bindings/bindingsutility/src') diff --git a/sca-java-1.x/branches/sca-java-integration/testing/sca/itest/bindings/bindingsutility/src/main/java/org/apache/tuscany/sca/itest/SCATestToolCallbackService.java b/sca-java-1.x/branches/sca-java-integration/testing/sca/itest/bindings/bindingsutility/src/main/java/org/apache/tuscany/sca/itest/SCATestToolCallbackService.java new file mode 100644 index 0000000000..664fb06930 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-integration/testing/sca/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/sca-java-1.x/branches/sca-java-integration/testing/sca/itest/bindings/bindingsutility/src/main/java/org/apache/tuscany/sca/util/SCATestUtilityServer.java b/sca-java-1.x/branches/sca-java-integration/testing/sca/itest/bindings/bindingsutility/src/main/java/org/apache/tuscany/sca/util/SCATestUtilityServer.java new file mode 100644 index 0000000000..552454c968 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-integration/testing/sca/itest/bindings/bindingsutility/src/main/java/org/apache/tuscany/sca/util/SCATestUtilityServer.java @@ -0,0 +1,28 @@ +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/sca-java-1.x/branches/sca-java-integration/testing/sca/itest/bindings/bindingsutility/src/main/java/org/apache/tuscany/sca/util/SCATestUtilityService.java b/sca-java-1.x/branches/sca-java-integration/testing/sca/itest/bindings/bindingsutility/src/main/java/org/apache/tuscany/sca/util/SCATestUtilityService.java new file mode 100644 index 0000000000..0ceb553727 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-integration/testing/sca/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/sca-java-1.x/branches/sca-java-integration/testing/sca/itest/bindings/bindingsutility/src/main/java/org/apache/tuscany/sca/util/SCATestUtilityServiceImpl.java b/sca-java-1.x/branches/sca-java-integration/testing/sca/itest/bindings/bindingsutility/src/main/java/org/apache/tuscany/sca/util/SCATestUtilityServiceImpl.java new file mode 100644 index 0000000000..e752e4d6e6 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-integration/testing/sca/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/sca-java-1.x/branches/sca-java-integration/testing/sca/itest/bindings/bindingsutility/src/main/resources/bindingsutility-system.composite b/sca-java-1.x/branches/sca-java-integration/testing/sca/itest/bindings/bindingsutility/src/main/resources/bindingsutility-system.composite new file mode 100644 index 0000000000..7126b78572 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-integration/testing/sca/itest/bindings/bindingsutility/src/main/resources/bindingsutility-system.composite @@ -0,0 +1,36 @@ + + + + + + + + + + 8081 + + + diff --git a/sca-java-1.x/branches/sca-java-integration/testing/sca/itest/bindings/bindingsutility/src/main/resources/bindingsutility.composite b/sca-java-1.x/branches/sca-java-integration/testing/sca/itest/bindings/bindingsutility/src/main/resources/bindingsutility.composite new file mode 100644 index 0000000000..6771b72442 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-integration/testing/sca/itest/bindings/bindingsutility/src/main/resources/bindingsutility.composite @@ -0,0 +1,39 @@ + + + + + + + + + SCATestUtilityWSServiceComponent + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-integration/testing/sca/itest/bindings/bindingsutility/src/main/resources/wsdl/testutility.wsdl b/sca-java-1.x/branches/sca-java-integration/testing/sca/itest/bindings/bindingsutility/src/main/resources/wsdl/testutility.wsdl new file mode 100644 index 0000000000..32d9050a61 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-integration/testing/sca/itest/bindings/bindingsutility/src/main/resources/wsdl/testutility.wsdl @@ -0,0 +1,704 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-integration/testing/sca/itest/bindings/bindingsutility/src/test/java/org/apache/tuscany/sca/util/SCATestUtilityServerTestCase.java b/sca-java-1.x/branches/sca-java-integration/testing/sca/itest/bindings/bindingsutility/src/test/java/org/apache/tuscany/sca/util/SCATestUtilityServerTestCase.java new file mode 100644 index 0000000000..4f1b0bfc3b --- /dev/null +++ b/sca-java-1.x/branches/sca-java-integration/testing/sca/itest/bindings/bindingsutility/src/test/java/org/apache/tuscany/sca/util/SCATestUtilityServerTestCase.java @@ -0,0 +1,27 @@ +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(); + } + +} -- cgit v1.2.3