You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Joe Yuen <jo...@chisq.com> on 2007/06/22 17:56:58 UTC

RE: Advice on unit testing struts action classes

 
Can anyone give me any advice on a good tool to use for unit testing struts action classes. I am currently using struts 1.2.9 with spring 1.2.9 and hibernate. I have looked into StrutsTestCase but cannot get it to work. I get the following error:
 
test:
    [junit] Testsuite: com.chisq.common.action.PersonActionTest
    [junit] Tests run: 1, Failures: 1, Errors: 0, Time elapsed: 1.266 sec
    [junit] ------------- Standard Output ---------------
    [junit] 08:47:40,547 DEBUG PersonActionTest:48 - .......running testSavePerson()
    [junit] 08:47:40,922 ERROR RequestProcessor:676 - Invalid path was requested /Person
    [junit] ------------- ---------------- ---------------
    [junit] Testcase: testSavePerson(com.chisq.common.action.PersonActionTest): FAILED
    [junit] received error 404 : Invalid path was requested
    [junit] junit.framework.AssertionFailedError: received error 404 : Invalid path was requested
    [junit]     at servletunit.HttpServletResponseSimulator.sendError(HttpServletResponseSimulator.java:463)
    [junit]     at org.apache.struts.action.RequestProcessor.processMapping(RequestProcessor.java:677)
    [junit]     at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:191)
    [junit]     at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
    [junit]     at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
    [junit]     at servletunit.struts.MockStrutsTestCase.actionPerform(MockStrutsTestCase.java:394)
    [junit]     at com.chisq.common.action.PersonActionTest.testSavePerson(PersonActionTest.java:51)

 
I have checked in my strut-config.xml file and /Person is defined as well in my action-servlet.xml file as well.
 
 
 
 


RE: Advice on unit testing struts action classes

Posted by Joe Yuen <jo...@chisq.com>.
I understand now. I apologize. I'll post a new message. Thanks for pointing this out.

________________________________

From: Christopher Schultz [mailto:chris@christopherschultz.net]
Sent: Fri 6/22/2007 9:25 AM
To: Struts Users Mailing List
Subject: Re: Advice on unit testing struts action classes



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Joe,

Joe Yuen wrote:
> Huh??? What are you talking about? What topic  being hijacked??? I am
> asking a question. Do you mean that this subject line has already
> been used in another thread???

You replied to a message in the "AutoCompleter doesn't work good in IE7"
thread and changed the subject. This is called topic or thread
hijacking. Set your mail reader to view messages as "threaded", and
you'll see that your message gets threaded along with that original topic.

The proper way to post a new question is to create a new message, not
reply to one already on the list. You are unlikely to get any responses
to your question unless you start a new topic.

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGe/gW9CaO5/Lv0PARAj7XAJ9hKRbCF0ZzfEGwelCFdsYpybwPpQCfRyrS
pim9dpstyDPK2dPjA7V8o9g=
=k/1t
-----END PGP SIGNATURE-----

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





Re: Advice on unit testing struts action classes

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Joe,

Joe Yuen wrote:
> Huh??? What are you talking about? What topic  being hijacked??? I am
> asking a question. Do you mean that this subject line has already
> been used in another thread???

You replied to a message in the "AutoCompleter doesn't work good in IE7"
thread and changed the subject. This is called topic or thread
hijacking. Set your mail reader to view messages as "threaded", and
you'll see that your message gets threaded along with that original topic.

The proper way to post a new question is to create a new message, not
reply to one already on the list. You are unlikely to get any responses
to your question unless you start a new topic.

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGe/gW9CaO5/Lv0PARAj7XAJ9hKRbCF0ZzfEGwelCFdsYpybwPpQCfRyrS
pim9dpstyDPK2dPjA7V8o9g=
=k/1t
-----END PGP SIGNATURE-----

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


RE: Advice on unit testing struts action classes

Posted by Joe Yuen <jo...@chisq.com>.
Huh??? What are you talking about? What topic  being hijacked??? I am asking a question. Do you mean that this subject line has already been used in another thread???

________________________________

From: Christopher Schultz [mailto:chris@christopherschultz.net]
Sent: Fri 6/22/2007 9:12 AM
To: Struts Users Mailing List
Subject: Re: Advice on unit testing struts action classes



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Joe,

