Re: why the code passes Servlet container test but fails in StrutsTestCase

2016-02-14 Thread Dave Newton
t; > > Hi, > > > > I was trying to use StrutsTestCase to write a test for a Bean, which has > a > > member of String[]. The code runs perfectly in servlet container(Tomcat), > > but fails as a mock test. In EditActionTest.java, assertNotNull("The > acti

Re: why the code passes Servlet container test but fails in StrutsTestCase

2016-02-13 Thread JOSE L MARTINEZ-AVIAL
The method execute has void as a return type, instead of a String. 2016-02-13 2:26 GMT-05:00 小唐 <644282...@qq.com>: > Hi, > > I was trying to use StrutsTestCase to write a test for a Bean, which has a > member of String[]. The code runs perfectly in servlet container(Tomcat)

why the code passes Servlet container test but fails in StrutsTestCase

2016-02-12 Thread ????
Hi, I was trying to use StrutsTestCase to write a test for a Bean, which has a member of String[]. The code runs perfectly in servlet container(Tomcat), but fails as a mock test. In EditActionTest.java, assertNotNull("The action is null but should not be.", action) still works

Re: StrutsTestCase issues with basic jsp via convention plugin

2014-02-25 Thread Lukasz Lenart
Can you publish the whole project at GitHub instead of the gist? 2014-02-23 18:35 GMT+01:00 John Patrick : > Hi, > > Having some issues around automated testing using struts2-junit-plugin > accessing a jsp via struts2-convention-plugin. > > Basically the following two url's; > http://struts.apache

StrutsTestCase issues with basic jsp via convention plugin

2014-02-23 Thread John Patrick
Hi, Having some issues around automated testing using struts2-junit-plugin accessing a jsp via struts2-convention-plugin. Basically the following two url's; http://struts.apache.org/release/2.3.x/docs/convention-plugin.html http://struts.apache.org/release/2.3.x/docs/struts-2-junit-plugin-tutoria

Re: Does the StrutsTestCase test filters defined in web.xml?

2012-05-15 Thread J. Garcia
:09 +0100, Steve Higham wrote: > > > Hi Miguel, > > > > I haven't used the StrutsSpringTestCase however I have made use of the > StrutsTestCase. > > > > This only tests the interceptor stack / Action / Result. There is no web > server involved and no attem

Re: Does the StrutsTestCase test filters defined in web.xml?

2012-05-14 Thread Łukasz Lenart
You can try to use Jetty as an embedded server, take a look on BasePortletTest in Portlet Plugin Regards -- Łukasz http://www.lenart.org.pl/ mobile +48 606 323 122, office +27 11 0838747 Warszawa JUG conference - Confitura http://confitura.pl/ ---

RE: Does the StrutsTestCase test filters defined in web.xml?

2012-05-14 Thread Miguel Almeida
Hi Steve, On Mon, 2012-05-14 at 11:09 +0100, Steve Higham wrote: > Hi Miguel, > > I haven't used the StrutsSpringTestCase however I have made use of the > StrutsTestCase. > > This only tests the interceptor stack / Action / Result. There is no web > server involve

RE: Does the StrutsTestCase test filters defined in web.xml?

2012-05-14 Thread Steve Higham
Hi Miguel, I haven't used the StrutsSpringTestCase however I have made use of the StrutsTestCase. This only tests the interceptor stack / Action / Result. There is no web server involved and no attempt to render the resulting page. Therefore I would be surprised if anything from web.x

Does the StrutsTestCase test filters defined in web.xml?

2012-05-14 Thread Miguel Almeida
Dear all, I am using StrutsSpringTestCase (which extends StrutsTestCase) to perform some acceptance tests (under the skin). I am also using Displaytag (www.displaytag.org/1.2/ ) to build some tables in the view. This tag supports excel/pdf export, which uses a filter you configure in web.xml [1

RE: StrutsTestCase, jUnit and file upload

2012-04-26 Thread Steve Higham
Thanks to Chris, Gabriel for your comments. I finally got this to work yesterday. A neat solution probably requires refactoring StrutsTestCase and deriving a new class (StrutsMultipartTestCase) from it. In the meantime the following changes will work subject to a couple of limitations: - This

Re: StrutsTestCase, jUnit and file upload

2012-04-25 Thread Chris Pratt
"Content-Disposition: form-data; name=\"id\"\r\n" + >"\r\n" + >"1\r\n" + >"--AaB03x--\r\n").getBytes("US-ASCII")); > > simulating the following form: > > enctype="multipart/form-data&quo

Re: StrutsTestCase, jUnit and file upload

