From 71a7cba384b8ae7f4578fb9ab1f725d5ce616074 Mon Sep 17 00:00:00 2001 From: rfeng Date: Mon, 26 Oct 2009 23:44:59 +0000 Subject: Merge all changes from 1.5.2 branch into trunk git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@830026 13f79535-47bb-0310-9956-ffa450edef68 --- .../sca/binding/ws/axis2/itests/pojo/Data.java | 53 +++++++++++++++++++ .../sca/binding/ws/axis2/itests/pojo/Data2.java | 35 +++++++++++++ .../ws/axis2/itests/pojo/POJOWSTestCase.java | 48 ++++++++++++++++++ .../binding/ws/axis2/itests/pojo/TestService.java | 29 +++++++++++ .../ws/axis2/itests/pojo/TestServiceImpl.java | 59 ++++++++++++++++++++++ .../binding/ws/axis2/itests/pojo/package-info.java | 21 ++++++++ .../binding/ws/axis2/itests/pojo/test.composite | 32 ++++++++++++ 7 files changed, 277 insertions(+) create mode 100644 branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/Data.java create mode 100644 branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/Data2.java create mode 100644 branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/POJOWSTestCase.java create mode 100644 branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/TestService.java create mode 100644 branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/TestServiceImpl.java create mode 100644 branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/package-info.java create mode 100644 branches/sca-java-1.x/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/test.composite (limited to 'branches/sca-java-1.x/modules/binding-ws-axis2/src/test') diff --git a/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/Data.java b/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/Data.java new file mode 100644 index 0000000000..8c1e6b68da --- /dev/null +++ b/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/Data.java @@ -0,0 +1,53 @@ +/* + * 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.binding.ws.axis2.itests.pojo; + +//import java.io.Serializable; + +public class Data { + + private Data2[] a = null; + private int b = 0; + private float c = 0.0f; + + public Data2[] getA() { + return this.a; + } + + public void setA(Data2[] a) { + this.a = a; + } + + public int getB() { + return this.b; + } + + public void setB(int b) { + this.b = b; + } + + public float getC() { + return this.c; + } + + public void setC(float c) { + this.c = c; + } + +} diff --git a/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/Data2.java b/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/Data2.java new file mode 100644 index 0000000000..25954a0603 --- /dev/null +++ b/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/Data2.java @@ -0,0 +1,35 @@ +/* + * 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.binding.ws.axis2.itests.pojo; + +public class Data2 { + + private String[] asdf = null; + + public String[] getAsdf() { + return this.asdf; + } + + public void setAsdf(String[] asdf) { + this.asdf = asdf; + } + + +} diff --git a/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/POJOWSTestCase.java b/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/POJOWSTestCase.java new file mode 100644 index 0000000000..35849ef77b --- /dev/null +++ b/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/POJOWSTestCase.java @@ -0,0 +1,48 @@ +/* + * 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.binding.ws.axis2.itests.pojo; + +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; +import org.junit.Test; + +public class POJOWSTestCase { + + @Test + public void testWS() throws Exception { + + SCAContribution contrib = new SCAContribution("c1", "target/test-classes"); + SCANode node = SCANodeFactory.newInstance().createSCANode("org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/test.composite", contrib); + node.start(); + +// try { +// System.out.println("Test server started (press enter to shutdown)"); +// System.in.read(); +// } +// catch (IOException e) { +// System.err.println(e); +// e.printStackTrace(); +// } + + node.stop(); + System.out.println("Test server stopped"); + } + +} diff --git a/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/TestService.java b/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/TestService.java new file mode 100644 index 0000000000..2becc472b8 --- /dev/null +++ b/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/TestService.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.binding.ws.axis2.itests.pojo; + +import org.osoa.sca.annotations.Remotable; + + +@Remotable +public interface TestService { + + public boolean printData(Data data); + +} diff --git a/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/TestServiceImpl.java b/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/TestServiceImpl.java new file mode 100644 index 0000000000..1946d67d79 --- /dev/null +++ b/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/TestServiceImpl.java @@ -0,0 +1,59 @@ +/* + * 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.binding.ws.axis2.itests.pojo; + +import java.util.Arrays; + +import org.osoa.sca.annotations.Service; + +@Service(TestService.class) +public class TestServiceImpl implements TestService { + + public boolean printData(Data data) { + if (data == null) { + System.out.println("data is null"); + return false; + } + + StringBuilder sb = new StringBuilder(256); + sb.append("Data:\n"); + Data2[] a = data.getA(); + if (a != null) { + for (int i = 0; i < a.length; i++) { + sb.append(" a["); + sb.append(i); + sb.append("] = "); + sb.append(Arrays.asList(a[i].getAsdf())); + sb.append("\n"); + } + } else { + sb.append(" a = null"); + } + sb.append("\n b = "); + sb.append(data.getB()); + sb.append("\n c = "); + sb.append(data.getC()); + sb.append("\n"); + + System.out.println(sb.toString()); + + return true; + } + +} diff --git a/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/package-info.java b/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/package-info.java new file mode 100644 index 0000000000..7c8867530e --- /dev/null +++ b/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/package-info.java @@ -0,0 +1,21 @@ +/* + * 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. + */ +// @javax.xml.bind.annotation.XmlSchema(namespace="http://test/server") +package org.apache.tuscany.sca.binding.ws.axis2.itests.pojo; + diff --git a/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/test.composite b/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/test.composite new file mode 100644 index 0000000000..029a5e3c65 --- /dev/null +++ b/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/test.composite @@ -0,0 +1,32 @@ + + + + + + + + + + + + -- cgit v1.2.3