You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by rf...@apache.org on 2007/09/11 19:46:37 UTC

svn commit: r574649 - in /incubator/tuscany/java/sca/itest: ./ interfaces/ interfaces/src/ interfaces/src/main/ interfaces/src/main/java/ interfaces/src/main/java/org/ interfaces/src/main/java/org/apache/ interfaces/src/main/java/org/apache/tuscany/ in...

Author: rfeng
Date: Tue Sep 11 10:46:35 2007
New Revision: 574649

URL: http://svn.apache.org/viewvc?rev=574649&view=rev
Log:
Add an integration test for interfaces

Added:
    incubator/tuscany/java/sca/itest/interfaces/   (with props)
    incubator/tuscany/java/sca/itest/interfaces/pom.xml   (with props)
    incubator/tuscany/java/sca/itest/interfaces/src/
    incubator/tuscany/java/sca/itest/interfaces/src/main/
    incubator/tuscany/java/sca/itest/interfaces/src/main/java/
    incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/
    incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/
    incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/
    incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/
    incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/
    incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/
    incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalCallbackInterface.java   (with props)
    incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalClientComponent.java   (with props)
    incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalClientComponentImpl.java   (with props)
    incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalServiceComponent.java   (with props)
    incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalServiceComponentImpl.java   (with props)
    incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/ParameterObject.java   (with props)
    incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteCallbackInterface.java   (with props)
    incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteClientComponent.java   (with props)
    incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteClientComponentImpl.java   (with props)
    incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteServiceComponent.java   (with props)
    incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteServiceComponentImpl.java   (with props)
    incubator/tuscany/java/sca/itest/interfaces/src/main/resources/
    incubator/tuscany/java/sca/itest/interfaces/src/main/resources/InterfacesTest.composite
    incubator/tuscany/java/sca/itest/interfaces/src/test/
    incubator/tuscany/java/sca/itest/interfaces/src/test/java/
    incubator/tuscany/java/sca/itest/interfaces/src/test/java/org/
    incubator/tuscany/java/sca/itest/interfaces/src/test/java/org/apache/
    incubator/tuscany/java/sca/itest/interfaces/src/test/java/org/apache/tuscany/
    incubator/tuscany/java/sca/itest/interfaces/src/test/java/org/apache/tuscany/sca/
    incubator/tuscany/java/sca/itest/interfaces/src/test/java/org/apache/tuscany/sca/itest/
    incubator/tuscany/java/sca/itest/interfaces/src/test/java/org/apache/tuscany/sca/itest/interfaces/
    incubator/tuscany/java/sca/itest/interfaces/src/test/java/org/apache/tuscany/sca/itest/interfaces/InterfacesTestCase.java   (with props)
Modified:
    incubator/tuscany/java/sca/itest/pom.xml

Propchange: incubator/tuscany/java/sca/itest/interfaces/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Sep 11 10:46:35 2007
@@ -0,0 +1,13 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules

Added: incubator/tuscany/java/sca/itest/interfaces/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/interfaces/pom.xml?rev=574649&view=auto
==============================================================================
--- incubator/tuscany/java/sca/itest/interfaces/pom.xml (added)
+++ incubator/tuscany/java/sca/itest/interfaces/pom.xml Tue Sep 11 10:46:35 2007
@@ -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>1.0-incubating-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    <artifactId>itest-interfaces</artifactId>
+    <name>Apache Tuscany Interface Integration Tests</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-host-embedded</artifactId>
+            <version>1.0-incubating-SNAPSHOT</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-implementation-java-runtime</artifactId>
+            <version>1.0-incubating-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency>
+
+    </dependencies>
+</project>

Propchange: incubator/tuscany/java/sca/itest/interfaces/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/itest/interfaces/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalCallbackInterface.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalCallbackInterface.java?rev=574649&view=auto
==============================================================================
--- incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalCallbackInterface.java (added)
+++ incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalCallbackInterface.java Tue Sep 11 10:46:35 2007
@@ -0,0 +1,31 @@
+/*
+ * 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;
+
+
+/**
+ * only for callBack
+ */
+public interface LocalCallbackInterface {
+
+    public void callbackMethod(String str);
+
+    public void modifyParameter(ParameterObject po);
+
+}