2012-04-25 Thread Gabriel Belingueres
: respect the \r\n's and the final boundary with the extra "--" at the end of the form. commons upload version: 1.2.2. HTH, Gabriel 2012/4/25 Steve Higham : > I'm currently using StrutsTestCase and jUnit to component test my Actions > within the Struts context u

StrutsTestCase, jUnit and file upload

2012-04-25 Thread Steve Higham
I'm currently using StrutsTestCase and jUnit to component test my Actions within the Struts context using a Mockito mock as my Model. This is working fine. I can call request.setParamater ("paramName", "paramValue") from the test class and, when executed, Struts wi

Re: Testing with StrutsTestCase in a Tiles application - NullPointerException

2012-01-30 Thread Miguel Almeida
2-01-27 at 17:35 +, Miguel Almeida wrote: > Hi there, > > I trying to test an application with the help of StrutsTestCase (a class > that extends from StrutsSpringTestCase, to be more precise). > StrutsTestCase (which is in the struts junit plugin) involves proxied > acti

Testing with StrutsTestCase in a Tiles application - NullPointerException

2012-01-27 Thread Miguel Almeida
Hi there, I trying to test an application with the help of StrutsTestCase (a class that extends from StrutsSpringTestCase, to be more precise). StrutsTestCase (which is in the struts junit plugin) involves proxied actions to make tests more light. I have used the same method in another

Re: Problem with configured action method names and Testing Framework ===> StrutsTestCase cannot handle actions not calling execute()

2011-06-16 Thread UV
Hi, the setup is unit testing with maven + spring + struts using StrutsSpringTestCase super class (which is an extended org.apache.struts2.StrutsTestCase with access to spring config). So this is working well with actions not having the methodname configured. Whenever I do configure such a

Re: NPE in StrutsTestCase after enabling Tiles

2011-04-29 Thread Justin Robbins
Ah, ok. So the SourceForge one is not the one I'm using then. I'm extending org.apache.struts2.StrutsTestCase in the test I'm having problems with. Thanks for your input! On Fri, Apr 29, 2011 at 1:47 PM, Dave Newton wrote: > On Fri, Apr 29, 2011 at 1:35 PM, Justin Robbin

Re: NPE in StrutsTestCase after enabling Tiles

2011-04-29 Thread Dave Newton
On Fri, Apr 29, 2011 at 1:35 PM, Justin Robbins wrote: > Lastly, can anyone explain what the deal is with StrutsTestCase? > There's a tutorial page for using it with Struts 2 on > struts.apache.org but the SourceForge page > (http://strutstestcase.sourceforge.net/) for it ha

NPE in StrutsTestCase after enabling Tiles

2011-04-29 Thread Justin Robbins
Hi Folks, This is my first post to user@struts.apache.org.  I yesterday posed this same question on stackoverflow but haven't garnered any responses so I figured I'd give this list a try.  Hope that's cool. http://stackoverflow.com/questions/5823709/npe-in-strutstestcase-after

Re: StrutsTestCase and Spring 2.5

2009-06-11 Thread stanlick
Thanks bro! I think I hated annotations until today. Was the StrutsTestCase moved into a plug-in recently? On Thu, Jun 11, 2009 at 10:41 AM, Wes Wannemacher wrote: > Scott, it is just complaining because you are trying to do something > Spring-ish in your unit test, but Spring

Re: StrutsTestCase and Spring 2.5

2009-06-11 Thread Wes Wannemacher
Struts > interceptors.  I have added the struts2-junit-plugin-2.1.2.jar and also > spring-test.jar.  When I run my subclass test of StrutsTestCase I get the > following exception: > > SEVERE:   [20:44.438] ** FATAL ERROR STARTING UP STRUTS-SPRING > INTEGRATION ***

StrutsTestCase and Spring 2.5

2009-06-11 Thread stanlick
I am on a project with a new combination of jars and testing Struts interceptors. I have added the struts2-junit-plugin-2.1.2.jar and also spring-test.jar. When I run my subclass test of StrutsTestCase I get the following exception: SEVERE: [20:44.438] ** FATAL ERROR STARTING UP

RE: StrutsTestCase and Struts2

2009-02-14 Thread Enric Jaen
Thanks Dave, they are there. I failed to guess that all were using JWebUnit. /Enric - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org

Re: StrutsTestCase and Struts2

2009-02-14 Thread Dave Newton
Enric Jaen wrote: Hello, I'd to test the StrutsTestCase's version for Struts2 [1] but I have not found any example. There are plenty of examples for Struts1, however. Any idea how to use it? Have you looked at any of the existing tests for S2? Dave -

StrutsTestCase and Struts2

2009-02-13 Thread Enric Jaen
Hello, I'd to test the StrutsTestCase's version for Struts2 [1] but I have not found any example. There are plenty of examples for Struts1, however. Any idea how to use it? Regards, /Enric ps. I have found examples of testing Struts2 with JWebUnit, but what I want is to test the controller.

