I finally got Cactus to start again.
After modifying WebResponse and AbstractHttpClient.
I was still failing trying to getDeclaredMethods from AbstractTestCase
So I modified junit.framework.TestSuite
as follows
public TestSuite(final Class theClass) {
fName= theClass.getName();
Constructor constructor= null;
try {
constructor= getConstructor(theClass);
} catch (NoSuchMethodException e) {
addTest(warning("Class "+theClass.getName()+" has no
public constructor TestCase(String name)"));
return;
}
if (!Modifier.isPublic(theClass.getModifiers())) {
addTest(warning("Class "+theClass.getName()+" is not
public"));
return;
}
Class superClass= theClass;
Vector names= new Vector();
//while (Test.class.isAssignableFrom(superClass)) {
Method[] methods= superClass.getDeclaredMethods();
for (int i= 0; i < methods.length; i++) {
addTestMethod(methods[i], names,
constructor);
}
//superClass= superClass.getSuperclass();
//}
if (fTests.size() == 0)
addTest(warning("No tests found in
"+theClass.getName()));
}
Note that commented out the loop that gets "test methods" from parent
classes.
Not sure why it failed, but this works for now, and my Deadline is soon.
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 22, 2001 10:25 PM
To: [EMAIL PROTECTED]
Subject: Re: VAJ 3.5.3 Class loader problem
Vincent,
Thanks for your reply. I am using JUnit 3.7. I was using JUnit 3.7 with
Cactus version 1.1 also.
As far as I could see from following the execution of my code the logging
system is already initialised by the time runBare() is called.
Cactus/JUnit seems to want the initialisation to occur when the declared
methods of my custom test class are being gathered to identify which ones
start with "test" (ie. getDeclaredMethods() call in
junit.framework.TestSuite(Class)). If I don't add a static initialisation
in AbstractHttpClient and NOW in WebResponse, I get the error ("Failed to
invoke suite(): java.lang.NoClassDefFoundError").
I had to add it to WebResponse because I realised that my endXXX() method
was still the one from version 1.1 ie. with HttpURLConnection instead of
WebResponse.
<snip/>