[jboss-cvs] JBossRemoting/src/tests/org/jboss/test/remoting/transport/web ...
Ron Sigal
ron_sigal at yahoo.com
Thu Oct 11 01:11:31 EDT 2007
User: rsigal
Date: 07/10/11 01:11:31
Modified: src/tests/org/jboss/test/remoting/transport/web Tag:
remoting_2_x WebInvokerTestClient.java
Log:
JBREM-813: Handles case where return-exception is set to "true".
Revision Changes Path
No revision
No revision
1.13.4.2 +16 -5 JBossRemoting/src/tests/org/jboss/test/remoting/transport/web/WebInvokerTestClient.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: WebInvokerTestClient.java
===================================================================
RCS file: /cvsroot/jboss/JBossRemoting/src/tests/org/jboss/test/remoting/transport/web/WebInvokerTestClient.java,v
retrieving revision 1.13.4.1
retrieving revision 1.13.4.2
diff -u -b -r1.13.4.1 -r1.13.4.2
--- WebInvokerTestClient.java 8 Jun 2007 06:17:49 -0000 1.13.4.1
+++ WebInvokerTestClient.java 11 Oct 2007 05:11:31 -0000 1.13.4.2
@@ -132,17 +132,22 @@
throws Throwable
{
-
Object response = null;
+
try
{
+ System.out.println("making exception invocation");
response = remotingClient.invoke(WebInvocationHandler.THROW_EXCEPTION_PARAM, metadata);
assertTrue("Should have thrown WebServerError and not made it to here.", false);
}
- catch (IOException error)
+ catch (Exception error)
{
+ System.out.println("exception: " + error + " " + error.getMessage());
// having to check class name instead of just catching type WebServerError so
// can use for backwards compatibility tests since WebServerError is new since 2.0.0.CR1.
+
+ if (getLocatorURI().indexOf("return-exception=true") == -1)
+ {
if (error.getClass().getName().endsWith("WebServerError"))
{
assertTrue(true);
@@ -152,6 +157,12 @@
assertTrue("Did not get WebServerError thrown as expected", false);
}
}
+ else
+ {
+ assertTrue("Did not get WebTestException", error instanceof WebTestException);
+ }
+ }
+
metadata.put(HTTPMetadataConstants.NO_THROW_ON_ERROR, "true");
response = remotingClient.invoke(WebInvocationHandler.THROW_EXCEPTION_PARAM, metadata);
if (response instanceof Exception)
More information about the jboss-cvs-commits
mailing list