You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-dev@jakarta.apache.org by vm...@apache.org on 2003/11/02 20:10:50 UTC
cvs commit: jakarta-cactus/framework/src/java/share/org/apache/cactus/server AbstractWebTestCaller.java
vmassol 2003/11/02 11:10:50
Modified: framework/src/java/share/org/apache/cactus/server
AbstractWebTestCaller.java
Log:
Check for null test results. Warn about potential error due to a load-balancer.
Revision Changes Path
1.24 +15 -1 jakarta-cactus/framework/src/java/share/org/apache/cactus/server/AbstractWebTestCaller.java
Index: AbstractWebTestCaller.java
===================================================================
RCS file: /home/cvs/jakarta-cactus/framework/src/java/share/org/apache/cactus/server/AbstractWebTestCaller.java,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- AbstractWebTestCaller.java 12 Jul 2003 19:31:41 -0000 1.23
+++ AbstractWebTestCaller.java 2 Nov 2003 19:10:50 -0000 1.24
@@ -193,6 +193,20 @@
WebTestResult result = (WebTestResult) (this.webImplicitObjects
.getServletContext().getAttribute(TEST_RESULTS));
+ // It can happen that the result has not been written in the Servlet
+ // context. This could happen for example when using a load-balancer
+ // which would direct the second Cactus HTTP connection to another
+ // instance. In that case, we throw an error.
+ if (result == null)
+ {
+ String message = "Error getting test result. This could happen "
+ + "for example if you're using a load-balancer. Please disable "
+ + "it before running Cactus tests.";
+
+ LOGGER.error(message);
+ throw new ServletException(message);
+ }
+
LOGGER.debug("Test Result = [" + result + "]");
// Write back the results to the outgoing stream as an XML string.
---------------------------------------------------------------------
To unsubscribe, e-mail: cactus-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: cactus-dev-help@jakarta.apache.org