aspose file tools*
The moose likes Struts and the fly likes StrutsTestCase problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "StrutsTestCase problem" Watch "StrutsTestCase problem" New topic
Author

StrutsTestCase problem

shah rah
Ranch Hand

Joined: Jan 04, 2007
Posts: 124
This is the error I get when I run my testcase. There are many who have got this error when I googeled but found no solution.

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.

public class TestLoginAction extends MockStrutsTestCase{
public void setUp() throws Exception { super.setUp();
}
public void tearDown() throws Exception { super.tearDown(); }
public TestLoginAction(String testName) { super(testName); }


public void testSuccessfulLogin() {
setRequestPathInfo("/login");
addRequestParameter("username","aaa");
addRequestParameter("password","aaa");
actionPerform(); //error here
verifyForward("success");
assertEquals("aaa",(String) getSession().getAttribute("authentication"));
verifyNoActionErrors();
}


I have

JDK1.5 --RAD6---Struts 1.2.9

all are in Java Build Path (RAD projects--properties-javabuildpath)

junit-4.5.jar
strutstest-2.1.4.jar
Struts 1.2.9
jdk 1.5
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17259
    
    6

I think you wanted to post this in the Struts forum and not the forum underneath the Struts forum.

So I will move this one for you to the appropriate forum.

Have fun

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
shah rah
Ranch Hand

Joined: Jan 04, 2007
Posts: 124
Web-inf has to be in classpath of Junit
Run ... -> Classpath -> User Entries -> Advanced -> Add Folders, then pick the folder webcontent (it has to point to directory above web-inf, not web-inf )
 
 
subject: StrutsTestCase problem