Now I get .E Time: 0.161 There was 1 error: 1) testLoginButtonNew(com.planetu.upons.actions.MultiButtonActionTest) java.lang.ExceptionInInitializerError: java.util.MissingResourceException: Can't find resource for base name cactus, locale en_US java.lang.Throwable(java.lang.String) java.lang.Exception(java.lang.String) java.lang.RuntimeException(java.lang.String) java.util.MissingResourceException(java.lang.String, java.lang.String, java.lang.String) java.util.ResourceBundle java.util.ResourceBundle.getBundle(java.lang.String, java.util.Locale, java.lang.ClassLoader) java.util.ResourceBundle java.util.ResourceBundle.getBundle(java.lang.String) void org.apache.cactus.ServletTestCase.runTest() void org.apache.cactus.ServletTestCase.runTest() void org.apache.cactus.AbstractTestCase.runBare() void com.planetu.upons.AllAllTest.main(java.lang.String [])
FAILURES!!! Tests run: 1, Failures: 0, Errors: 1 ClassPath errors are the worst. And yes cactus.properties is in the project/Classpath. -----Original Message----- From: Nick Chalko [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 23, 2001 12:13 AM To: '[EMAIL PROTECTED]' Subject: RE: VAJ 3.5.3 Class loader problem 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/>