jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chekutty, Kiran" <Kir...@Petrotechnics.com>
Subject New Bie ............Can U Help Please?
Date Fri, 08 Nov 2002 11:46:12 GMT
Hi all,

I am new to Junit & Cactus. We have a Project entirely based on Struts Framework. And
we are trying to write unit tests for the project. I know Junit tests are to be written first
& not after the project is up in running. But  we are planning for Version 2. Junit test
would to good for atleast V2. I have read about StrutsTestCase in http://strutstestcase.sourceforge.net.
I tried out an example using MockStrutsTestCase but couldn't succeed in  getting through.
So I thought I would try out Cactus approach for junit test I get the same exception as I
got for Mock approach. This is my code

public class TestLogin extends CactusStrutsTestCase{

    public TestLogin(String testName){
        super(testName);
    }

       public void testSuccessfulLogin(){
        setConfigFile("/WEB-INF/skyobma.xml");
        setRequestPathInfo("/Login");
        LoginFP inst=(LoginFP)getActionForm();
        String pw = inst.getPassword();
        String us = inst.getUserName();
        
        addRequestParameter("username",us);
        addRequestParameter("password",pw);
        actionPerform();
        verifyForwardPath("next");
        verifyActionErrors(new String[] {"error.login.invalid_username"});
     }


This is the Error I get. 
1.	java.lang.VerifyError: (class: servletunit/struts/Common, method: verifyNoActionErrors
signature: (Ljavax/servlet/http/HttpServletRequest;)V) Incompatible object argument for function
call 
2.	at servletunit.struts.MockStrutsTestCase.setRequestPathInfo(MockStrutsTestCase.java:312)

3.	at servletunit.struts.MockStrutsTestCase.setRequestPathInfo(MockStrutsTestCase.java:293)

4.	at com.petrotechnics.skyobma.test.login.event.TestLogin.testSuccessfulLogin(TestLogin.java:30)

5.	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
6.	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
7.	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)



May be I am doign something wrong.Can some guru help me...............................

Cheers

Kiran Chekutty
Petrotechnics Ltd.


--
To unsubscribe, e-mail:   <mailto:cactus-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:cactus-user-help@jakarta.apache.org>


Mime
View raw message