Author: slaws
Date: Mon Feb 27 13:13:29 2012
New Revision: 1294142

URL: http://svn.apache.org/viewvc?rev=1294142&view=rev
Log:
Extend exceptions test to include a remote binding. Some inconsistencies here 
that need thinking about. 

Added:
    
tuscany/sca-java-2.x/trunk/testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/RemoteWSExceptionHandlerImpl.java
Modified:
    tuscany/sca-java-2.x/trunk/testing/itest/exceptions/pom.xml
    
tuscany/sca-java-2.x/trunk/testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionHandler.java
    
tuscany/sca-java-2.x/trunk/testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionThrower.java
    
tuscany/sca-java-2.x/trunk/testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionHandlerImpl.java
    
tuscany/sca-java-2.x/trunk/testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionRemoteThrowerImpl.java
    
tuscany/sca-java-2.x/trunk/testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionThrowerImpl.java
    
tuscany/sca-java-2.x/trunk/testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/RemoteExceptionHandlerImpl.java
    
tuscany/sca-java-2.x/trunk/testing/itest/exceptions/src/main/resources/ExceptionTest.composite
    
tuscany/sca-java-2.x/trunk/testing/itest/exceptions/src/test/java/org/apache/tuscany/sca/test/exceptions/ExceptionsTestCase.java

Modified: tuscany/sca-java-2.x/trunk/testing/itest/exceptions/pom.xml
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/exceptions/pom.xml?rev=1294142&r1=1294141&r2=1294142&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/exceptions/pom.xml (original)
+++ tuscany/sca-java-2.x/trunk/testing/itest/exceptions/pom.xml Mon Feb 27 
13:13:29 2012
@@ -36,5 +36,16 @@
             <version>2.0-SNAPSHOT</version>
         </dependency>
         
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
+            <version>2.0-SNAPSHOT</version>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-host-jetty</artifactId>
+            <version>2.0-SNAPSHOT</version>
+        </dependency>
     </dependencies>
 </project>

Modified: 
tuscany/sca-java-2.x/trunk/testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionHandler.java
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionHandler.java?rev=1294142&r1=1294141&r2=1294142&view=diff
==============================================================================
--- 
tuscany/sca-java-2.x/trunk/testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionHandler.java
 (original)
+++ 
tuscany/sca-java-2.x/trunk/testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionHandler.java
 Mon Feb 27 13:13:29 2012
@@ -19,6 +19,8 @@
 
 package org.apache.tuscany.sca.test.exceptions;
 
