You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by sl...@apache.org on 2011/08/16 12:12:19 UTC

svn commit: r1158181 - in /tuscany/sca-java-2.x/trunk/testing/itest/interface-matching: ./ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/tuscany/ src/main/java/org/apache/tuscany/sca/ src/main/java/...

Author: slaws
Date: Tue Aug 16 10:12:18 2011
New Revision: 1158181

URL: http://svn.apache.org/viewvc?rev=1158181&view=rev
Log:
TUSCANY-3916 - A test for interface miss-matches

Added:
    tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/   (with props)
    tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/pom.xml
    tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/   (with props)
    tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/   (with props)
    tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/   (with props)
    tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/   (with props)
    tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/   (with props)
    tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/   (with props)
    tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/   (with props)
    tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/   (with props)
    tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/   (with props)
    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/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/ParameterObject.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/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/main/resources/   (with props)
    tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/   (with props)
    tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/   (with props)
    tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/tuscany/   (with props)
    tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/tuscany/sca/   (with props)
    tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/tuscany/sca/itest/   (with props)
    tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/tuscany/sca/itest/interfaces/   (with props)
    tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/tuscany/sca/itest/interfaces/missmatch/   (with props)
    tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/tuscany/sca/itest/interfaces/missmatch/distributed/   (with props)
    tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/tuscany/sca/itest/interfaces/missmatch/distributed/MissmatchDistributedClient.composite
    tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/tuscany/sca/itest/interfaces/missmatch/distributed/MissmatchDistributedService.composite
    tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/tuscany/sca/itest/interfaces/missmatch/local/   (with props)
    tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/tuscany/sca/itest/interfaces/missmatch/local/MissmatchLocal.composite
    tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/test/   (with props)
    tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/test/java/   (with props)
    tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/test/java/org/   (with props)
    tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/test/java/org/apache/   (with props)
    tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/test/java/org/apache/tuscany/   (with props)
    tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/test/java/org/apache/tuscany/sca/   (with props)
    tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/test/java/org/apache/tuscany/sca/itest/   (with props)
    tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/test/java/org/apache/tuscany/sca/itest/interfaces/   (with props)
    tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/test/java/org/apache/tuscany/sca/itest/interfaces/InerfaceMissmatchTestCase.java

Propchange: tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Aug 16 10:12:18 2011
@@ -0,0 +1,4 @@
+.classpath
+.project
+.settings
+target

Added: 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=1158181&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/pom.xml (added)
+++ tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/pom.xml Tue Aug 16 10:12:18 2011
@@ -0,0 +1,46 @@
+<?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.    
+-->
+<project>
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.tuscany.sca</groupId>
+        <artifactId>tuscany-itest</artifactId>
+        <version>2.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    <artifactId>itest-interface-matching</artifactId>
+    <name>Apache Tuscany SCA iTest Interface Matchin</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-base-runtime-pom</artifactId>
+            <type>pom</type>
+            <version>2.0-SNAPSHOT</version>
+        </dependency>
+        
+         <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-domain-hazelcast</artifactId>
+            <version>2.0-SNAPSHOT</version>
+            <scope>test</scope>
+        </dependency>         
+    </dependencies>
+</project>

Propchange: tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/
------------------------------------------------------------------------------
    bugtraq:number = true

Added: 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=1158181&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/CallbackInterface.java (added)
+++ tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/CallbackInterface.java Tue Aug 16 10:12:18 2011
@@ -0,0 +1,33 @@
+/*
+ * 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.Remotable;
+
+/**
+ * only for callBack
+ */
+@Remotable
+public interface CallbackInterface {
+
+    void callbackMethod(String str);
+
+    void modifyParameter(ParameterObject po);
+
+}

Added: 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=1158181&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ClientComponent.java (added)
+++ tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ClientComponent.java Tue Aug 16 10:12:18 2011
@@ -0,0 +1,47 @@
+/*
+ * 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.OneWay;
+
+/*
+ * itest for interface: local,method-overloading
+ */
+public interface ClientComponent {
+
+    String foo1(ParameterObject po);
+
+    String foo2(String str) throws Exception;
+
+    String foo3(String str, int i);
+
+    String foo4(int i, String str) throws Exception;
+
+    void callback(String str);
+
+    void callModifyParameter();
+
+    @OneWay
+    void onewayMethod(String str);
+
+    String getCallbackValue();
+
+    String getOnewayValue();
+}

