facebook

Testing struts Action with Cactus

  1. MyEclipse IDE
  2.  > 
  3. Comments
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #222327 Reply

    kabhishek
    Member

    Hi…
    I am a beginer in Cactus.
    I am using cactus for testing my UserLoginAction….
    I am having the code sample as …

    public class UserLoginTester extends StrutsTestCase {
    public UserLoginTester(String testName) {
    super(testName);
    }

    public void testSuccessfulLogin() {
    setRequestPathInfo(“/userLogin”);
    addRequestParameter(“userEmail”,”support@granwill.com”);
    addRequestParameter(“pass”,”granwill”);
    actionPerform();
    verifyForward(“logged”);
    assertEquals(“support@granwill.com”,(String)getSession().getAttribute(“authinticate”));
    }
    But i’m getting error
    “StrutsTestCase cannot be resolved or is not a valid superclass” although I have added the cactus-1.6.1.jar along with all the necessary jars. I’m using cactus-12-1.6.1 …
    Can anyone help giving the details of the implementation with the full sample code….
    Thanks in adv..
    Abhishek

    #222328 Reply

    kabhishek
    Member

    Abhishek

    #222329 Reply

    kabhishek
    Member

    Kumar Abhishek

    #222337 Reply

    kitm
    Member

    Kumar,

    The class you are trying to extend (StrutsTestCase) is not a cactus class. Cactus provides three classes you can extend (ServletTestCase, JspTestCase, and FilterTestCase) – please refer to the Cactus how-to docs at http://jakarta.apache.org/cactus/writing/howto_testcase.html for more details.

    It looks like you want to test a struts application and for that you’ll need a cactus add-on library called StrutsTestCase which you can find at http://strutstestcase.sourceforge.net/. This library provides a class, CactusStrutsTestCase, that looks like what you may want to use. Please refer to the StrustTestCase online documentation for more details on that.

    Happy testing!
    -Kit

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Testing struts Action with Cactus

You must be logged in to post in the forum log in