Author: slaws
Date: Thu Jan 29 15:00:33 2009
New Revision: 738875

URL: http://svn.apache.org/viewvc?rev=738875&view=rev
Log:
TUSCANY-2291, Separate the mixed callback error validation test from the other 
callback tests so that the error doesn't affect the rest of the tests

Added:
    tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/   
(with props)
    
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/pom.xml 
  (with props)
    tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/
    
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/
    
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/
    
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/
    
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/
    
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/
    
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/
    
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/
    
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/
    
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/
    
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/
    
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/AService.java
   (with props)
    
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/AServiceCallback.java
   (with props)
    
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/BService.java
   (with props)
    
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/BServiceCallback.java
   (with props)
    
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/Utilities.java
   (with props)
    
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/
    
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/AServiceImpl.java
   (with props)
    
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/mixed/
    
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/mixed/CService.java
   (with props)
    
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/mixed/impl/
    
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/mixed/impl/BServiceImpl.java
   (with props)
    
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/mixed/impl/CServiceImpl.java
   (with props)
    
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/resources/
    
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/resources/callback-mixed.composite
   (with props)
    
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/test/
    
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/test/java/
    
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/test/java/org/
    
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/test/java/org/apache/
    
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/test/java/org/apache/tuscany/
    
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/test/java/org/apache/tuscany/sca/
    
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/test/java/org/apache/tuscany/sca/vtest/
    
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/test/java/org/apache/tuscany/sca/vtest/javaapi/
    
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/test/java/org/apache/tuscany/sca/vtest/javaapi/conversation/
    
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/test/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/
    
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/test/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/CallbackTestCase.java
   (with props)
Removed:
    
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/mixed/
    
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callback/src/main/resources/callback-mixed.composite
Modified:
    
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callback/src/test/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/CallbackTestCase.java
    tuscany/branches/sca-java-1.x/vtest/java-api/conversation/pom.xml
    
tuscany/branches/sca-java-1.x/vtest/utilities/src/main/java/org/apache/tuscany/sca/vtest/utilities/ServiceFinder.java

Modified: 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callback/src/test/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/CallbackTestCase.java
URL: 
http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callback/src/test/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/CallbackTestCase.java?rev=738875&r1=738874&r2=738875&view=diff
==============================================================================
--- 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callback/src/test/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/CallbackTestCase.java
 (original)
+++ 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callback/src/test/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/CallbackTestCase.java
 Thu Jan 29 15:00:33 2009
@@ -174,25 +174,6 @@
     }
 
     /**
-     * Lines 534, 535
-     * <p>
-     * Callbacks may be used for both remotable and local services. Either both
-     * interfaces of a bidirectional service must be remotable, or both must be
-     * local. It is illegal to mix the two.
-     * <p>
-     * In this test configuration BServiceCallback is remotable and CService is
-     * not
-     */
-    @Test(expected = ServiceRuntimeException.class)
-    @Ignore("TUSCANY-2291")
-    public void statefulMixedCallback() throws Exception {
-        System.out.println("Setting up for mixed local/remote callback tests");
-        ServiceFinder.init("callback-mixed.composite");
-        aService = ServiceFinder.getService(AService.class, "AComponent");
-        aService.testCallback();
-    }
-
-    /**
      * Lines 613-615
      * <p>
      * A stateless callback interface is a callback whose interface is not

Propchange: 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Jan 29 15:00:33 2009
@@ -0,0 +1,4 @@
+.classpath
+.project
+.settings
+target

Added: 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/pom.xml
URL: 
http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/pom.xml?rev=738875&view=auto
==============================================================================
--- 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/pom.xml 
(added)
+++ 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/pom.xml 
Thu Jan 29 15:00:33 2009
@@ -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>java-api-annotations</artifactId>
+        <version>1.5-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    <artifactId>vtest-java-api-conversation-callback-mixed</artifactId>
+    <name>Apache Tuscany SCA vTest Java APIs and Annotations Verification 
Tests - Conversation - Callback - Mixed</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-host-embedded</artifactId>
+            <version>1.5-SNAPSHOT</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-implementation-java-runtime</artifactId>
+            <version>1.5-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency>
+        
+    </dependencies>
+</project>

Propchange: 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/AService.java
URL: 
http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/AService.java?rev=738875&view=auto
==============================================================================
--- 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/AService.java
 (added)
+++ 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/AService.java
 Thu Jan 29 15:00:33 2009
@@ -0,0 +1,30 @@
+/*
+ * 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.vtest.javaapi.conversation.callback;
+
+/**
+ * Simple Service
+ */
+public interface AService {
+
+    public void testCallback();
+
+    public void testCallback2();
+ 
+}