Added: 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=1158181&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ClientComponentImpl.java (added)
+++ tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ClientComponentImpl.java Tue Aug 16 10:12:18 2011
@@ -0,0 +1,83 @@
+/*
+ * 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 ClientComponentImpl implements ClientComponent, CallbackInterface {
+
+    @Reference
+    protected ServiceComponent aCallBackService;
+    private static String callbackValue;
+    private static String onewayValue;
+
+    public String foo1(ParameterObject po) {
+        po.field1 = "AComponent";
+        return aCallBackService.foo("AComponent");
+    }
+
+    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 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/ParameterObject.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/ParameterObject.java?rev=1158181&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ParameterObject.java (added)
+++ tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ParameterObject.java Tue Aug 16 10:12:18 2011
@@ -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.itest.interfaces;
+
+import java.io.Serializable;
+
+public class ParameterObject implements Serializable {
+    private static final long serialVersionUID = 1L;
+    public String field1;
+
+    public ParameterObject() {
+        this.field1 = null;
+    }
+
+    public ParameterObject(String field1) {
+        this.field1 = field1;
+    }
+
+    public boolean equals(Object o) {
+        if (o == this) {
+            return true;
+        }
+        if (o instanceof ParameterObject) {
+            ParameterObject other = (ParameterObject)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/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=1158181&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceComponent.java (added)
+++ tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceComponent.java Tue Aug 16 10:12:18 2011
@@ -0,0 +1,39 @@
+/*
+ * 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 ServiceComponent {
+
+    String foo(String str);
+
+    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/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=1158181&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceMissmatchComponent.java (added)
+++ tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceMissmatchComponent.java Tue Aug 16 10:12:18 2011
@@ -0,0 +1,39 @@
+/*
+ * 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 ServiceMissmatchComponent {
+
+    String foo(ParameterObject 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/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=1158181&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceMissmatchComponentImpl.java (added)
+++ tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceMissmatchComponentImpl.java Tue Aug 16 10:12:18 2011
@@ -0,0 +1,49 @@
+/*
+ * 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.Service;
+
+@Service(ServiceMissmatchComponent.class)
+public class ServiceMissmatchComponentImpl implements ServiceMissmatchComponent {
+
+    @Callback
+    protected CallbackInterface callback;
+
+    private static ParameterObject po;
+
+    public void callback(String str) {
+        callback.callbackMethod(str);
+    }
+
+    public void modifyParameter() {
+        po = new ParameterObject("CallBack");
+        callback.modifyParameter(po);
+    }
+
+    public String foo(ParameterObject po) {
+        return po.field1;
+    }
+
+    public ParameterObject getPO() {
+        return po;
+    }
+
+}

Propchange: tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/tuscany/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/tuscany/sca/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/tuscany/sca/itest/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/tuscany/sca/itest/interfaces/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/tuscany/sca/itest/interfaces/missmatch/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/tuscany/sca/itest/interfaces/missmatch/distributed/
------------------------------------------------------------------------------
    bugtraq:number = true

Added: tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/tuscany/sca/itest/interfaces/missmatch/distributed/MissmatchDistributedClient.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/MissmatchDistributedClient.composite?rev=1158181&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/tuscany/sca/itest/interfaces/missmatch/distributed/MissmatchDistributedClient.composite (added)
+++ tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/tuscany/sca/itest/interfaces/missmatch/distributed/MissmatchDistributedClient.composite Tue Aug 16 10:12:18 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="MissmatchDistributedClient" >
+
+    <component name="DistributedClientComponent">
+        <implementation.java class="org.apache.tuscany.sca.itest.interfaces.ClientComponentImpl" />
+        <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/MissmatchDistributedService.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/MissmatchDistributedService.composite?rev=1158181&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/tuscany/sca/itest/interfaces/missmatch/distributed/MissmatchDistributedService.composite (added)
+++ tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/tuscany/sca/itest/interfaces/missmatch/distributed/MissmatchDistributedService.composite Tue Aug 16 10:12:18 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="MissmatchDistributedService" >
+    
+    <component name="DistributedServiceComponent">
+        <implementation.java class="org.apache.tuscany.sca.itest.interfaces.ServiceMissmatchComponentImpl" />
+    </component>  
+</composite>
\ No newline at end of file

Propchange: tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/tuscany/sca/itest/interfaces/missmatch/local/
------------------------------------------------------------------------------
    bugtraq:number = true

Added: tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/tuscany/sca/itest/interfaces/missmatch/local/MissmatchLocal.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/local/MissmatchLocal.composite?rev=1158181&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/tuscany/sca/itest/interfaces/missmatch/local/MissmatchLocal.composite (added)
+++ tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/resources/org/apache/tuscany/sca/itest/interfaces/missmatch/local/MissmatchLocal.composite Tue Aug 16 10:12:18 2011
@@ -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
+    * 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="LocalMissmatch" >
+
+    <component name="LocalClientComponent">
+        <implementation.java class="org.apache.tuscany.sca.itest.interfaces.ClientComponentImpl" />
+        <reference name="aCallBackService" target="LocalServiceComponent" />
+    </component> 
+    
+    <component name="LocalServiceComponent">
+        <implementation.java class="org.apache.tuscany.sca.itest.interfaces.ServiceMissmatchComponentImpl" />
+    </component>  
+</composite>
\ No newline at end of file

Propchange: tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/test/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/test/java/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/test/java/org/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/test/java/org/apache/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/test/java/org/apache/tuscany/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/test/java/org/apache/tuscany/sca/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/test/java/org/apache/tuscany/sca/itest/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/test/java/org/apache/tuscany/sca/itest/interfaces/
------------------------------------------------------------------------------
    bugtraq:number = true

Added: 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=1158181&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/test/java/org/apache/tuscany/sca/itest/interfaces/InerfaceMissmatchTestCase.java (added)
+++ tuscany/sca-java-2.x/trunk/testing/itest/interface-matching/src/test/java/org/apache/tuscany/sca/itest/interfaces/InerfaceMissmatchTestCase.java Tue Aug 16 10:12:18 2011
@@ -0,0 +1,95 @@
+/*
+ * 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.File;
+import java.net.URI;
+
+import junit.framework.Assert;
+
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.Test;
+import org.oasisopen.sca.ServiceRuntimeException;
+
+public class InerfaceMissmatchTestCase {
+   
+    @Test
+    public void testLocal() throws Exception {
+/*        
+        TuscanyRuntime tuscanyRuntime = TuscanyRuntime.newInstance();
+        Node node = tuscanyRuntime.createNode();
+        node.installContribution("MyContribution", "./target/classes", null, null);
+        node.startComposite("MyContribution", "org/apache/tuscany/sca/itest/interfaces/missmatch/local/MissmatchLocal.composite");
+*/        
+        String [] contributions = {"./target/classes"};
+        Node node1 = NodeFactory.newInstance().createNode(URI.create("tuscany:InerfaceMissmatchTestCase"), 
+                                                                     "org/apache/tuscany/sca/itest/interfaces/missmatch/local/MissmatchLocal.composite", 
+                                                                     contributions);
+        node1.start();
+        
+        ClientComponent local = node1.getService(ClientComponent.class, "LocalClientComponent");
+        ParameterObject po = new ParameterObject();
+        
+        try {
+            local.foo1(po);
+            Assert.fail("Expection exteption indicating that interfaces don't match");
+        } catch (ServiceRuntimeException ex){
+            Assert.assertTrue(ex.getMessage().startsWith("Unable to bind []"));
+        }
+    }
+  
+    
+    @Test
+    public void testDistributed() throws Exception {
+/*        
+        TuscanyRuntime tuscanyRuntime = TuscanyRuntime.newInstance();
+        Node node1 = tuscanyRuntime.createNode("uri:default");
+        node1.installContribution("MyContribution", "./target/classes", null, null);
+        node1.startComposite("MyContribution", "org/apache/tuscany/sca/itest/interfaces/missmatch/distributed/MissmatchDistributedClient.composite");
+        
+        Node node2 = tuscanyRuntime.createNode("uri:default");
+        node2.installContribution("MyContribution", "./target/classes", null, null);
+        node2.startComposite("MyContribution", "org/apache/tuscany/sca/itest/interfaces/missmatch/distributed/MissmatchDistributedService.composite");
+*/
+        
+        String [] contributions = {"./target/classes"};
+        Node node1 = NodeFactory.newInstance().createNode(URI.create("tuscany:InerfaceMissmatchTestCase"), 
+                                                                     "org/apache/tuscany/sca/itest/interfaces/missmatch/distributed/MissmatchDistributedClient.composite", 
+                                                                     contributions);
+        node1.start();
+
+        Node node2 = NodeFactory.newInstance().createNode(URI.create("tuscany:InerfaceMissmatchTestCase"), 
+                                                                     "org/apache/tuscany/sca/itest/interfaces/missmatch/distributed/MissmatchDistributedService.composite", 
+                                                                     contributions);
+        node2.start();
+        
+        ClientComponent local = node1.getService(ClientComponent.class, "DistributedClientComponent");
+        ParameterObject po = new ParameterObject();
+        
+        try {
+            local.foo1(po);
+            Assert.fail("Expected exception indicating that interfaces don't match");
+        } catch (ServiceRuntimeException ex){
+            Assert.assertTrue(ex.getMessage().startsWith("Unable to bind []"));
+        }
+
+    }
+}