I am using JUnit to test my servlet action and getting error...."SEVERE:The /WEB-INF/web.xml was not found."
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Neha_Sinha
Posted On:   Thursday, November 23, 2006 04:25 AM

my test case is public class LoginActionTest extends MockStrutsTestCase { public LoginActionTest(String testName) { super(testName); } protected void setUp() throws Exception { super.setUp(); } protected void tearDown() throws Exception { } public static Test suite() { TestSuite suite = new TestSuite(LoginActionTest.class); return suite; } public void testSuccessfulLogin() { System.out.println("entered the test case method"); setRequestPathInfo("/Login&qu   More>>

my test case is


public class LoginActionTest extends MockStrutsTestCase {


public LoginActionTest(String testName) {


super(testName);



}


protected void setUp() throws Exception {


super.setUp();


}


protected void tearDown() throws Exception {

}


public static Test suite() {


TestSuite suite = new TestSuite(LoginActionTest.class);


return suite;


}



public void testSuccessfulLogin() {



System.out.println("entered the test case method");


setRequestPathInfo("/Login");


actionPerform();


System.out.println("aaaas");




}



and the error that comes is : ---


Nov 23, 2006 2:32:47 PM org.apache.struts.action.ActionServlet initServlet
SEVERE: The /WEB-INF/web.xml was not found.


Nov 23, 2006 2:32:47 PM org.apache.struts.action.ActionServlet init


SEVERE: Unable to initialize Struts ActionServlet due to an unexpected exception or error thrown, so marking the servlet as unavailable. Most likely, this is due to an incorrect or missing library dependency.


javax.servlet.ServletException: The /WEB-INF/web.xml was not found.


at org.apache.struts.action.ActionServlet.initServlet(ActionServlet.java:1138)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:328)
at javax.servlet.GenericServlet.init(GenericServlet.java:211)
at servletunit.struts.MockStrutsTestCase.getActionServlet(MockStrutsTestCase.java:226)
at servletunit.struts.MockStrutsTestCase.actionPerform(MockStrutsTestCase.java:290)
at com.okaya.service.AMS.action.LoginActionTest.testSuccessfulLogin(LoginActionTest.java:44)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:297)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:672)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:567)
Nov 23, 2006 2:32:47 PM servletunit.struts.MockStrutsTestCase getActionServlet
SEVERE: Error initializing action servlet
javax.servlet.UnavailableException: The /WEB-INF/web.xml was not found.
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:368)
at javax.servlet.GenericServlet.init(GenericServlet.java:211)
at servletunit.struts.MockStrutsTestCase.getActionServlet(MockStrutsTestCase.java:226)
at servletunit.struts.MockStrutsTestCase.actionPerform(MockStrutsTestCase.java:290)
at com.okaya.service.AMS.action.LoginActionTest.testSuccessfulLogin(LoginActionTest.java:44)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:297)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:672)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:567)

   <<Less
About | Sitemap | Contact