Propchange: 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/AService.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/AService.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/AServiceCallback.java
URL: 
http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/AServiceCallback.java?rev=738875&view=auto
==============================================================================
--- 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/AServiceCallback.java
 (added)
+++ 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/AServiceCallback.java
 Thu Jan 29 15:00:33 2009
@@ -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.vtest.javaapi.conversation.callback;
+
+import org.osoa.sca.annotations.Conversational;
+import org.osoa.sca.annotations.Remotable;
+
+/**
+ * Simple Remotable Service
+ */
+...@remotable
+...@conversational
+public interface AServiceCallback {
+
+    public void callBack(String someState);
+    
+}

Propchange: 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/AServiceCallback.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/AServiceCallback.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/BService.java
URL: 
http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/BService.java?rev=738875&view=auto
==============================================================================
--- 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/BService.java
 (added)
+++ 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/BService.java
 Thu Jan 29 15:00:33 2009
@@ -0,0 +1,40 @@
+/*
+ * 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.vtest.javaapi.conversation.callback;
+
+import 
org.apache.tuscany.sca.vtest.javaapi.conversation.callback.AServiceCallback;
+import org.osoa.sca.annotations.Callback;
+import org.osoa.sca.annotations.Conversational;
+import org.osoa.sca.annotations.Remotable;
+
+/**
+ * Simple Service
+ */
+...@remotable
+...@conversational
+...@callback(AServiceCallback.class)
+public interface BService {
+
+    public void setState(String someState);
+    
+    public String getState();
+
+    public void testCallBack(String string);
+
+}

Propchange: 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/BService.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/BService.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/BServiceCallback.java
URL: 
http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/BServiceCallback.java?rev=738875&view=auto
==============================================================================
--- 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/BServiceCallback.java
 (added)
+++ 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/BServiceCallback.java
 Thu Jan 29 15:00:33 2009
@@ -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.vtest.javaapi.conversation.callback;
+
+import org.osoa.sca.annotations.Conversational;
+import org.osoa.sca.annotations.Remotable;
+
+/**
+ * Simple Remotable Service
+ */
+...@remotable
+...@conversational
+public interface BServiceCallback {
+
+    public void callBack(String someState);
+    
+}

Propchange: 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/BServiceCallback.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/BServiceCallback.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/Utilities.java
URL: 
http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/Utilities.java?rev=738875&view=auto
==============================================================================
--- 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/Utilities.java
 (added)
+++ 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/Utilities.java
 Thu Jan 29 15:00:33 2009
@@ -0,0 +1,32 @@
+/*
+ * 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.vtest.javaapi.conversation.callback;
+
+public class Utilities {
+    
+    public static void delayQuarterSecond() {
+        try {
+            Thread.sleep(250);// millisecs
+        } catch (InterruptedException ex) {
+            throw new Error(ex);
+        }
+    }
+
+}

Propchange: 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/Utilities.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/Utilities.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/AServiceImpl.java
URL: 
http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/AServiceImpl.java?rev=738875&view=auto
==============================================================================
--- 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/AServiceImpl.java
 (added)
+++ 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/AServiceImpl.java
 Thu Jan 29 15:00:33 2009
@@ -0,0 +1,61 @@
+/*
+ * 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.vtest.javaapi.conversation.callback.impl;
+
+import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.AService;
+import 
org.apache.tuscany.sca.vtest.javaapi.conversation.callback.AServiceCallback;
+import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.BService;
+import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.Utilities;
+import org.junit.Assert;
+import org.osoa.sca.ServiceReference;
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Scope;
+import org.osoa.sca.annotations.Service;
+
+...@service(AService.class)
+...@scope("CONVERSATION")
+public class AServiceImpl implements AService, AServiceCallback {
+
+    @Reference
+    protected ServiceReference<BService> b;
+
+    private String someState;
+
+    public void callBack(String someState) {
+        System.out.println("A-callback called with this state => " + 
someState);
+        this.someState = someState;
+    }
+
+    public void testCallback() {
+        b.getService().testCallBack("Some string");
+        int count = 4;
+        while (someState == null && count > 0) {
+            Utilities.delayQuarterSecond();
+            count--;
+        }
+        if (someState == null)
+            Assert.fail("Callback not received by this instance");
+    }
+
+    public void testCallback2() {
+       Assert.fail("Should not be called");
+    }
+
+}

Propchange: 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/AServiceImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/AServiceImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/mixed/CService.java
URL: 
http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/mixed/CService.java?rev=738875&view=auto
==============================================================================
--- 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/mixed/CService.java
 (added)
+++ 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/mixed/CService.java
 Thu Jan 29 15:00:33 2009
@@ -0,0 +1,38 @@
+/*
+ * 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.vtest.javaapi.conversation.callback.mixed;
+
+import 
org.apache.tuscany.sca.vtest.javaapi.conversation.callback.BServiceCallback;
+import org.osoa.sca.annotations.Callback;
+import org.osoa.sca.annotations.Conversational;
+
+/**
+ * Simple Service
+ */
+...@conversational
+...@callback(BServiceCallback.class)
+public interface CService {
+
+    public void setState(String someState);
+
+    public String getState();
+
+    public void testCallBack(String string);
+
+}

