-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Could not find datasource using StrutsTestCase
PostPosted: Wed Jan 16, 2008 5:04 am 
Newbie

Joined: Wed Mar 14, 2007 4:35 am
Posts: 7
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.