ndlesiecki 01/10/03 07:49:39
Modified: src/framework/share/org/apache/cactus/server
AbstractTestCaller.java
Log:
changed some exception handling code to include a more verbose message
Revision Changes Path
1.3 +12 -5
jakarta-cactus/src/framework/share/org/apache/cactus/server/AbstractTestCaller.java
Index: AbstractTestCaller.java
===================================================================
RCS file:
/home/cvs/jakarta-cactus/src/framework/share/org/apache/cactus/server/AbstractTestCaller.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- AbstractTestCaller.java 2001/09/14 20:16:55 1.2
+++ AbstractTestCaller.java 2001/10/03 14:49:39 1.3
@@ -71,7 +71,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Vincent Massol</a>
*
- * @version $Id: AbstractTestCaller.java,v 1.2 2001/09/14 20:16:55 pier Exp $
+ * @version $Id: AbstractTestCaller.java,v 1.3 2001/10/03 14:49:39 ndlesiecki Exp $
*/
public abstract class AbstractTestCaller
{
@@ -296,16 +296,15 @@
}
// Get the class to call and build an instance of it.
- Class testClass = null;
+ Class testClass = getTestClassClass(theClassName);
AbstractTestCase testInstance = null;
try {
- testClass = getTestClassClass(theClassName);
Constructor constructor = testClass.getConstructor(
new Class[] { String.class });
testInstance = (AbstractTestCase)constructor.newInstance(
new Object[] { theTestCaseName });
} catch (Exception e) {
- String message = "Error instanciating class [" + theClassName +
+ String message = "Error instantiating class [" + theClassName +
"(" + theTestCaseName + ")]";
logger.error(message, e);
throw new ServletException(message, e);
@@ -331,7 +330,15 @@
testClass = Class.forName(theClassName);
} catch (Exception e) {
String message = "Error finding class [" + theClassName +
- "] in classpath";
+ "] in classpath. ";
+ message += "If you are getting this message Cactus may ";
+ message += "not be able to see your test cases.\r\n ";
+ message += "Possible causes include:\r\n";
+ message += "\t- Your webapp may not include your test classes,\r\n";
+ message += "\t- The cactus.jar resides in a global location and";
+ message += " your test classes reside in a specific webapp,\r\n";
+ message += "\t- Something else ... !";
+
logger.error(message, e);
throw new ServletException(message, e);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]