Propchange: incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalCallbackInterface.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalCallbackInterface.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalClientComponent.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalClientComponent.java?rev=574649&view=auto
==============================================================================
--- incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalClientComponent.java (added)
+++ incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalClientComponent.java Tue Sep 11 10:46:35 2007
@@ -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.osoa.sca.annotations.OneWay;
+
+/*
+ * itest for interface: local,method-overloading
+ */
+public interface LocalClientComponent {
+
+    String foo1(ParameterObject po);
+
+    String foo1(String str) throws Exception;
+
+    String foo2(String str, int i);
+
+    String foo2(int i, String str) throws Exception;
+
+    void callback(String str);
+
+    void callModifyParameter();
+
+    @OneWay
+    void onewayMethod(String str);
+
+    String getCallbackValue();
+
+    String getOnewayValue();
+}

Propchange: incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalClientComponent.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalClientComponent.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalClientComponentImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalClientComponentImpl.java?rev=574649&view=auto
==============================================================================
--- incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalClientComponentImpl.java (added)
+++ incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalClientComponentImpl.java Tue Sep 11 10:46:35 2007
@@ -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.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+
+@Service(LocalClientComponent.class)
+public class LocalClientComponentImpl implements LocalClientComponent, LocalCallbackInterface {
+
+    @Reference
+    protected LocalServiceComponent aCallBackService;
+    private static String callbackValue;
+    private static String onewayValue;
+
+    public String foo1(ParameterObject po) {
+        po.field1 = "AComponent";
+        return "AComponent";
+    }
+
+    public String foo1(String str) throws Exception {
+        return str + "AComponent";
+    }
+
+    public String foo2(String str, int i) {
+        return str + "AComponent" + i;
+    }
+
+    public String foo2(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";
+    }
+
+}

Propchange: incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalClientComponentImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalClientComponentImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalServiceComponent.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalServiceComponent.java?rev=574649&view=auto
==============================================================================
--- incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalServiceComponent.java (added)
+++ incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalServiceComponent.java Tue Sep 11 10:46:35 2007
@@ -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.osoa.sca.annotations.Callback;
+import org.osoa.sca.annotations.Remotable;
+
+/**
+ * Remote be-directional callBackService
+ */
+@Remotable
+@Callback(LocalCallbackInterface.class)
+public interface LocalServiceComponent {
+
+    String foo(String str);
+
+    void callback(String str);
+
+    void modifyParameter();
+
+    ParameterObject getPO();
+
+}

Propchange: incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalServiceComponent.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalServiceComponent.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalServiceComponentImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalServiceComponentImpl.java?rev=574649&view=auto
==============================================================================
--- incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalServiceComponentImpl.java (added)
+++ incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalServiceComponentImpl.java Tue Sep 11 10:46:35 2007
@@ -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.osoa.sca.annotations.Callback;
+import org.osoa.sca.annotations.Service;
+
+@Service(LocalServiceComponent.class)
+public class LocalServiceComponentImpl implements LocalServiceComponent {
+
+    @Callback
+    protected LocalCallbackInterface 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(String str) {
+        return str;
+    }
+
+    public ParameterObject getPO() {
+        return po;
+    }
+
+}

Propchange: incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalServiceComponentImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalServiceComponentImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/ParameterObject.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/ParameterObject.java?rev=574649&view=auto
==============================================================================
--- incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/ParameterObject.java (added)
+++ incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/ParameterObject.java Tue Sep 11 10:46:35 2007
@@ -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 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;
+    }
+
+    @Override
+    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;
+    }
+}

Propchange: incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/ParameterObject.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/ParameterObject.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteCallbackInterface.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteCallbackInterface.java?rev=574649&view=auto
==============================================================================
--- incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteCallbackInterface.java (added)
+++ incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteCallbackInterface.java Tue Sep 11 10:46:35 2007
@@ -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.osoa.sca.annotations.Remotable;
+
+/**
+ * only for callBack
+ */
+@Remotable
+public interface RemoteCallbackInterface {
+
+    public void callbackMethod(String str);
+
+    public void modifyParameter(ParameterObject po);
+}

Propchange: incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteCallbackInterface.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteCallbackInterface.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteClientComponent.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteClientComponent.java?rev=574649&view=auto
==============================================================================
--- incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteClientComponent.java (added)
+++ incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteClientComponent.java Tue Sep 11 10:46:35 2007
@@ -0,0 +1,62 @@
+/*
+ * 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.    
+ */
+/*
+ * 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.osoa.sca.annotations.Remotable;
+
+/*  
+ * different signatures  
+ */
+
+@Remotable
+public interface RemoteClientComponent {
+
+    String foo1(ParameterObject po);
+
+    String foo2(int i, String str1) throws Exception;
+
+    void callback(String str);
+
+    void callModifyParameter();
+
+    String getCallbackValue();
+
+    void onewayMethod(String str);
+
+    String getOnewayValue();
+}

