summaryrefslogtreecommitdiffstats
path: root/java/sca/modules/binding-ws-axis2
diff options
context:
space:
mode:
Diffstat (limited to 'java/sca/modules/binding-ws-axis2')
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/Data.java53
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/Data2.java35
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/POJOWSTestCase.java50
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/TestService.java29
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/TestServiceImpl.java59
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/package-info.java21
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/test.composite32
7 files changed, 279 insertions, 0 deletions
diff --git a/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/Data.java b/java/sca/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/java/sca/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/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/Data2.java b/java/sca/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/java/sca/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/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/POJOWSTestCase.java b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/POJOWSTestCase.java
new file mode 100644
index 0000000000..457eceda8b
--- /dev/null
+++ b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/POJOWSTestCase.java
@@ -0,0 +1,50 @@
+/*
+ * 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.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.Test;
+
+public class POJOWSTestCase {
+
+ @Test
+ public void testWS() throws Exception {
+
+ String location = ContributionLocationHelper.getContributionLocation(TestService.class);
+ Contribution contrib = new Contribution("c1", location);
+ Node node = NodeFactory.newInstance().createNode("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/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/TestService.java b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/TestService.java
new file mode 100644
index 0000000000..c055d4909f
--- /dev/null
+++ b/java/sca/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.oasisopen.sca.annotation.Remotable;
+
+
+@Remotable
+public interface TestService {
+
+ public boolean printData(Data data);
+
+}
diff --git a/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/TestServiceImpl.java b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/TestServiceImpl.java
new file mode 100644
index 0000000000..4eec594a47
--- /dev/null
+++ b/java/sca/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.oasisopen.sca.annotation.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/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/package-info.java b/java/sca/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..9224baae29
--- /dev/null
+++ b/java/sca/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/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/test.composite b/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/test.composite
new file mode 100644
index 0000000000..2120c88db4
--- /dev/null
+++ b/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/test.composite
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://test"
+ xmlns:hw="http://helloworld"
+ name="test">
+ <component name="TestServiceComponent">
+ <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.pojo.TestServiceImpl" />
+ <service name="TestService">
+ <interface.java interface="org.apache.tuscany.sca.binding.ws.axis2.itests.pojo.TestService" />
+ <binding.ws />
+ </service>
+ </component>
+</composite>
+