I use StrutsTestCase2.4 under netbeans7.0 with struts1.3
When running testCase, it shows:
Error initializing action servlet
javax.servlet.UnavailableException: The /WEB-INF/web.xml was not found.
I've googled this problem and it is suggested to be solved by setContextDirectory(new File("../web"));
:
protected void setUp() throws Exception
{
super.setUp();
setContextDirectory(new File("../web"));
}
But I am not quite sure what the location of new File()
should be.
My File tree is
|───build
│ ├───test
│ │ └───classes
│ │ └───com
│ │ └───stolon
│ │ ├───common
│ │ ├───database
│ │ ├───helpers
│ │ └───struts
│ └───web
│ ├───META-INF
│ └───WEB-INF
│ ├───classes
│ │ └───com
│ │ └───stolon
│ │ ├───algorithm
│ │ ├───database
│ │ ├───helpers
│ │ ├───servlet
│ │ ├───structures
│ │ └───struts
│ └───lib
├───nbproject
│ └───private
├───src
│ ├───conf
│ └───java
│ └───com
│ └───stolon
│ ├───algorithm
│ ├───database
│ ├───helpers
│ ├───servlet
│ ├───structures
│ └───struts
├───test
│ └───com
│ └───stolon
│ ├───common
│ ├───database
│ ├───helpers
│ └───struts
└───web
├───META-INF
└───WEB-INF
My test file is under test-com-stolon-struts.