+import org.oasisopen.sca.ServiceRuntimeException;
+
 public interface ExceptionHandler {
 
     void testing();
@@ -28,5 +30,10 @@ public interface ExceptionHandler {
     String getTheGood();
 
     UnChecked getTheUgly();
-
+    
+    ServiceRuntimeException getServiceRuntimeException();
+    
+    ServiceRuntimeException getBindingException();
+    
+    ServiceRuntimeException getUncheckedException();
 }

Modified: 
tuscany/sca-java-2.x/trunk/testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionThrower.java
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionThrower.java?rev=1294142&r1=1294141&r2=1294142&view=diff
==============================================================================
--- 
tuscany/sca-java-2.x/trunk/testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionThrower.java
 (original)
+++ 
tuscany/sca-java-2.x/trunk/testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionThrower.java
 Mon Feb 27 13:13:29 2012
@@ -19,6 +19,8 @@
 
 package org.apache.tuscany.sca.test.exceptions;
 
+import org.oasisopen.sca.ServiceRuntimeException;
+
 /**
  * Local exception thrower
  * @version $Rev$ $Date$
@@ -27,11 +29,13 @@ public interface ExceptionThrower {
     Checked BAD = new Checked("theBad");
     UnChecked UGLY = new UnChecked("theUgly");
     String SO_THEY_SAY = "All is good that ends good.";
+    ServiceRuntimeException SERVICE_RUNTIME_EXCEPTION = new 
ServiceRuntimeException("A service runtime exception");
 
     String theGood() throws Checked;
 
     String theBad() throws Checked;
 
     String theUgly() throws Checked;
-
+    
+    String serviceRuntimeException();
 }

Modified: 
tuscany/sca-java-2.x/trunk/testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionHandlerImpl.java
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionHandlerImpl.java?rev=1294142&r1=1294141&r2=1294142&view=diff
==============================================================================
--- 
tuscany/sca-java-2.x/trunk/testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionHandlerImpl.java
 (original)
+++ 
tuscany/sca-java-2.x/trunk/testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionHandlerImpl.java
 Mon Feb 27 13:13:29 2012
@@ -23,6 +23,7 @@ import org.apache.tuscany.sca.test.excep
 import org.apache.tuscany.sca.test.exceptions.ExceptionHandler;
 import org.apache.tuscany.sca.test.exceptions.ExceptionThrower;
 import org.apache.tuscany.sca.test.exceptions.UnChecked;
+import org.oasisopen.sca.ServiceRuntimeException;
 import org.oasisopen.sca.annotation.Reference;
 import org.oasisopen.sca.annotation.Scope;
 
@@ -37,6 +38,8 @@ public class ExceptionHandlerImpl implem
     private Checked theBad;
 
     private UnChecked theUgly;
+    
+    private ServiceRuntimeException serviceRuntimeException;
 
     public void testing() {
 
@@ -88,6 +91,29 @@ public class ExceptionHandlerImpl implem
 
             System.out.println(ExceptionThrower.SO_THEY_SAY + " " + INIT);
         }
+        
+        result = INIT;
+        try {
+            result = exceptionThrower.serviceRuntimeException();
+            // incredible
+            assert false : "Expected 'ServiceRuntimeException' Exception";
+
+        } catch (ServiceRuntimeException e) {
+            
+            serviceRuntimeException = e;
+
+        } catch (UnChecked e) {
+            // This is not so good...
+            assert false : "Got wrong exception '" + e.getClass().getName();
+            assert result == INIT;
+
+        } catch (Throwable t) {
+            // This is not good.
+            assert false;
+            assert result == INIT;
+
+            System.out.println(ExceptionThrower.SO_THEY_SAY + " " + INIT);
+        }
 
     }
 
@@ -111,5 +137,16 @@ public class ExceptionHandlerImpl implem
     public ExceptionThrower getExceptionThrower() {
         return exceptionThrower;
     }
+    
+    public ServiceRuntimeException getServiceRuntimeException() {
+        return serviceRuntimeException;
+    }
 
+    public ServiceRuntimeException getBindingException() {
+        return null;
+    }
+    
+    public ServiceRuntimeException getUncheckedException() {
+        return null;
+    }
 }

Modified: 
tuscany/sca-java-2.x/trunk/testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionRemoteThrowerImpl.java
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionRemoteThrowerImpl.java?rev=1294142&r1=1294141&r2=1294142&view=diff
==============================================================================
--- 
tuscany/sca-java-2.x/trunk/testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionRemoteThrowerImpl.java
 (original)
+++ 
tuscany/sca-java-2.x/trunk/testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionRemoteThrowerImpl.java
 Mon Feb 27 13:13:29 2012
@@ -21,6 +21,7 @@ package org.apache.tuscany.sca.test.exce
 
 import org.apache.tuscany.sca.test.exceptions.Checked;
 import org.apache.tuscany.sca.test.exceptions.ExceptionRemoteThrower;
+import org.oasisopen.sca.ServiceRuntimeException;
 import org.oasisopen.sca.annotation.Service;
 
 /**
@@ -40,5 +41,9 @@ public class ExceptionRemoteThrowerImpl 
     public String theUgly() throws Checked {
         throw UGLY;
     }
+    
+    public String serviceRuntimeException() {
+        throw new ServiceRuntimeException("A service runtime exception");
+    }
 
 }

Modified: 
tuscany/sca-java-2.x/trunk/testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionThrowerImpl.java
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionThrowerImpl.java?rev=1294142&r1=1294141&r2=1294142&view=diff
==============================================================================
--- 
tuscany/sca-java-2.x/trunk/testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionThrowerImpl.java
 (original)
+++ 
tuscany/sca-java-2.x/trunk/testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionThrowerImpl.java
 Mon Feb 27 13:13:29 2012
@@ -21,6 +21,7 @@ package org.apache.tuscany.sca.test.exce
 
 import org.apache.tuscany.sca.test.exceptions.Checked;
 import org.apache.tuscany.sca.test.exceptions.ExceptionThrower;
+import org.oasisopen.sca.ServiceRuntimeException;
 import org.oasisopen.sca.annotation.Service;
 
 /**
@@ -41,5 +42,9 @@ public class ExceptionThrowerImpl implem
     public String theUgly() throws Checked {
         throw UGLY;
     }
+    
+    public String serviceRuntimeException() {
+        throw SERVICE_RUNTIME_EXCEPTION;
+    }
 
 }

Modified: 
tuscany/sca-java-2.x/trunk/testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/RemoteExceptionHandlerImpl.java
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/RemoteExceptionHandlerImpl.java?rev=1294142&r1=1294141&r2=1294142&view=diff
==============================================================================
--- 
tuscany/sca-java-2.x/trunk/testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/RemoteExceptionHandlerImpl.java
 (original)
+++ 
tuscany/sca-java-2.x/trunk/testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/RemoteExceptionHandlerImpl.java
 Mon Feb 27 13:13:29 2012
@@ -24,6 +24,7 @@ import org.apache.tuscany.sca.test.excep
 import org.apache.tuscany.sca.test.exceptions.ExceptionRemoteThrower;
 import org.apache.tuscany.sca.test.exceptions.ExceptionThrower;
 import org.apache.tuscany.sca.test.exceptions.UnChecked;
+import org.oasisopen.sca.ServiceRuntimeException;
 import org.oasisopen.sca.annotation.Reference;
 import org.oasisopen.sca.annotation.Scope;
 
@@ -38,6 +39,8 @@ public class RemoteExceptionHandlerImpl 
     private Checked theBad;
 
     private UnChecked theUgly;
+    
+    private ServiceRuntimeException serviceRuntimeException;
 
     public void testing() {
 
@@ -89,6 +92,29 @@ public class RemoteExceptionHandlerImpl 
 
             System.out.println(ExceptionThrower.SO_THEY_SAY + " " + INIT);
         }
+        
+        result = INIT;
+        try {
+            result = exceptionThrower.serviceRuntimeException();
+            // incredible
+            assert false : "Expected 'ServiceRuntimeException' Exception";
+
+        } catch (ServiceRuntimeException e) {
+            
+            serviceRuntimeException = e;
+
+        } catch (UnChecked e) {
+            // This is not so good...
+            assert false : "Got wrong exception '" + e.getClass().getName();
+            assert result == INIT;
+
+        } catch (Throwable t) {
+            // This is not good.
+            assert false;
+            assert result == INIT;
+
+            System.out.println(ExceptionThrower.SO_THEY_SAY + " " + INIT);
+        }        
 
     }
 
@@ -112,5 +138,16 @@ public class RemoteExceptionHandlerImpl 
     public ExceptionRemoteThrower getExceptionThrower() {
         return exceptionThrower;
     }
+    
+    public ServiceRuntimeException getServiceRuntimeException() {
+        return serviceRuntimeException;
+    }
 
+    public ServiceRuntimeException getBindingException() {
+        return null;
+    }
+    
+    public ServiceRuntimeException getUncheckedException() {
+        return null;
+    }
 }

Added: 
tuscany/sca-java-2.x/trunk/testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/RemoteWSExceptionHandlerImpl.java
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/RemoteWSExceptionHandlerImpl.java?rev=1294142&view=auto
==============================================================================
--- 
tuscany/sca-java-2.x/trunk/testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/RemoteWSExceptionHandlerImpl.java
 (added)
+++ 
tuscany/sca-java-2.x/trunk/testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/RemoteWSExceptionHandlerImpl.java
 Mon Feb 27 13:13:29 2012
@@ -0,0 +1,176 @@
+/*
+ * 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.test.exceptions.impl;
+
+import org.apache.tuscany.sca.test.exceptions.Checked;
+import org.apache.tuscany.sca.test.exceptions.ExceptionHandler;
+import org.apache.tuscany.sca.test.exceptions.ExceptionRemoteThrower;
+import org.apache.tuscany.sca.test.exceptions.ExceptionThrower;
+import org.apache.tuscany.sca.test.exceptions.UnChecked;
+import org.oasisopen.sca.ServiceRuntimeException;
+import org.oasisopen.sca.annotation.Reference;
+import org.oasisopen.sca.annotation.Scope;
+
+@Scope("COMPOSITE")
+public class RemoteWSExceptionHandlerImpl implements ExceptionHandler {
+    static final String INIT = "INIT";
+
+    private ExceptionRemoteThrower exceptionThrower;
+    
+    @Reference
+    private ExceptionRemoteThrower exceptionThrowerDuff;
+
+    private String theGood;
+
+    private Checked theBad;
+
+    private UnChecked theUgly;
+    
+    private ServiceRuntimeException uncheckedException;
+    
+    private ServiceRuntimeException serviceRuntimeException;
+    
+    private ServiceRuntimeException bindingException;
+
+    public void testing() {
+
+        assert exceptionThrower != null : "'exceptionThrower' never wired";
+        String result = INIT;
+        try {
+            theGood = result = exceptionThrower.theGood();
+            assert result.equals(ExceptionThrower.SO_THEY_SAY);                
        
+        } catch (Throwable e) {
+            assert result == INIT;
+            assert false;
+            e.printStackTrace();
+        }
+
+        result = INIT;
+        try {
+            result = exceptionThrower.theBad();
+            // incredible
+            assert false : "Expected 'Check' Exception";
+
+        } catch (Checked e) {
+            // This is good...
+            assert result == INIT;
+            theBad = e;
+        } catch (Throwable t) {
+            // This is not so good.
+            t.printStackTrace();
+            assert result == INIT;
+            assert false : "Got wrong exception '" + t.getClass().getName();
+        }
+
+        result = INIT;
+        try {
+            result = exceptionThrower.theUgly();
+            // incredible
+            assert false : "Expected 'UnCheck' Exception";
+
+        } catch (ServiceRuntimeException e) {
+            
+            uncheckedException = e;
+
+        } catch (Checked e) {
+            // This is not so good...
+            assert false : "Got wrong exception '" + e.getClass().getName();
+            assert result == INIT;
+        } catch (UnChecked e) {
+            theUgly = e;
+
+        } catch (Throwable t) {
+            // This is not good.           
+            assert false;
+            assert result == INIT;
+
+            System.out.println(ExceptionThrower.SO_THEY_SAY + " " + INIT);     
       
+        }
+        
+        result = INIT;
+        try {
+            result = exceptionThrower.serviceRuntimeException();
+            // incredible
+            assert false : "Expected 'ServiceRuntimeException' Exception";
+
+        } catch (ServiceRuntimeException e) {
+            
+            serviceRuntimeException = e;
+
+        } catch (UnChecked e) {
+            // This is not so good...
+            assert false : "Got wrong exception '" + e.getClass().getName();
+            assert result == INIT;
+
+        } catch (Throwable t) {
+            // This is not good.
+            assert false;
+            assert result == INIT;
+
+            System.out.println(ExceptionThrower.SO_THEY_SAY + " " + INIT);
+        }    
+        
+        result = INIT;
+        try {
+            theGood = result = exceptionThrowerDuff.theGood();
+            assert result.equals(ExceptionThrower.SO_THEY_SAY);  
+        } catch (ServiceRuntimeException e) {
+            bindingException = e;
+        } catch (Throwable e) {
+            assert result == INIT;
+            assert false;
+            e.printStackTrace();
+        }
+
+    }
+
+    @Reference
+    public void setExceptionThrower(ExceptionRemoteThrower exceptionThrower) {
+        this.exceptionThrower = exceptionThrower;
+    }
+
+    public String getTheGood() {
+        return theGood;
+    }
+
+    public Checked getTheBad() {
+        return theBad;
+    }
+
+    public UnChecked getTheUgly() {
+        return theUgly;
+    }
+
+    public ExceptionRemoteThrower getExceptionThrower() {
+        return exceptionThrower;
+    }
+    
+    public ServiceRuntimeException getServiceRuntimeException() {
+        return serviceRuntimeException;
+    }
+
+    public ServiceRuntimeException getBindingException() {
+        return bindingException;
+    }
+    
+    public ServiceRuntimeException getUncheckedException() {
+        return uncheckedException;
+    }
+}

Modified: 
tuscany/sca-java-2.x/trunk/testing/itest/exceptions/src/main/resources/ExceptionTest.composite
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/exceptions/src/main/resources/ExceptionTest.composite?rev=1294142&r1=1294141&r2=1294142&view=diff
==============================================================================
--- 
tuscany/sca-java-2.x/trunk/testing/itest/exceptions/src/main/resources/ExceptionTest.composite
 (original)
+++ 
tuscany/sca-java-2.x/trunk/testing/itest/exceptions/src/main/resources/ExceptionTest.composite
 Mon Feb 27 13:13:29 2012
@@ -36,6 +36,20 @@
   <component name="exceptionThrowerRemote">
     <implementation.java 
class="org.apache.tuscany.sca.test.exceptions.impl.ExceptionRemoteThrowerImpl" 
/>
   </component>
+  
+  <component name="mainRemoteWS">
+    <implementation.java 
class="org.apache.tuscany.sca.test.exceptions.impl.RemoteWSExceptionHandlerImpl"
 />
+    <reference name="exceptionThrower" 
target="exceptionThrowerRemoteWS/ExceptionRemoteThrower" />
+    <reference name="exceptionThrowerDuff">
+      <binding.ws uri="http://localhost:9086/ADuffURL"/>
+    </reference>
+  </component>
 
+  <component name="exceptionThrowerRemoteWS">
+    <implementation.java 
class="org.apache.tuscany.sca.test.exceptions.impl.ExceptionRemoteThrowerImpl" 
/>
+    <service name="ExceptionRemoteThrower">
+      <binding.ws/>
+    </service>
+  </component>
 
 </composite>

Modified: 
tuscany/sca-java-2.x/trunk/testing/itest/exceptions/src/test/java/org/apache/tuscany/sca/test/exceptions/ExceptionsTestCase.java
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/exceptions/src/test/java/org/apache/tuscany/sca/test/exceptions/ExceptionsTestCase.java?rev=1294142&r1=1294141&r2=1294142&view=diff
==============================================================================
--- 
tuscany/sca-java-2.x/trunk/testing/itest/exceptions/src/test/java/org/apache/tuscany/sca/test/exceptions/ExceptionsTestCase.java
 (original)
+++ 
tuscany/sca-java-2.x/trunk/testing/itest/exceptions/src/test/java/org/apache/tuscany/sca/test/exceptions/ExceptionsTestCase.java
 Mon Feb 27 13:13:29 2012
@@ -30,6 +30,7 @@ import org.apache.tuscany.sca.node.NodeF
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
+import org.oasisopen.sca.ServiceRuntimeException;
 
 public class ExceptionsTestCase {
 
@@ -49,6 +50,8 @@ public class ExceptionsTestCase {
         assertNotNull(exceptionHandler.getTheUgly());
         assertEquals(UnChecked.class, 
exceptionHandler.getTheUgly().getClass());
         assertSame(ExceptionThrower.UGLY, exceptionHandler.getTheUgly());
+        assertEquals(ServiceRuntimeException.class, 
exceptionHandler.getServiceRuntimeException().getClass());
+        assertEquals(ExceptionThrower.SERVICE_RUNTIME_EXCEPTION.getMessage(), 
exceptionHandler.getServiceRuntimeException().getMessage());
     }
 
     /**
@@ -64,11 +67,32 @@ public class ExceptionsTestCase {
         assertNotSame(ExceptionThrower.BAD, exceptionHandler.getTheBad());
         assertNotNull(exceptionHandler.getTheUgly());
         assertEquals(UnChecked.class, 
exceptionHandler.getTheUgly().getClass());
+        assertEquals(ServiceRuntimeException.class, 
exceptionHandler.getServiceRuntimeException().getClass());
+        assertEquals(ExceptionThrower.SERVICE_RUNTIME_EXCEPTION.getMessage(), 
exceptionHandler.getServiceRuntimeException().getMessage());
 
         // [rfeng] We're not in a position to copy non business exceptions
         // assertNotSame(ExceptionThrower.UGLY, exceptionHandler.getTheUgly());
 
     }
+    
+    /**
+     * Test exception handling over a remote binding
+     */
+    @Test
+    public void testRemoteWS() {
+        ExceptionHandler exceptionHandler = 
node.getService(ExceptionHandler.class, "mainRemoteWS");
+        exceptionHandler.testing();
+        assertEquals(ExceptionThrower.SO_THEY_SAY, 
exceptionHandler.getTheGood());
+        assertNotNull(exceptionHandler.getTheBad());
+        assertEquals(Checked.class, exceptionHandler.getTheBad().getClass());
+        assertNotSame(ExceptionThrower.BAD, exceptionHandler.getTheBad());
+        assertNotNull(exceptionHandler.getUncheckedException());
+        assertEquals(ServiceRuntimeException.class, 
exceptionHandler.getUncheckedException().getClass());
+        assertEquals(ServiceRuntimeException.class, 
exceptionHandler.getServiceRuntimeException().getClass());
+        assertEquals("org.apache.tuscany.sca.interfacedef.util.FaultException: 
" + ExceptionThrower.SERVICE_RUNTIME_EXCEPTION.getMessage(), 
exceptionHandler.getServiceRuntimeException().getMessage());
+        assertEquals(ServiceRuntimeException.class, 
exceptionHandler.getBindingException().getClass());
+        assertEquals("org.apache.tuscany.sca.interfacedef.util.FaultException: 
" + ExceptionThrower.SERVICE_RUNTIME_EXCEPTION.getMessage(), 
exceptionHandler.getServiceRuntimeException().getMessage());
+    }
 
     @BeforeClass
     public static void setUp() throws Exception {


Reply via email to