This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

StrutsTestCase problem

 
shah rah
Ranch Hand
Posts: 124
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17276
6
IntelliJ IDE Mac Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
shah rah
Ranch Hand
Posts: 124
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 )
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic