Hi all
I have a web application usging Struts, SqlServer and Hibernate which works ok but I'm trying to use StrutsTestCase on it and it's with this when the web application doesn't work.
My hibernate.cfg.xml is
....
<property name="connection.datasource">java:/comp/env/jdbc/papfvsf</property>
...
All mappings work fine when I test manually my application, only have error if I use this test framework.
My test file is
public class TestLoginAction extends MockStrutsTestCase{
public void setUp() throws Exception {
super.setUp();
setContextDirectory(new File("C:/Develop/workspaces/ANECA_DANI/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/webapps/ANECA-PAPF-Eval"));
setConfigFile("WEB-INF/classes/struts/struts-config.xml");
setServletConfigFile("WEB-INF/web.xml");
//context = new ServletContextSimulator();
//request = new HttpServletRequestSimulator(context);
//response = new HttpServletResponseSimulator();
//servlet = new RateServlet();
}
public void tearDown() throws Exception { super.tearDown(); }
public TestLoginAction(String testName) { super(testName); }
public void testList() {
setRequestPathInfo("/login");
actionPerform();
verifyForward("default");
verifyNoActionErrors();
}
public static void main(String[] args) {
junit.textui.TestRunner.run(TestLoginAction.class);
}
}
Do someone know who can be the error? Thanks a lot in advance
|