turbine-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Vandahl ...@apache.org>
Subject Re: Can I create a RunData object that works in my test cases?
Date Sat, 27 Dec 2008 16:59:56 GMT
Ludwig Magnusson wrote:
> Hi!
> I am developing a turbine application and I want to run automated test cases
> through JUnit. However, some methods that I want to test require a RunData
> object to store the user in. I can create a DefaultTurbineRunData object and
> pass it to the method but an exception is thrown since it doesn't contain a
> valid session object, and one of the methods calls
> data.removeUserFromSession()
> Is there any way to go around this error (and perhaps some similar errors I
> haven't come across yes) and create some kind of RunData object that would
> work in my test cases?
> /Ludwig

Normally, the TurbineRunDataService is responsible for correctly
initialized RunData objects. Because RunData is tight very closely to
HttpServletRequest and HttpServletResponse you will need to provide
these - initialized with meaningful data.

I heard people recommend Cactus for test purposes in web applications
but never used it myself. What we are trying to do is to split our
Turbine modules into HTTP-related and model-related stuff. The
model-related classes and methods can be tested easily with generic
JUnit stuff and the Turbine screens and actions consist of merely
"glue-code" which is straightforward.

Hope it helps.

Bye, Thomas.

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


Mime
View raw message