Author: slaws
Date: Thu Sep 1 10:33:47 2011
New Revision: 1163990
URL: http://svn.apache.org/viewvc?rev=1163990&view=rev
Log:
TUSCANY-3916 - Turn on distributed matching tests and add an test where the
service interface contains operation arguments that cannot be converted to XML
using JAXB.
Added:
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/NonJAXBClientComponentImpl.java
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/NonJAXBParameterObject.java
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/NonJAXBServiceComponent.java
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/NonJAXBServiceComponentImpl.java
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/tuscany/sca/itest/interfaces/missmatch/distributed/MatchNonJAXBDistributedClient.composite
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/tuscany/sca/itest/interfaces/missmatch/distributed/MatchNonJAXBDistributedService.composite
Modified:
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/pom.xml
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/CallbackInterface.java
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/CallbackMissmatchInterface.java
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ClientComponent.java
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ClientComponentImpl.java
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalClientComponentImpl.java
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceCallbackMissmatchComponentImpl.java
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceComponent.java
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceComponentImpl.java
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceMissmatchComponent.java
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceMissmatchComponentImpl.java
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/test/java/org/apache/tuscany/sca/itest/interfaces/InerfaceMatchTestCase.java
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/test/java/org/apache/tuscany/sca/itest/interfaces/InerfaceMissmatchTestCase.java
Modified: tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/pom.xml
URL:
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/pom.xml?rev=1163990&r1=1163989&r2=1163990&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/pom.xml
(original)
+++ tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/pom.xml Thu Sep
1 10:33:47 2011
@@ -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>
Modified:
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/CallbackInterface.java
URL:
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/CallbackInterface.java?rev=1163990&r1=1163989&r2=1163990&view=diff
==============================================================================
---
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/CallbackInterface.java
(original)
+++
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/CallbackInterface.java
Thu Sep 1 10:33:47 2011
@@ -27,6 +27,8 @@ import org.oasisopen.sca.annotation.Remo
public interface CallbackInterface {
void callbackMethod(String str);
+
+ void callbackMethod1(String str);
void modifyParameter(ParameterObject po);
Modified:
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/CallbackMissmatchInterface.java
URL:
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/CallbackMissmatchInterface.java?rev=1163990&r1=1163989&r2=1163990&view=diff
==============================================================================
---
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/CallbackMissmatchInterface.java
(original)
+++
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/CallbackMissmatchInterface.java
Thu Sep 1 10:33:47 2011
@@ -27,6 +27,8 @@ import org.oasisopen.sca.annotation.Remo
public interface CallbackMissmatchInterface {
void callbackMethod(ParameterObject po);
+
+ void callbackMethod1(ParameterObject po, String str);
void modifyParameter(ParameterObject po);
Modified:
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ClientComponent.java
URL:
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ClientComponent.java?rev=1163990&r1=1163989&r2=1163990&view=diff
==============================================================================
---
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ClientComponent.java
(original)
+++
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ClientComponent.java
Thu Sep 1 10:33:47 2011
@@ -25,6 +25,8 @@ import org.oasisopen.sca.annotation.OneW
* itest for interface: local,method-overloading
*/
public interface ClientComponent {
+
+ String foo(ParameterObject po);
String foo1(ParameterObject po);
Modified:
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ClientComponentImpl.java
URL:
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ClientComponentImpl.java?rev=1163990&r1=1163989&r2=1163990&view=diff
==============================================================================
---
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ClientComponentImpl.java
(original)
+++
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ClientComponentImpl.java
Thu Sep 1 10:33:47 2011
@@ -29,10 +29,15 @@ public class ClientComponentImpl impleme
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 impleme
public void callbackMethod(String str) {
callbackValue = str;
}
+
+ public void callbackMethod1(String str) {
+ callbackValue = str;
+ }
public void callModifyParameter() {
this.aCallBackService.modifyParameter();
Modified:
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalClientComponentImpl.java
URL:
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalClientComponentImpl.java?rev=1163990&r1=1163989&r2=1163990&view=diff
==============================================================================
---
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalClientComponentImpl.java
(original)
+++
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalClientComponentImpl.java
Thu Sep 1 10:33:47 2011
@@ -30,6 +30,11 @@ public class LocalClientComponentImpl im
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");
Added:
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/NonJAXBClientComponentImpl.java
URL:
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/NonJAXBClientComponentImpl.java?rev=1163990&view=auto
==============================================================================
---
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/NonJAXBClientComponentImpl.java
(added)
+++
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/NonJAXBClientComponentImpl.java
Thu Sep 1 10:33:47 2011
@@ -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";
+ }
+
+}
Added:
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/NonJAXBParameterObject.java
URL:
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/NonJAXBParameterObject.java?rev=1163990&view=auto
==============================================================================
---
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/NonJAXBParameterObject.java
(added)
+++
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/NonJAXBParameterObject.java
Thu Sep 1 10:33:47 2011
@@ -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;
+ }
+}
Added:
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/NonJAXBServiceComponent.java
URL:
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/NonJAXBServiceComponent.java?rev=1163990&view=auto
==============================================================================
---
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/NonJAXBServiceComponent.java
(added)
+++
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/NonJAXBServiceComponent.java
Thu Sep 1 10:33:47 2011
@@ -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();
+
+}
Added:
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/NonJAXBServiceComponentImpl.java
URL:
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/NonJAXBServiceComponentImpl.java?rev=1163990&view=auto
==============================================================================
---
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/NonJAXBServiceComponentImpl.java
(added)
+++
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/NonJAXBServiceComponentImpl.java
Thu Sep 1 10:33:47 2011
@@ -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;
+ }
+
+}
Modified:
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceCallbackMissmatchComponentImpl.java
URL:
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceCallbackMissmatchComponentImpl.java?rev=1163990&r1=1163989&r2=1163990&view=diff
==============================================================================
---
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceCallbackMissmatchComponentImpl.java
(original)
+++
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceCallbackMissmatchComponentImpl.java
Thu Sep 1 10:33:47 2011
@@ -30,7 +30,7 @@ public class ServiceCallbackMissmatchCom
private static ParameterObject po;
public void callback(String str) {
- callback.callbackMethod(po);
+ callback.callbackMethod1(po, str);
}
public void modifyParameter() {
Modified:
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceComponent.java
URL:
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceComponent.java?rev=1163990&r1=1163989&r2=1163990&view=diff
==============================================================================
---
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceComponent.java
(original)
+++
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceComponent.java
Thu Sep 1 10:33:47 2011
@@ -29,6 +29,8 @@ import org.oasisopen.sca.annotation.Remo
public interface ServiceComponent {
String foo(String str);
+
+ String foo1(String str);
void callback(String str);
Modified:
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceComponentImpl.java
URL:
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceComponentImpl.java?rev=1163990&r1=1163989&r2=1163990&view=diff
==============================================================================
---
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceComponentImpl.java
(original)
+++
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceComponentImpl.java
Thu Sep 1 10:33:47 2011
@@ -34,6 +34,14 @@ public class ServiceComponentImpl implem
*/
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 implem
callback.modifyParameter(po);
}
- public String foo(String str) {
- return str;
- }
+
public ParameterObject getPO() {
return po;
Modified:
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceMissmatchComponent.java
URL:
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceMissmatchComponent.java?rev=1163990&r1=1163989&r2=1163990&view=diff
==============================================================================
---
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceMissmatchComponent.java
(original)
+++
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceMissmatchComponent.java
Thu Sep 1 10:33:47 2011
@@ -28,7 +28,11 @@ import org.oasisopen.sca.annotation.Remo
@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);
Modified:
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceMissmatchComponentImpl.java
URL:
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceMissmatchComponentImpl.java?rev=1163990&r1=1163989&r2=1163990&view=diff
==============================================================================
---
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceMissmatchComponentImpl.java
(original)
+++
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceMissmatchComponentImpl.java
Thu Sep 1 10:33:47 2011
@@ -29,6 +29,14 @@ public class ServiceMissmatchComponentIm
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 ServiceMissmatchComponentIm
callback.modifyParameter(po);
}
- public String foo(ParameterObject po) {
- return po.field1;
- }
-
public ParameterObject getPO() {
return po;
}
Added:
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/tuscany/sca/itest/interfaces/missmatch/distributed/MatchNonJAXBDistributedClient.composite
URL:
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/tuscany/sca/itest/interfaces/missmatch/distributed/MatchNonJAXBDistributedClient.composite?rev=1163990&view=auto
==============================================================================
---
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/tuscany/sca/itest/interfaces/missmatch/distributed/MatchNonJAXBDistributedClient.composite
(added)
+++
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/tuscany/sca/itest/interfaces/missmatch/distributed/MatchNonJAXBDistributedClient.composite
Thu Sep 1 10:33:47 2011
@@ -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
Added:
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/tuscany/sca/itest/interfaces/missmatch/distributed/MatchNonJAXBDistributedService.composite
URL:
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/tuscany/sca/itest/interfaces/missmatch/distributed/MatchNonJAXBDistributedService.composite?rev=1163990&view=auto
==============================================================================
---
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/tuscany/sca/itest/interfaces/missmatch/distributed/MatchNonJAXBDistributedService.composite
(added)
+++
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/tuscany/sca/itest/interfaces/missmatch/distributed/MatchNonJAXBDistributedService.composite
Thu Sep 1 10:33:47 2011
@@ -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
Modified:
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/test/java/org/apache/tuscany/sca/itest/interfaces/InerfaceMatchTestCase.java
URL:
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/test/java/org/apache/tuscany/sca/itest/interfaces/InerfaceMatchTestCase.java?rev=1163990&r1=1163989&r2=1163990&view=diff
==============================================================================
---
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/test/java/org/apache/tuscany/sca/itest/interfaces/InerfaceMatchTestCase.java
(original)
+++
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/test/java/org/apache/tuscany/sca/itest/interfaces/InerfaceMatchTestCase.java
Thu Sep 1 10:33:47 2011
@@ -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();
+ }
}
Modified:
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/test/java/org/apache/tuscany/sca/itest/interfaces/InerfaceMissmatchTestCase.java
URL:
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/test/java/org/apache/tuscany/sca/itest/interfaces/InerfaceMissmatchTestCase.java?rev=1163990&r1=1163989&r2=1163990&view=diff
==============================================================================
---
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/test/java/org/apache/tuscany/sca/itest/interfaces/InerfaceMissmatchTestCase.java
(original)
+++
tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/test/java/org/apache/tuscany/sca/itest/interfaces/InerfaceMissmatchTestCase.java
Thu Sep 1 10:33:47 2011
@@ -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