Propchange: 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/mixed/CService.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/mixed/CService.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/mixed/impl/BServiceImpl.java
URL: 
http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/mixed/impl/BServiceImpl.java?rev=738875&view=auto
==============================================================================
--- 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/mixed/impl/BServiceImpl.java
 (added)
+++ 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/mixed/impl/BServiceImpl.java
 Thu Jan 29 15:00:33 2009
@@ -0,0 +1,73 @@
+/*
+ * 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.vtest.javaapi.conversation.callback.mixed.impl;
+
+import 
org.apache.tuscany.sca.vtest.javaapi.conversation.callback.AServiceCallback;
+import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.BService;
+import 
org.apache.tuscany.sca.vtest.javaapi.conversation.callback.BServiceCallback;
+import 
org.apache.tuscany.sca.vtest.javaapi.conversation.callback.mixed.CService;
+import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.Utilities;
+import org.junit.Assert;
+import org.osoa.sca.ServiceReference;
+import org.osoa.sca.annotations.Callback;
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Scope;
+import org.osoa.sca.annotations.Service;
+
+...@service(BService.class)
+...@scope("CONVERSATION")
+public class BServiceImpl implements BService, BServiceCallback {
+
+    String someState;
+
+    @Callback
+    protected AServiceCallback callback;
+
+    @Reference
+    protected ServiceReference<CService> c;
+
+    public void setState(String someState) {
+        this.someState = someState;
+    }
+
+    public String getState() {
+        return someState;
+    }
+
+    public void callBack(String someState) {
+        System.out.println("B-callback called with this state => " + 
someState);
+        this.someState = someState;
+    }
+
+    public void testCallBack(String someState) {
+
+        c.getService().testCallBack(someState);
+        int count = 4;
+        while (this.someState == null && count > 0) {
+            Utilities.delayQuarterSecond();
+            count--;
+        }
+        if (this.someState == null)
+            Assert.fail("Callback not received by this instance");
+
+        callback.callBack(someState);
+    }
+
+}

Propchange: 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/mixed/impl/BServiceImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/mixed/impl/BServiceImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/mixed/impl/CServiceImpl.java
URL: 
http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/mixed/impl/CServiceImpl.java?rev=738875&view=auto
==============================================================================
--- 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/mixed/impl/CServiceImpl.java
 (added)
+++ 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/mixed/impl/CServiceImpl.java
 Thu Jan 29 15:00:33 2009
@@ -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.vtest.javaapi.conversation.callback.mixed.impl;
+
+import 
org.apache.tuscany.sca.vtest.javaapi.conversation.callback.BServiceCallback;
+import 
org.apache.tuscany.sca.vtest.javaapi.conversation.callback.mixed.CService;
+import org.osoa.sca.annotations.Callback;
+import org.osoa.sca.annotations.Scope;
+import org.osoa.sca.annotations.Service;
+
+...@service(CService.class)
+...@scope("CONVERSATION")
+public class CServiceImpl implements CService {
+
+    String someState;
+
+    @Callback
+    protected BServiceCallback callback;
+
+    public void setState(String someState) {
+        this.someState = someState;
+    }
+
+    public String getState() {
+        return someState;
+    }
+
+    public void testCallBack(String someState) {
+        callback.callBack(someState);
+    }
+
+}

Propchange: 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/mixed/impl/CServiceImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/mixed/impl/CServiceImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/resources/callback-mixed.composite
URL: 
http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/resources/callback-mixed.composite?rev=738875&view=auto
==============================================================================
--- 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/resources/callback-mixed.composite
 (added)
+++ 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/resources/callback-mixed.composite
 Thu Jan 29 15:00:33 2009
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+       * Licensed to the Apache Software Foundation (ASF) under one
+       * or more contributor license agreements.  See the NOTICE file
+       * distributed with this work for additional information
+       * regarding copyright ownership.  The ASF licenses this file
+       * to you under the Apache License, Version 2.0 (the
+       * "License"); you may not use this file except in compliance
+       * with the License.  You may obtain a copy of the License at
+       *
+       *   http://www.apache.org/licenses/LICENSE-2.0
+       *
+       * Unless required by applicable law or agreed to in writing,
+       * software distributed under the License is distributed on an
+       * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+       * KIND, either express or implied.  See the License for the
+       * specific language governing permissions and limitations
+       * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0";
+       targetNamespace="http://java-api-tests"; 
name="Conversation-callback-mixed">
+       <component name="AComponent">
+               <implementation.java
+                       
class="org.apache.tuscany.sca.vtest.javaapi.conversation.callback.impl.AServiceImpl"
 />
+               <reference name="b" target="BComponent" />
+       </component>
+
+       <component name="BComponent">
+               <implementation.java
+                       
class="org.apache.tuscany.sca.vtest.javaapi.conversation.callback.mixed.impl.BServiceImpl"
 />
+               <reference name="c" target="CComponent" />
+       </component>
+       
+       <component name="CComponent">
+               <implementation.java
+                       
class="org.apache.tuscany.sca.vtest.javaapi.conversation.callback.mixed.impl.CServiceImpl"
 />
+       </component>
+</composite>

Propchange: 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/resources/callback-mixed.composite
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/resources/callback-mixed.composite
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/main/resources/callback-mixed.composite
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/test/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/CallbackTestCase.java
URL: 
http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/test/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/CallbackTestCase.java?rev=738875&view=auto
==============================================================================
--- 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/test/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/CallbackTestCase.java
 (added)
+++ 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/test/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/CallbackTestCase.java
 Thu Jan 29 15:00:33 2009
@@ -0,0 +1,73 @@
+/*
+ * 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.vtest.javaapi.conversation.callback;
+
+import org.apache.tuscany.sca.vtest.utilities.ServiceFinder;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.osoa.sca.ServiceRuntimeException;
+
+/**
+ * 
+ */
+public class CallbackTestCase {
+
+    protected static AService aService = null;
+
+    @Before
+    public void init() throws Exception {
+        try {
+            System.out.println("Setting up");
+        } catch (Exception ex) {
+            ex.printStackTrace();
+        }
+    }
+
+    @After
+    public void destroy() throws Exception {
+
+        System.out.println("Cleaning up");
+        ServiceFinder.cleanup();
+    }
+
+    /**
+     * Lines 534, 535
+     * <p>
+     * Callbacks may be used for both remotable and local services. Either both
+     * interfaces of a bidirectional service must be remotable, or both must be
+     * local. It is illegal to mix the two.
+     * <p>
+     * In this test configuration BServiceCallback is remotable and CService is
+     * not
+     */
+    @Test(expected = ServiceRuntimeException.class)
+    public void statefulMixedCallback() throws Exception {
+        System.out.println("Setting up for mixed local/remote callback tests");
+        ServiceFinder.init("callback-mixed.composite");
+        
+        // test an error was detected
+        
+        //aService = ServiceFinder.getService(AService.class, "AComponent");
+        //aService.testCallback();
+    }
+
+}

