summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/testing/itest
diff options
context:
space:
mode:
Diffstat (limited to 'sca-java-2.x/trunk/testing/itest')
-rw-r--r--sca-java-2.x/trunk/testing/itest/interface-matching/pom.xml17
-rw-r--r--sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/CallbackInterface.java2
-rw-r--r--sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/CallbackMissmatchInterface.java2
-rw-r--r--sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ClientComponent.java2
-rw-r--r--sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ClientComponentImpl.java11
-rw-r--r--sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalClientComponentImpl.java5
-rw-r--r--sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/NonJAXBClientComponentImpl.java92
-rw-r--r--sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/NonJAXBParameterObject.java51
-rw-r--r--sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/NonJAXBServiceComponent.java41
-rw-r--r--sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/NonJAXBServiceComponentImpl.java60
-rw-r--r--sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceCallbackMissmatchComponentImpl.java2
-rw-r--r--sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceComponent.java2
-rw-r--r--sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceComponentImpl.java12
-rw-r--r--sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceMissmatchComponent.java4
-rw-r--r--sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceMissmatchComponentImpl.java12
-rw-r--r--sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/tuscany/sca/itest/interfaces/missmatch/distributed/MatchNonJAXBDistributedClient.composite29
-rw-r--r--sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/tuscany/sca/itest/interfaces/missmatch/distributed/MatchNonJAXBDistributedService.composite27
-rw-r--r--sca-java-2.x/trunk/testing/itest/interface-matching/src/test/java/org/apache/tuscany/sca/itest/interfaces/InerfaceMatchTestCase.java55
-rw-r--r--sca-java-2.x/trunk/testing/itest/interface-matching/src/test/java/org/apache/tuscany/sca/itest/interfaces/InerfaceMissmatchTestCase.java9
19 files changed, 416 insertions, 19 deletions
diff --git a/sca-java-2.x/trunk/testing/itest/interface-matching/pom.xml b/sca-java-2.x/trunk/testing/itest/interface-matching/pom.xml
index 1411792cd0..1146689446 100644
--- a/sca-java-2.x/trunk/testing/itest/interface-matching/pom.xml
+++ b/sca-java-2.x/trunk/testing/itest/interface-matching/pom.xml
@@ -43,12 +43,12 @@
<scope>test</scope>
</dependency>
- <!-- Going with web services -->
+ <!-- Going with web services delegate for majority of tests -->
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
<version>2.0-SNAPSHOT</version>
- </dependency>
+ </dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
@@ -56,5 +56,18 @@
<version>6.1.19</version>
</dependency>
+ <!-- Use RMI delegate for non-JAXB test -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-rmi-runtime</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-rmi</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
</dependencies>
</project>
diff --git a/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/CallbackInterface.java b/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/CallbackInterface.java
index df736810b2..4db5531aca 100644
--- a/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/CallbackInterface.java
+++ b/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/CallbackInterface.java
@@ -27,6 +27,8 @@ import org.oasisopen.sca.annotation.Remotable;
public interface CallbackInterface {
void callbackMethod(String str);
+
+ void callbackMethod1(String str);
void modifyParameter(ParameterObject po);
diff --git a/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/CallbackMissmatchInterface.java b/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/CallbackMissmatchInterface.java
index c0f2aa2593..9d9362f4d5 100644
--- a/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/CallbackMissmatchInterface.java
+++ b/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/CallbackMissmatchInterface.java
@@ -27,6 +27,8 @@ import org.oasisopen.sca.annotation.Remotable;
public interface CallbackMissmatchInterface {
void callbackMethod(ParameterObject po);
+
+ void callbackMethod1(ParameterObject po, String str);
void modifyParameter(ParameterObject po);
diff --git a/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ClientComponent.java b/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ClientComponent.java
index 898e3f3fa4..ac5c2c5817 100644
--- a/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ClientComponent.java
+++ b/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ClientComponent.java
@@ -25,6 +25,8 @@ import org.oasisopen.sca.annotation.OneWay;
* itest for interface: local,method-overloading
*/
public interface ClientComponent {
+
+ String foo(ParameterObject po);
String foo1(ParameterObject po);
diff --git a/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ClientComponentImpl.java b/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ClientComponentImpl.java
index 46f22594a1..4a414f870f 100644
--- a/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ClientComponentImpl.java
+++ b/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ClientComponentImpl.java
@@ -29,10 +29,15 @@ public class ClientComponentImpl implements ClientComponent, CallbackInterface {
protected ServiceComponent aCallBackService;
private static String callbackValue;
private static String onewayValue;
+
+ public String foo(ParameterObject po) {
+ po.field1 = "AComponent";
+ return aCallBackService.foo("AComponent");
+ }
public String foo1(ParameterObject po) {
po.field1 = "AComponent";
- return aCallBackService.foo("AComponent");
+ return aCallBackService.foo1("AComponent");
}
public String foo2(String str) throws Exception {
@@ -54,6 +59,10 @@ public class ClientComponentImpl implements ClientComponent, CallbackInterface {
public void callbackMethod(String str) {
callbackValue = str;
}
+
+ public void callbackMethod1(String str) {
+ callbackValue = str;
+ }
public void callModifyParameter() {
this.aCallBackService.modifyParameter();
diff --git a/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalClientComponentImpl.java b/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalClientComponentImpl.java
index 014782a04a..9a8ad9ed8d 100644
--- a/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalClientComponentImpl.java
+++ b/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalClientComponentImpl.java
@@ -30,6 +30,11 @@ public class LocalClientComponentImpl implements ClientComponent, LocalCallbackI
private static String callbackValue;
private static String onewayValue;
+ public String foo(ParameterObject po) {
+ po.field1 = "AComponent";
+ return aCallBackService.foo("AComponent");
+ }
+
public String foo1(ParameterObject po) {
po.field1 = "AComponent";
return aCallBackService.foo("AComponent");
diff --git a/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/NonJAXBClientComponentImpl.java b/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/NonJAXBClientComponentImpl.java
new file mode 100644
index 0000000000..f3048a9098
--- /dev/null
+++ b/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/NonJAXBClientComponentImpl.java
@@ -0,0 +1,92 @@
+/*
+ * 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.interfaces;
+
+import org.oasisopen.sca.annotation.Reference;
+import org.oasisopen.sca.annotation.Service;
+
+@Service(ClientComponent.class)
+public class NonJAXBClientComponentImpl implements ClientComponent, CallbackInterface {
+
+ @Reference
+ protected NonJAXBServiceComponent aCallBackService;
+ private static String callbackValue;
+ private static String onewayValue;
+
+ public String foo(ParameterObject po) {
+ po.field1 = "AComponent";
+ return aCallBackService.foo("AComponent");
+ }
+
+ public String foo1(ParameterObject po) {
+ NonJAXBParameterObject nonJAXBPO = new NonJAXBParameterObject(po.field1);
+ return aCallBackService.foo1(nonJAXBPO);
+ }
+
+ public String foo2(String str) throws Exception {
+ return str + "AComponent";
+ }
+
+ public String foo3(String str, int i) {
+ return str + "AComponent" + i;
+ }
+
+ public String foo4(int i, String str) throws Exception {
+ return str + "AComponent" + i;
+ }
+
+ public void callback(String str) {
+ aCallBackService.callback(str);
+ }
+
+ public void callbackMethod(String str) {
+ callbackValue = str;
+ }
+
+ public void callbackMethod1(String str) {
+ callbackValue = str;
+ }
+
+ public void callModifyParameter() {
+ this.aCallBackService.modifyParameter();
+ }
+
+ public String getCallbackValue() {
+ return callbackValue;
+ }
+
+ public void onewayMethod(String str) {
+ onewayValue = str;
+ try {
+ Thread.sleep(200);
+ } catch (Exception e) {
+ //do nothing
+ }
+ }
+
+ public String getOnewayValue() {
+ return onewayValue;
+ }
+
+ public void modifyParameter(ParameterObject po) {
+ po.field1 = "AComponent";
+ }
+
+}
diff --git a/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/NonJAXBParameterObject.java b/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/NonJAXBParameterObject.java
new file mode 100644
index 0000000000..8acef311a9
--- /dev/null
+++ b/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/NonJAXBParameterObject.java
@@ -0,0 +1,51 @@
+/*
+ * 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.interfaces;
+
+import java.io.Serializable;
+
+/**
+ *
+ * A bean that cannont be converted to/from XML using JAXB as there is no
+ * default constructor
+ *
+ */
+public class NonJAXBParameterObject implements Serializable {
+ private static final long serialVersionUID = 1L;
+ public String field1;
+
+
+ public NonJAXBParameterObject(String field1) {
+ this.field1 = field1;
+ }
+
+ public boolean equals(Object o) {
+ if (o == this) {
+ return true;
+ }
+ if (o instanceof NonJAXBParameterObject) {
+ NonJAXBParameterObject other = (NonJAXBParameterObject)o;
+ if (field1 != null) {
+ return field1.equals(other.field1);
+ }
+ }
+ return false;
+ }
+}
diff --git a/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/NonJAXBServiceComponent.java b/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/NonJAXBServiceComponent.java
new file mode 100644
index 0000000000..d097394721
--- /dev/null
+++ b/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/NonJAXBServiceComponent.java
@@ -0,0 +1,41 @@
+/*
+ * 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.interfaces;
+
+import org.oasisopen.sca.annotation.Callback;
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * Local be-directional callBackService
+ */
+@Remotable
+@Callback(CallbackInterface.class)
+public interface NonJAXBServiceComponent {
+
+ String foo(String str);
+
+ String foo1(NonJAXBParameterObject po);
+
+ void callback(String str);
+
+ void modifyParameter();
+
+ ParameterObject getPO();
+
+}
diff --git a/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/NonJAXBServiceComponentImpl.java b/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/NonJAXBServiceComponentImpl.java
new file mode 100644
index 0000000000..d50feafd0e
--- /dev/null
+++ b/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/NonJAXBServiceComponentImpl.java
@@ -0,0 +1,60 @@
+/*
+ * 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.interfaces;
+
+import org.oasisopen.sca.annotation.Callback;
+import org.oasisopen.sca.annotation.Reference;
+import org.oasisopen.sca.annotation.Service;
+
+@Service(NonJAXBServiceComponent.class)
+public class NonJAXBServiceComponentImpl implements NonJAXBServiceComponent {
+
+ @Callback
+ protected CallbackInterface callback;
+
+/*
+ @Reference
+ protected ServiceComponent chainedCallbackReference;
+*/
+ private static ParameterObject po;
+
+ public String foo(String str) {
+ return str;
+ }
+
+ public String foo1(NonJAXBParameterObject po){
+ return po.field1;
+ }
+
+ public void callback(String str) {
+ callback.callbackMethod(str);
+ }
+
+ public void modifyParameter() {
+ po = new ParameterObject("CallBack");
+ callback.modifyParameter(po);
+ }
+
+
+
+ public ParameterObject getPO() {
+ return po;
+ }
+
+}
diff --git a/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceCallbackMissmatchComponentImpl.java b/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceCallbackMissmatchComponentImpl.java
index da85659372..4dbfd55535 100644
--- a/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceCallbackMissmatchComponentImpl.java
+++ b/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceCallbackMissmatchComponentImpl.java
@@ -30,7 +30,7 @@ public class ServiceCallbackMissmatchComponentImpl implements ServiceCallbackMis
private static ParameterObject po;
public void callback(String str) {
- callback.callbackMethod(po);
+ callback.callbackMethod1(po, str);
}
public void modifyParameter() {
diff --git a/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceComponent.java b/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceComponent.java
index 25a9d6e923..355db43089 100644
--- a/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceComponent.java
+++ b/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceComponent.java
@@ -29,6 +29,8 @@ import org.oasisopen.sca.annotation.Remotable;
public interface ServiceComponent {
String foo(String str);
+
+ String foo1(String str);
void callback(String str);
diff --git a/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceComponentImpl.java b/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceComponentImpl.java
index 0bf2ad3e63..0538739b99 100644
--- a/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceComponentImpl.java
+++ b/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceComponentImpl.java
@@ -34,6 +34,14 @@ public class ServiceComponentImpl implements ServiceComponent {
*/
private static ParameterObject po;
+ public String foo(String str) {
+ return str;
+ }
+
+ public String foo1(String str){
+ return str;
+ }
+
public void callback(String str) {
callback.callbackMethod(str);
}
@@ -43,9 +51,7 @@ public class ServiceComponentImpl implements ServiceComponent {
callback.modifyParameter(po);
}
- public String foo(String str) {
- return str;
- }
+
public ParameterObject getPO() {
return po;
diff --git a/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceMissmatchComponent.java b/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceMissmatchComponent.java
index 336f85d90f..ecafb20c2e 100644
--- a/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceMissmatchComponent.java
+++ b/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceMissmatchComponent.java
@@ -28,7 +28,11 @@ import org.oasisopen.sca.annotation.Remotable;
@Callback(CallbackInterface.class)
public interface ServiceMissmatchComponent {
+ // infrastructure won't detect difference between String and ParameterObject
String foo(ParameterObject po);
+
+ // Infrastructure will detect difference between parameter numbers
+ String foo1(ParameterObject po, String str);
void callback(String str);
diff --git a/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceMissmatchComponentImpl.java b/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceMissmatchComponentImpl.java
index d43b7b6f45..713cce6776 100644
--- a/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceMissmatchComponentImpl.java
+++ b/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceMissmatchComponentImpl.java
@@ -29,6 +29,14 @@ public class ServiceMissmatchComponentImpl implements ServiceMissmatchComponent
private static ParameterObject po;
+ public String foo(ParameterObject po) {
+ return po.field1;
+ }
+
+ public String foo1(ParameterObject po, String str){
+ return str;
+ }
+
public void callback(String str) {
callback.callbackMethod(str);
}
@@ -38,10 +46,6 @@ public class ServiceMissmatchComponentImpl implements ServiceMissmatchComponent
callback.modifyParameter(po);
}
- public String foo(ParameterObject po) {
- return po.field1;
- }
-
public ParameterObject getPO() {
return po;
}
diff --git a/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/tuscany/sca/itest/interfaces/missmatch/distributed/MatchNonJAXBDistributedClient.composite b/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/tuscany/sca/itest/interfaces/missmatch/distributed/MatchNonJAXBDistributedClient.composite
new file mode 100644
index 0000000000..4d39fc2ec7
--- /dev/null
+++ b/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/tuscany/sca/itest/interfaces/missmatch/distributed/MatchNonJAXBDistributedClient.composite
@@ -0,0 +1,29 @@
+<?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
+ * 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/200912"
+ xmlns:foo="http://foo" targetNamespace="http://foo"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ name="MatchNonJAXBDistributedClient" >
+
+ <component name="DistributedClientComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.interfaces.NonJAXBClientComponentImpl" />
+ <reference name="aCallBackService" target="DistributedServiceComponent" />
+ </component>
+
+</composite> \ No newline at end of file
diff --git a/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/tuscany/sca/itest/interfaces/missmatch/distributed/MatchNonJAXBDistributedService.composite b/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/tuscany/sca/itest/interfaces/missmatch/distributed/MatchNonJAXBDistributedService.composite
new file mode 100644
index 0000000000..ffb609daee
--- /dev/null
+++ b/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/tuscany/sca/itest/interfaces/missmatch/distributed/MatchNonJAXBDistributedService.composite
@@ -0,0 +1,27 @@
+<?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
+ * 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/200912"
+ xmlns:foo="http://foo" targetNamespace="http://foo"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ name="MatchNonJAXBDistributedService" >
+
+ <component name="DistributedServiceComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.interfaces.NonJAXBServiceComponentImpl" />
+ </component>
+</composite> \ No newline at end of file
diff --git a/sca-java-2.x/trunk/testing/itest/interface-matching/src/test/java/org/apache/tuscany/sca/itest/interfaces/InerfaceMatchTestCase.java b/sca-java-2.x/trunk/testing/itest/interface-matching/src/test/java/org/apache/tuscany/sca/itest/interfaces/InerfaceMatchTestCase.java
index 89ca0314c7..f52600bc1f 100644
--- a/sca-java-2.x/trunk/testing/itest/interface-matching/src/test/java/org/apache/tuscany/sca/itest/interfaces/InerfaceMatchTestCase.java
+++ b/sca-java-2.x/trunk/testing/itest/interface-matching/src/test/java/org/apache/tuscany/sca/itest/interfaces/InerfaceMatchTestCase.java
@@ -113,6 +113,59 @@ public class InerfaceMatchTestCase {
node1.stop();
node2.stop();
-
}
+
+ /**
+ * Remoteable client and service interfaces where the interfaces match but
+ * where there is a parameter that can't be converted to/from XML using JAXB
+ * Components running in the seaprate composite/JVM, i.e. there is a remote registry
+ *
+ * @throws Exception
+ */
+ @Test
+ @Ignore("Can't get RMI binding working as a delegate for some reason")
+ public void testDistributedRemotableNonJAXB() throws Exception {
+
+ // Force the remote default binding to be rmi as I want something that doesn't depend on
+ // WSDL so that I can test what happens when the registry tries to generate WSDL
+ System.setProperty("org.apache.tuscany.sca.binding.sca.provider.SCABindingMapper.mappedBinding",
+ "{http://tuscany.apache.org/xmlns/sca/1.1}binding.rmi");
+
+ String [] contributions = {"./target/classes"};
+ Node node1 = NodeFactory.newInstance().createNode(URI.create("uri:default"),
+ "org/apache/tuscany/sca/itest/interfaces/missmatch/distributed/MatchNonJAXBDistributedClient.composite",
+ contributions);
+ node1.start();
+
+ Node node2 = NodeFactory.newInstance().createNode(URI.create("uri:default"),
+ "org/apache/tuscany/sca/itest/interfaces/missmatch/distributed/MatchNonJAXBDistributedService.composite",
+ contributions);
+
+ // for default binding on node2 to use a different port from node 1(which will default to 8080
+ // Don't need to do this as not testing callbacks here
+ //((NodeImpl)node2).getConfiguration().addBinding(WebServiceBinding.TYPE, "http://localhost:8081/");
+ //((NodeImpl)node2).getConfiguration().addBinding(SCABinding.TYPE, "http://localhost:8081/");
+ node2.start();
+
+ ClientComponent local = node1.getService(ClientComponent.class, "DistributedClientComponent");
+ ParameterObject po = new ParameterObject();
+
+ try {
+ String response = local.foo1(po);
+ Assert.assertEquals("AComponent", response);
+ } catch (ServiceRuntimeException ex){
+ Assert.fail("Unexpected exception with foo " + ex.toString());
+ }
+
+ try {
+ local.callback("Callback");
+ String response = local.getCallbackValue();
+ Assert.assertEquals("Callback", response);
+ } catch (ServiceRuntimeException ex){
+ Assert.fail("Unexpected exception with callback" + ex.toString());
+ }
+
+ node1.stop();
+ node2.stop();
+ }
}
diff --git a/sca-java-2.x/trunk/testing/itest/interface-matching/src/test/java/org/apache/tuscany/sca/itest/interfaces/InerfaceMissmatchTestCase.java b/sca-java-2.x/trunk/testing/itest/interface-matching/src/test/java/org/apache/tuscany/sca/itest/interfaces/InerfaceMissmatchTestCase.java
index 8a776de223..e867405770 100644
--- a/sca-java-2.x/trunk/testing/itest/interface-matching/src/test/java/org/apache/tuscany/sca/itest/interfaces/InerfaceMissmatchTestCase.java
+++ b/sca-java-2.x/trunk/testing/itest/interface-matching/src/test/java/org/apache/tuscany/sca/itest/interfaces/InerfaceMissmatchTestCase.java
@@ -110,9 +110,7 @@ public class InerfaceMissmatchTestCase {
try {
local.foo1(po);
} catch (ServiceRuntimeException ex){
- //Assert.assertTrue(ex.getMessage().startsWith("Unable to bind []"));
- Assert.fail("It seems that the matching process can't tell that these don't match as it has a " +
- "String on one side and a complex type (Java Object) on the other");
+ Assert.assertTrue(ex.getMessage().startsWith("Unable to bind []"));
}
node1.stop();
@@ -126,7 +124,6 @@ public class InerfaceMissmatchTestCase {
* @throws Exception
*/
@Test
- @Ignore("Remote missmatch testing disabled in the binder")
public void testDistributedRemotable() throws Exception {
// Force the remote default binding to be web services
@@ -159,7 +156,6 @@ public class InerfaceMissmatchTestCase {
node1.stop();
node2.stop();
-
}
/**
@@ -169,8 +165,7 @@ public class InerfaceMissmatchTestCase {
*
* @throws Exception
*/
- @Test
- @Ignore("Remote missmatch testing disabled in the binder")
+ @Test
public void testCallbackDistributedRemotable() throws Exception {
// Force the remote default binding to be web services