Struts2 StrutsTestCase

2007-07-17 Thread bartlebooth
n that it's not that simple at all. I put some work into using the StrutsTestCase class as base class for my tests, but I've run into some problems that I can't really understand. 1. There is hardly any documentation regarding the StrutsTestCase or the XWorkTestCase base classes. No

Struts/Spring/Tiles/StrutsTestCase

2006-07-12 Thread rukka
e" locale="true" /> or processorClass="org.apache.struts.tiles.TilesRequestProcessor" nocache="true" locale="true" /> what is the difference?? I got strutsTestcase almost working with spring wired actions. On that front I have one qu

Re: FW: StrutsTestCase & Hibernate

2006-05-06 Thread Adam Hardy
tier above. StrutsTestCase offers alot. I haven't used it but I believe it's easy enough to set up and run to mock the MVC part. Then something like Spring could instantiate stubbed business objects instead of real ones, so that the actions can run happily against a back end. For that

Re: FW: StrutsTestCase & Hibernate

2006-05-06 Thread Jakub Milkiewicz
Hi If you are thinking of unit tests for action i do not think it is great idea. For me actions should be as dumb as possible and just delegate business processing to another layer. 2006/5/5, Stasica, Grzegorz <[EMAIL PROTECTED]>: hi, Basically I'm interested in testing struts actions (forw

FW: StrutsTestCase & Hibernate

