aspose file tools
The moose likes Struts and the fly likes Struts Unit Testing Action class giving errors Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "Struts Unit Testing Action class giving errors" Watch "Struts Unit Testing Action class giving errors" New topic
Author

Struts Unit Testing Action class giving errors

Laxman Chowdary
Greenhorn

Joined: Apr 11, 2012
Posts: 21

Hi All,
I'm new bee to struts unit testing.
this is my code snippet.
verifyForward("success");
verifyForwardPath("/jsp/Success.jsp");
assertEquals("struts", getSession().getAttribute("authentication"));
verifyNoActionErrors();

I got the error like the following.
java.lang.NoSuchMethodError: org.apache.struts.config.ForwardConfig.getContextRelative()Z
at servletunit.struts.Common.verifyForwardPath(Common.java:304)
at servletunit.struts.MockStrutsTestCase.verifyForward(MockStrutsTestCase.java:675)
at com.awpl.correspondence.test.LoginActionTest.testSuccessfulLogin(LoginActionTest.java:34)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)


Can anyone guide me soon to resolve the issue.
Reply is highly appreciated.

Thanks in advance,

Laxman chowdary

 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Struts Unit Testing Action class giving errors
 
Similar Threads
Pattern ReplaceAll issue (Illegal Group exception)
Junit error
Anyone understand what this exception means
NULL Pointer Exception
Unit testing portlets