not able to run the HttpUnit test (HttpUnit is an extension of Junit)
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Tuesday, May 13, 2003 03:40 AM

hello, i am working on HttpUnit test cases. i am not able to runt an HttpUnit test. i get the following error when i execute the test using JUnit's TestRunner. ---------------------------------------------------------- Failed to invoke suite():java.lang.NoSuchMethodError: org.apache.xerces.xni.Augm entations.clear()V The code for the Test class is as follows: ------------------------------------------------- import junit.framework.*; import com.meterware.httpunit.*; public class SimpleRequest extends TestCase { WebConversation wc = new WebConversation(); String base_url = &quo   More>>


hello,


i am working on HttpUnit test cases.

i am not able to runt an HttpUnit test.
i get the following error when i execute the test using JUnit's TestRunner.


----------------------------------------------------------

Failed to invoke suite():java.lang.NoSuchMethodError: org.apache.xerces.xni.Augm
entations.clear()V




The code for the Test class is as follows:

-------------------------------------------------

			
import junit.framework.*;
import com.meterware.httpunit.*;

public class SimpleRequest extends TestCase {
WebConversation wc = new WebConversation();
String base_url = "http://localhost:8080/examples/jsp/sessions/carts.html";
public SimpleRequest(String name) {
super(name);
}
public void testRequest() {
WebResponse resp = null;
try {
resp = wc.getResponse( base_url );
} catch (java.net.MalformedURLException e) {
System.out.println("Bad url: " + e);
} catch (java.io.IOException e) {
System.out.println("IO Err: " + e);
} catch (org.xml.sax.SAXException e) {
System.out.println("XML Err: " + e);
}
assertEquals(200, resp.getResponseCode());

}

public static void main(String args[])
{

junit.textui.TestRunner.run(suite());
}

public static Test suite()
{
TestSuite ts = new TestSuite();
ts.addTest(new SimpleRequest("testRequest"));
return(ts);
}

}



kindly let me know the solution for this.



regards,


sonali    <<Less

Re: not able to run the HttpUnit test (HttpUnit is an extension of Junit)

Posted By:   Rameshkumar_Poopandi  
Posted On:   Tuesday, July 8, 2003 02:10 AM

The following is the javadoc for NoSuchMethodError



Thrown if an application tries to call a specified method of a class (either static or instance), and that class no longer has a definition of that method.


Normally, this error is caught by the compiler; this error can only occur at run time if the definition of a class has incompatibly changed.


So check compatibility.

Re: not able to run the HttpUnit test (HttpUnit is an extension of Junit)

Posted By:   Arlie_Norwood  
Posted On:   Tuesday, July 1, 2003 08:57 AM

Make sure you have xercesImpl.jar and xmlParserAPIs.jar in your class path.
About | Sitemap | Contact