jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sachin" <csac...@pisoftek.com>
Subject About TestCases
Date Mon, 04 Aug 2003 10:19:22 GMT
Hello Kumar..

I am part of this forum for 3-4 days but i have as feeling that as compare
to other here activity is too slow and
I am not getting reponse for my question.

I have posted 3 Questions but got no reponse.well ia have just started
testCases with StrutsTestCase which has facility
to write TestCases with cactus but i am not able to test Struts Action with
cactus or with mockObject based approach

Well then i have tried to run Example with testCase but not successful..

So could you guide me where i can get proper feedback on testCases of Struts
with Catus Approach....


if Any body have Any suggestion then plz help me



So can Any body help me in this..


public class TestSampleAction extends MockStrutsTestCase {

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

    public void testSuccessfulLogin() {
       setRequestPathInfo("/login");
       addRequestParameter("username","deryl");
       addRequestParameter("password","radar");
       actionPerform();
    }
}


[main] INFO util.PropertyMessageResources  -
Initializing,config='org.apache.struts.util.LocalStrings', returnNull=true
[main] INFO util.PropertyMessageResources  -
Initializing,config='org.apache.struts.action.ActionResources',
returnNull=true

Time: 0.625
There was 1 failure:
1)testAction(logic.struts.actions.TestFirstAction)
junit.framework.AssertionFailedError: Error running action.perform():
classjava.lang.NullPointerException - null
	at
servletunit.struts.MockStrutsTestCase.actionPerform(MockStrutsTestCase.java:
339)
	at logic.struts.actions.TestFirstAction.testAction(TestFirstAction.java:47)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
	at
com.intellij.rt.execution.junit.TextTestRunner.main(TextTestRunner.java:12)
FAILURES!!!




Mime
View raw message