Do not hijack topics. Please post a new message to
user@struts.apache.org to ask a question.

- -chris

Joe Yuen wrote:
> 
> Can anyone give me any advice on a good tool to use for unit testing struts action classes. I am currently using struts 1.2.9 with spring 1.2.9 and hibernate. I have looked into StrutsTestCase but cannot get it to work. I get the following error:
> 
> test:
>     [junit] Testsuite: com.chisq.common.action.PersonActionTest
>     [junit] Tests run: 1, Failures: 1, Errors: 0, Time elapsed: 1.266 sec
>     [junit] ------------- Standard Output ---------------
>     [junit] 08:47:40,547 DEBUG PersonActionTest:48 - .......running testSavePerson()
>     [junit] 08:47:40,922 ERROR RequestProcessor:676 - Invalid path was requested /Person
>     [junit] ------------- ---------------- ---------------
>     [junit] Testcase: testSavePerson(com.chisq.common.action.PersonActionTest): FAILED
>     [junit] received error 404 : Invalid path was requested
>     [junit] junit.framework.AssertionFailedError: received error 404 : Invalid path was requested
>     [junit]     at servletunit.HttpServletResponseSimulator.sendError(HttpServletResponseSimulator.java:463)
>     [junit]     at org.apache.struts.action.RequestProcessor.processMapping(RequestProcessor.java:677)
>     [junit]     at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:191)
>     [junit]     at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
>     [junit]     at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
>     [junit]     at servletunit.struts.MockStrutsTestCase.actionPerform(MockStrutsTestCase.java:394)
>     [junit]     at com.chisq.common.action.PersonActionTest.testSavePerson(PersonActionTest.java:51)
>
> 
> I have checked in my strut-config.xml file and /Person is defined as well in my action-servlet.xml file as well.
> 
> 
> 
> 
>
>
>
> ------------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGe/Te9CaO5/Lv0PARAuOyAKCwa+Z64EJlwKAowQdP6rOkVOvzYwCgoydL
ERn+JEt9VRXUhce3cEoOZwQ=
=WuFW
-----END PGP SIGNATURE-----

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





Re: Advice on unit testing struts action classes

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Joe,

Do not hijack topics. Please post a new message to
user@struts.apache.org to ask a question.

- -chris

Joe Yuen wrote:
>  
> Can anyone give me any advice on a good tool to use for unit testing struts action classes. I am currently using struts 1.2.9 with spring 1.2.9 and hibernate. I have looked into StrutsTestCase but cannot get it to work. I get the following error:
>  
> test:
>     [junit] Testsuite: com.chisq.common.action.PersonActionTest
>     [junit] Tests run: 1, Failures: 1, Errors: 0, Time elapsed: 1.266 sec
>     [junit] ------------- Standard Output ---------------
>     [junit] 08:47:40,547 DEBUG PersonActionTest:48 - .......running testSavePerson()
>     [junit] 08:47:40,922 ERROR RequestProcessor:676 - Invalid path was requested /Person
>     [junit] ------------- ---------------- ---------------
>     [junit] Testcase: testSavePerson(com.chisq.common.action.PersonActionTest): FAILED
>     [junit] received error 404 : Invalid path was requested
>     [junit] junit.framework.AssertionFailedError: received error 404 : Invalid path was requested
>     [junit]     at servletunit.HttpServletResponseSimulator.sendError(HttpServletResponseSimulator.java:463)
>     [junit]     at org.apache.struts.action.RequestProcessor.processMapping(RequestProcessor.java:677)
>     [junit]     at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:191)
>     [junit]     at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
>     [junit]     at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
>     [junit]     at servletunit.struts.MockStrutsTestCase.actionPerform(MockStrutsTestCase.java:394)
>     [junit]     at com.chisq.common.action.PersonActionTest.testSavePerson(PersonActionTest.java:51)
> 
>  
> I have checked in my strut-config.xml file and /Person is defined as well in my action-servlet.xml file as well.
>  
>  
>  
>  
> 
> 
> 
> ------------------------------------------------------------------------
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGe/Te9CaO5/Lv0PARAuOyAKCwa+Z64EJlwKAowQdP6rOkVOvzYwCgoydL
ERn+JEt9VRXUhce3cEoOZwQ=
=WuFW
-----END PGP SIGNATURE-----

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