Propchange: incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteClientComponent.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteClientComponent.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteClientComponentImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteClientComponentImpl.java?rev=574649&view=auto
==============================================================================
--- incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteClientComponentImpl.java (added)
+++ incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteClientComponentImpl.java Tue Sep 11 10:46:35 2007
@@ -0,0 +1,74 @@
+/*
+ * 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.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+
+@Service(RemoteClientComponent.class)
+public class RemoteClientComponentImpl implements RemoteClientComponent, RemoteCallbackInterface {
+
+    @Reference
+    protected RemoteServiceComponent aCallBackService;
+    private static String callbackValue;
+    private static String onewayValue;
+
+    public String foo1(ParameterObject po) {
+        po.field1 = "BComponent";
+        return "BComponent";
+    }
+
+    public String foo2(int i, String str) throws Exception {
+        return str + "BComponent" + i;
+    }
+
+    public void callback(String str) {
+        aCallBackService.callback(str);
+    }
+
+    public void callModifyParameter() {
+        this.aCallBackService.modifyParameter();
+    }
+
+    public void callbackMethod(String str) {
+        callbackValue = str;
+    }
+
+    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 = "BComponent";
+    }
+}

Propchange: incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteClientComponentImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteClientComponentImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteServiceComponent.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteServiceComponent.java?rev=574649&view=auto
==============================================================================
--- incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteServiceComponent.java (added)
+++ incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteServiceComponent.java Tue Sep 11 10:46:35 2007
@@ -0,0 +1,36 @@
+/*
+ * 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.osoa.sca.annotations.Callback;
+import org.osoa.sca.annotations.Remotable;
+
+@Remotable
+@Callback(RemoteCallbackInterface.class)
+public interface RemoteServiceComponent {
+
+    String foo(String str);
+
+    void callback(String str);
+
+    void modifyParameter();
+
+    ParameterObject getPO();
+}

Propchange: incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteServiceComponent.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteServiceComponent.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteServiceComponentImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteServiceComponentImpl.java?rev=574649&view=auto
==============================================================================
--- incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteServiceComponentImpl.java (added)
+++ incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteServiceComponentImpl.java Tue Sep 11 10:46:35 2007
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.itest.interfaces;
+
+import org.osoa.sca.annotations.Callback;
+import org.osoa.sca.annotations.Service;
+
+@Service(RemoteServiceComponent.class)
+public class RemoteServiceComponentImpl implements RemoteServiceComponent {
+
+    @Callback
+    protected RemoteCallbackInterface 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(String str) {
+        return str;
+    }
+
+    public ParameterObject getPO() {
+        return po;
+    }
+
+}

Propchange: incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteServiceComponentImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteServiceComponentImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/itest/interfaces/src/main/resources/InterfacesTest.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/interfaces/src/main/resources/InterfacesTest.composite?rev=574649&view=auto
==============================================================================
--- incubator/tuscany/java/sca/itest/interfaces/src/main/resources/InterfacesTest.composite (added)
+++ incubator/tuscany/java/sca/itest/interfaces/src/main/resources/InterfacesTest.composite Tue Sep 11 10:46:35 2007
@@ -0,0 +1,40 @@
+<?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://www.osoa.org/xmlns/sca/1.0" xmlns:foo="http://foo" targetNamespace="http://foo"
+    name="InterfacesTest" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+    <component name="LocalClientComponent">
+        <implementation.java class="org.apache.tuscany.sca.itest.interfaces.LocalClientComponentImpl" />
+        <reference name="aCallBackService" target="LocalServiceComponent" />
+    </component>
+
+    <component name="RemoteClientComponent">
+        <implementation.java class="org.apache.tuscany.sca.itest.interfaces.RemoteClientComponentImpl" />
+        <reference name="aCallBackService" target="RemoteServiceComponent" />
+    </component>
+
+    <component name="LocalServiceComponent">
+        <implementation.java class="org.apache.tuscany.sca.itest.interfaces.LocalServiceComponentImpl" />
+    </component>
+
+    <component name="RemoteServiceComponent">
+        <implementation.java class="org.apache.tuscany.sca.itest.interfaces.RemoteServiceComponentImpl" />
+    </component>
+
+</composite>
\ No newline at end of file

Added: incubator/tuscany/java/sca/itest/interfaces/src/test/java/org/apache/tuscany/sca/itest/interfaces/InterfacesTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/interfaces/src/test/java/org/apache/tuscany/sca/itest/interfaces/InterfacesTestCase.java?rev=574649&view=auto
==============================================================================
--- incubator/tuscany/java/sca/itest/interfaces/src/test/java/org/apache/tuscany/sca/itest/interfaces/InterfacesTestCase.java (added)
+++ incubator/tuscany/java/sca/itest/interfaces/src/test/java/org/apache/tuscany/sca/itest/interfaces/InterfacesTestCase.java Tue Sep 11 10:46:35 2007
@@ -0,0 +1,121 @@
+/*
+ * 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 static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class InterfacesTestCase {
+    private static SCADomain domain;
+
+    @BeforeClass
+    public static void init() throws Exception {
+        domain = SCADomain.newInstance("InterfacesTest.composite");
+    }
+
+    @AfterClass
+    public static void destroy() throws Exception {
+        domain.close();
+    }
+
+    @Test
+    public void testLocalClient() {
+        LocalServiceComponent service = domain.getService(LocalServiceComponent.class, "LocalServiceComponent");
+        LocalClientComponent local = domain.getService(LocalClientComponent.class, "LocalClientComponent");
+
+        try {
+            ParameterObject po = new ParameterObject();
+            assertEquals("AComponent", local.foo1(po));
+            assertEquals("AComponent", po.field1);
+
+            assertEquals("AAComponent", local.foo1("A"));
+
+            assertEquals("AAComponent1", local.foo2("A", 1));
+            assertEquals("AAComponent1", local.foo2(1, "A"));
+        } catch (Exception e) {
+            fail();
+        }
+
+        try {
+            // test local callback
+            local.callback("CallBack");
+            Thread.sleep(100);
+            assertEquals("CallBack", local.getCallbackValue());
+
+            local.callModifyParameter();
+            Thread.sleep(100);
+            assertEquals("AComponent", service.getPO().field1);
+        } catch (Exception e) {
+            e.printStackTrace();
+            fail("CallBack failed");
+        }
+
+        try {
+            local.onewayMethod("OneWay");
+            Thread.sleep(100);
+            assertEquals("OneWay", local.getOnewayValue());
+        } catch (Exception e) {
+            fail("OneWay failed");
+        }
+    }
+
+    @Test
+    public void testRemoteClient() {
+        RemoteServiceComponent service = domain.getService(RemoteServiceComponent.class, "RemoteServiceComponent");
+        RemoteClientComponent remote = domain.getService(RemoteClientComponent.class, "RemoteClientComponent");
+
+        try {
+            ParameterObject po = new ParameterObject("NotBComponent");
+            assertEquals("BComponent", remote.foo1(po));
+            assertEquals("NotBComponent", po.field1);
+
+            assertEquals("BBComponent1", remote.foo2(1, "B"));
+        } catch (Exception e) {
+            e.printStackTrace();
+            fail();
+        }
+
+        try {
+            remote.callback("CallBack");
+            Thread.sleep(100);
+            assertEquals("CallBack", remote.getCallbackValue());
+
+            remote.callModifyParameter();
+            Thread.sleep(100);
+            assertEquals("CallBack", service.getPO().field1);
+        } catch (Exception e) {
+            fail("CallBack failed");
+        }
+
+        try {
+            remote.onewayMethod("OneWay");
+            Thread.sleep(100);
+            assertEquals("OneWay", remote.getOnewayValue());
+        } catch (Exception e) {
+            fail("OneWay failed");
+        }
+    }
+
+}

Propchange: incubator/tuscany/java/sca/itest/interfaces/src/test/java/org/apache/tuscany/sca/itest/interfaces/InterfacesTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/itest/interfaces/src/test/java/org/apache/tuscany/sca/itest/interfaces/InterfacesTestCase.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/tuscany/java/sca/itest/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/pom.xml?rev=574649&r1=574648&r2=574649&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/pom.xml (original)
+++ incubator/tuscany/java/sca/itest/pom.xml Tue Sep 11 10:46:35 2007
@@ -64,6 +64,7 @@
                 <module>recursive</module>
                 <module>references</module>
                 <module>services</module>
+                <module>interfaces</module>
                 <module>scopes</module>
                 <module>wsdl</module>
                 <module>wsdlless</module>



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org