jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Groschupf" ...@media-style.com>
Subject AW: About TestCases
Date Mon, 04 Aug 2003 11:26:06 GMT
Looks like your test failed since you have an nullpointer exception in your
struts action.
So your test runs but your code not.

May be it make sense to use container tests for your struts class?

Greetings
Stefan

-----Ursprüngliche Nachricht-----
Von: Sachin [mailto:csachin@pisoftek.com]
Gesendet: 04 August 2003 12:19
An: Kumar_maniranjan@infosys.com
Betreff: About TestCases

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!!!




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





Mime
View raw message