Re: Unit Testing Struts 2 Action

2009-01-17 Thread Dave Newton
Doug Pham wrote: > [...] information on how to unit test my new application actions? When you hit "reply" and change the subject this is what happens in threaded view: http://tinypic.com/view.php?pic=n5mog5&s=5 Please consider starting new threads. Dave

Re: Unit Testing Struts 2 Action

2009-01-17 Thread Robert Harrison
Here's the first step of a nice, three-part tutorial (I have no connection to author) Bob "Sure you can trust the government. Just ask any Indian" - anonymous On Sat, Jan 17, 2009 at 6:21 AM, Nils-Helge Garli Hegvik wrote: > One

Re: Unit Testing Struts 2 Action

2009-01-17 Thread Nils-Helge Garli Hegvik
One of the things I really like about Struts 2 is how easy it is to unit test actions. Using the proper mechanisms for injecting what you need, unit testing the action should be as simple as instantiating the action, set the appropriate dependencies, and then execute it. Nils-H On Sat, Jan 17, 20

RE: Unit testing Struts 2 systems in multiple projects

2008-09-18 Thread Peter Butler
>> The war project contains all web resources, jsps, etc. >> The core project contains all of our struts actions, >> service layer and data access layer. > IMO that's broken--the S2 actions should be part of the web > project because... that's what S2 is--the web layer. That > solves your proble

Re: Unit testing Struts 2 systems in multiple projects

2008-09-18 Thread Dave Newton
--- On Thu, 9/18/08, Peter Butler wrote: > The war project contains all web resources, jsps, etc. > The core project contains all of our struts actions, > service layer and data access layer. IMO that's broken--the S2 actions should be part of the web project because... that's what S2 is--the w

Re: Unit Testing Struts 2

2008-09-12 Thread Greg Lindholm
Here is a blog writeup of what I'm using. It allows you to test interceptors. http://glindholm.wordpress.com/2008/06/30/unit-testing-struts-2-actions/ Mark-413 wrote: > > Hi all: > > Does anyone have a working example of unit testing a Struts 2 app? > I've been looking around for awhile kn

Re: Unit Testing Struts 2

2008-09-10 Thread Nils-Helge Garli Hegvik
Not in particular. Basically, they all more or less do the same (although sometime with different approaches to mocking): Set up the action context, create a mock invocation and invoke intercept on the interceptor with the mock invocation. I think this is the smallest and simplest interceptor test

Re: Unit Testing Struts 2

2008-09-10 Thread Mark
I had a look at a few in the 2.0.11.1 source tree. I couldn't understand how they were structured. I haven't looked at the 2.1.3 source tree. Is there a particular one you would suggest? Mark On 11/09/2008, at 3:40 PM, Nils-Helge Garli Hegvik wrote: Have you looked at the tests in the s

Re: Unit Testing Struts 2

2008-09-10 Thread Nils-Helge Garli Hegvik
Have you looked at the tests in the source repository? Nils-H On Thu, Sep 11, 2008 at 7:31 AM, Mark <[EMAIL PROTECTED]> wrote: > Hi all: > > Does anyone have a working example of unit testing a Struts 2 app? I've > been looking around for awhile know and found the following resources. > However