[jboss-cvs] JBossRemoting/src/tests/org/jboss/test/remoting/transport/web ...
Ron Sigal
ron_sigal at yahoo.com
Tue Oct 9 18:28:43 EDT 2007
User: rsigal
Date: 07/10/09 18:28:43
Modified: src/tests/org/jboss/test/remoting/transport/web Tag:
remoting_2_2_0_GA WebInvokerTestClient.java
Log:
JBREM-813: Handles case where return-exception is set to "true".
Revision Changes Path
No revision
No revision
1.13.8.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.8.1
retrieving revision 1.13.8.2
diff -u -b -r1.13.8.1 -r1.13.8.2
--- WebInvokerTestClient.java 9 May 2007 08:23:43 -0000 1.13.8.1
+++ WebInvokerTestClient.java 9 Oct 2007 22:28:43 -0000 1.13.8.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