2006-05-05 Thread Stasica, Grzegorz
hi, Basically I'm interested in testing struts actions (forwards, messages etc). Most of the actions perform some actions on my database which I'd like to speed up. My idea is to isolate database tests from struts action test. There is only one way to achieve it which I see at the moment (mock ob

StrutsTestCase and Struts Validator PlugIn

2005-09-18 Thread Richard Yee
Does anyone know if StrutsTestCase works with the Struts Validator? ie. If I make a test case and set up the request parameters for a FormBean, will the FormBean be validated using the Validator Configuration in my struts-config.xml file. Thanks, Richard

RE: Cactus testing for StrutsTestCase

2005-05-28 Thread Hyrum
Brett, you were right, and I thought I had added the jar. I had mistyped it, however. Once I got the name right (cactus-ant-1.7.jar instead of cactus-ant.jar), it worked. Funny how computers only do what you said, not what you meant. Thanks for taking the time to reply. Much appreciated. Hyru

RE: Cactus testing for StrutsTestCase

2005-05-28 Thread Hyrum
Brett, you were right, and I thought I had added the jar. I had mistyped it, however. Once I got the name right (cactus-ant-1.7.jar instead of cactus-ant.jar), it worked. Funny how computers only do what you said, not what you meant. Thanks for taking the time to reply. Much appreciated. Hyru

Re: Cactus testing for StrutsTestCase

2005-05-28 Thread Brett Connor
Hyrum wrote: I am trying to use the Ant 'cactus' optional task in my build.xml. This fails because Eclipse must have the optional task set in the preferences, but I can't figure out how to do this. If I have understood your issue correctly, you need add the jar with the optional task to t

Cactus testing for StrutsTestCase

2005-05-28 Thread Hyrum
I'm trying to do some in-container testing of my Actions using CactusStrutsTestCase. I realize this may be a bit off topic, since it deals with Ant, the Eclipse IDE, JUnit, and Struts, but I'm hoping there is a Struts user who has experience something like this and can point me in the right direct

Cactus testing for StrutsTestCase

2005-05-28 Thread Hyrum
I'm trying to do some in-container testing of my Actions using CactusStrutsTestCase. I realize this may be a bit off topic, since it deals with Ant, the Eclipse IDE, JUnit, and Struts, but I'm hoping there is a Struts user who has experience something like this and can point me in the right direct

StrutsTestCase

2004-12-18 Thread Martin Wegner
Thanks to this list I just found the StrutsTestCase package. I think its a great tool. Testing my forms and actions OUTSIDE the container has increased my velocity 10 fold. But it seems that not many Struts people talk about this package (aside from page 510 of J.B.'s book). Is

Re: Using StrutsTestCase with 1.2, wildcards and MappingDispatchAction

2004-10-18 Thread Michael McGrady
Bill Siggelkow wrote: Laurent Duperval wrote: Hello, Does anyone have experience using (Mock)StrutsTestCase to test wildcard actions (actions that end in *) and MappingDispatchActions? Does it work? Are there any particular issues to be aware of? Thanks, L I haven't tested mapping dis

Re: Using StrutsTestCase with 1.2, wildcards and MappingDispatchAction

2004-10-18 Thread Bill Siggelkow
Laurent Duperval wrote: Hello, Does anyone have experience using (Mock)StrutsTestCase to test wildcard actions (actions that end in *) and MappingDispatchActions? Does it work? Are there any particular issues to be aware of? Thanks, L I haven't tested mapping dispatch action with StrutsTes

Using StrutsTestCase with 1.2, wildcards and MappingDispatchAction

2004-10-18 Thread Laurent Duperval
Hello, Does anyone have experience using (Mock)StrutsTestCase to test wildcard actions (actions that end in *) and MappingDispatchActions? Does it work? Are there any particular issues to be aware of? Thanks, L - To unsubscribe

Re: Help with Cactus StrutsTestCase

2004-08-27 Thread Leandro Melo
Thanks Duncan, i`ll check it out! --- Duncan Mills <[EMAIL PROTECTED]> escreveu: > Leandro - a good article has just been published on > the Oracle > Technology Network on using JUnit, Cactus and > StrutsTestCase - the setup > portions relate to setting up these up with

Re: Help with Cactus StrutsTestCase

2004-08-27 Thread Duncan Mills
Leandro - a good article has just been published on the Oracle Technology Network on using JUnit, Cactus and StrutsTestCase - the setup portions relate to setting up these up with JDeveloper, but the basic flow and tutorial portions provide a good kickstart even if you use another IDE - check

Re: Help with Cactus StrutsTestCase

2004-08-26 Thread Bill Siggelkow
[EMAIL PROTECTED] Subject: Re: Help with Cactus StrutsTestCase Is your LookupDispatchAction implementing getKeyMethodMap()? [EMAIL PROTECTED] wrote: I am trying to write test cases for my Struts app, but can't seem to figure it out. I have used the examples, but I don't seem to get the co

RE: Help with Cactus StrutsTestCase

2004-08-26 Thread Mick.Knutson
= ( String )keys.nextElement(); map.put( key, methods.getString( key ) ); } return map; } -Original Message- From: news [mailto:[EMAIL PROTECTED] Behalf Of Bill Siggelkow Sent: Thursday, August 26, 2004 10:53 AM To: [EMAIL PROTECTED] Subject: Re: Help with Cactus Stru

Re: Help with Cactus StrutsTestCase

2004-08-26 Thread Bill Siggelkow
Is your LookupDispatchAction implementing getKeyMethodMap()? [EMAIL PROTECTED] wrote: I am trying to write test cases for my Struts app, but can't seem to figure it out. I have used the examples, but I don't seem to get the correct outcome when I run them. I am using LookupDispatchAction's exclusiv

Re: Help with Cactus StrutsTestCase

2004-08-26 Thread Bill Siggelkow
Check out "Struts The Complete Reference" by James Holmes -- I hear the chapter on Testing absolutely ROCKS ;) Bill Siggelkow Leandro Melo wrote: Sorry for the confusing sentence. I meant to say that i don`t know the answer, but i`d like to use the opportunity and also ask a basic question. Whe

RE: Help with Cactus StrutsTestCase

2004-08-26 Thread Mick.Knutson
Users Mailing List Subject: Re: Help with Cactus StrutsTestCase Doesn`t know the answer, where can i find a good tutorial do test struts applications? Is it true that for good testing the actions must delegate their work to POJOs ?? --- [EMAIL PROTECTED] escreveu: > I am trying to write t

Re: Help with Cactus StrutsTestCase

2004-08-26 Thread Leandro Melo
Sorry for the confusing sentence. I meant to say that i don`t know the answer, but i`d like to use the opportunity and also ask a basic question. Where can i find a good tutorial do test struts applications? Is it true that for good testing the actions must delegate their work to POJOs ?? ---

Re: Help with Cactus StrutsTestCase

2004-08-26 Thread Leandro Melo
Doesn`t know the answer, where can i find a good tutorial do test struts applications? Is it true that for good testing the actions must delegate their work to POJOs ?? --- [EMAIL PROTECTED] escreveu: > I am trying to write test cases for my Struts app, > but can't seem to figure it out. > I h

Help with Cactus StrutsTestCase

2004-08-26 Thread Mick.Knutson
I am trying to write test cases for my Struts app, but can't seem to figure it out. I have used the examples, but I don't seem to get the correct outcome when I run them. I am using LookupDispatchAction's exclusively. So here is the method I am testing: == public void

StrutsTestCase servlet api 2.4

2004-06-18 Thread Warner Onstine
Is there a way to get strutstestcase (mock) to work with the new 2.4 web.xml. Currently when we try this it bombs on the digesting of the web.xml file with this: Digester.error(1439) | Parse Error at line 6 column 104: Document root element "web-app", must match DOCTYPE r