Propchange: 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/test/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/CallbackTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
tuscany/branches/sca-java-1.x/vtest/java-api/conversation/callbackmixed/src/test/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/CallbackTestCase.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: tuscany/branches/sca-java-1.x/vtest/java-api/conversation/pom.xml
URL: 
http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/vtest/java-api/conversation/pom.xml?rev=738875&r1=738874&r2=738875&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/vtest/java-api/conversation/pom.xml (original)
+++ tuscany/branches/sca-java-1.x/vtest/java-api/conversation/pom.xml Thu Jan 
29 15:00:33 2009
@@ -57,6 +57,7 @@
                 <module>lifetime</module>
                 <module>id</module>
                 <module>callback</module>
+                <module>callbackmixed</module>
            </modules>
         </profile>
     </profiles>

Modified: 
tuscany/branches/sca-java-1.x/vtest/utilities/src/main/java/org/apache/tuscany/sca/vtest/utilities/ServiceFinder.java
URL: 
http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/vtest/utilities/src/main/java/org/apache/tuscany/sca/vtest/utilities/ServiceFinder.java?rev=738875&r1=738874&r2=738875&view=diff
==============================================================================
--- 
tuscany/branches/sca-java-1.x/vtest/utilities/src/main/java/org/apache/tuscany/sca/vtest/utilities/ServiceFinder.java
 (original)
+++ 
tuscany/branches/sca-java-1.x/vtest/utilities/src/main/java/org/apache/tuscany/sca/vtest/utilities/ServiceFinder.java
 Thu Jan 29 15:00:33 2009
@@ -53,7 +53,10 @@
     }
 
     public static void cleanup() {
-        domain.close();
+        if (domain != null){
+            domain.close(); 
+        }
+      
         domain = null;
     }
 


Reply via email to