diff options
Diffstat (limited to 'sca-java-2.x/trunk/testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/RemoteExceptionHandlerImpl.java')
-rw-r--r-- | sca-java-2.x/trunk/testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/RemoteExceptionHandlerImpl.java | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/sca-java-2.x/trunk/testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/RemoteExceptionHandlerImpl.java b/sca-java-2.x/trunk/testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/RemoteExceptionHandlerImpl.java index a8a065f0e2..c5c2af5b70 100644 --- a/sca-java-2.x/trunk/testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/RemoteExceptionHandlerImpl.java +++ b/sca-java-2.x/trunk/testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/RemoteExceptionHandlerImpl.java @@ -24,6 +24,7 @@ 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; @@ -38,6 +39,8 @@ public class RemoteExceptionHandlerImpl implements ExceptionHandler { private Checked theBad; private UnChecked theUgly; + + private ServiceRuntimeException serviceRuntimeException; public void testing() { @@ -89,6 +92,29 @@ public class RemoteExceptionHandlerImpl implements ExceptionHandler { 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 implements ExceptionHandler { public ExceptionRemoteThrower getExceptionThrower() { return exceptionThrower; } + + public ServiceRuntimeException getServiceRuntimeException() { + return serviceRuntimeException; + } + public ServiceRuntimeException getBindingException() { + return null; + } + + public ServiceRuntimeException getUncheckedException() { + return null; + } } |