I have newbie these testingUnit world.. I am facing following problem in using servlet unit. my testcase code..
public class ODDSControllerSTest extends TestCase { public static void main(String args[]) { junit.textui.TestRunner.run( suite() ); } public static Test suite() { return new TestSuite( ODDSControllerSTest.class ); }
public ODDSControllerSTest( String name ) { super( name ); } public void testHeader() throws Exception { WebConversation conversation = new WebConversation(); WebRequest request = new GetMethodWebRequest( "http://localhost:8080/LNT/ODDSControllerS" ); WebResponse response = conversation.getResponse( request ); assertEquals("Response failed",200,response.getResponseCode()); }
}*/
//import junit related classes import com.meterware.servletunit.*; import com.meterware.httpunit.*; import junit.framework.*; //import javax related classes import javax.servlet.ServletOutputStream; //import java related classes import java.io.*; public class LNTControllerSTest extends TestCase { public void testForwardToRetrieveJSP() throws Exception { ServletRunner sr = new ServletRunner( "web.xml" ); ServletUnitClient client = sr.newClient(); } } @ line2 that is getting client ,am getting error java.lang.ExceptionininitializeError pls help me out