You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Mohan Patil <mo...@indrajitsystems.com> on 2008/12/18 20:27:41 UTC

Help to understand the turbine development process.

I am a newbi in turbine use.
I am experienced strut developer.Recently I have learned about Velocity.I am
using .vm in place of .jsp for the view.(forward in action mapping).
I have installed maven and helloworld application with the help of maven.

I am unable to add any ,java in the folders created by maven as I could not
figure out how to add my jars.

Any help on this is highly requested.

Initially I tried for a week to configure and start the Turbine servlet in
web.xml similar to struts action servlet. It never started that way.
Is turbine development is possible without maven. ( I like "ant")

Thanks in advance.

RE: Can I create a RunData object that works in my test cases?

Posted by Ludwig Magnusson <lu...@greenstreetconsulting.se>.
Thank you for the tip.
I found a MockSession-class on the internet and I made a MockRunData-class
that returns that object. That works for now. I also checked out cactus and
I might use it in the future if there is a need for it.
I trust that methods such as removeUserFromSession are well tested so there
is no need for me to create additional tests.
Thanks for the help
/Ludwig

-----Original Message-----
From: Manaster, Carl [mailto:CarlM@ACTIVX.com] 
Sent: den 5 januari 2009 17:40
To: Turbine Users List
Subject: RE: Can I create a RunData object that works in my test cases?

Hi, Ludwig,

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

For testing, I've written three very simple classes that implement
RunData, ParameterParser, and Context, with empty bodies for most of the
methods, implementing only the bits my tests need with simple HashMaps.
I've found it makes many tests much easier.

In your example, since my RunData's implementation has just an empty
body for removeUserFromSession(), no exception would be thrown.  If you
needed to test user removal, of course, you would have to add behavior
for that (and presumably for adding the user), but since (generally)
we're testing the behavior of the systems we build, and not of the
supplied components, a trivial implementation usually serves.

If I had a lot of such testing to do, I might create completely empty
implementations of the three interfaces, then subclass and implement the
specific bits needed by a given test or test suite.

Peace,
--Carl

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


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


Re: Can I create a RunData object that works in my test cases?

Posted by Thomas Vandahl <tv...@apache.org>.
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


RE: Can I create a RunData object that works in my test cases?

Posted by "Manaster, Carl" <Ca...@ACTIVX.com>.
Hi, Ludwig,

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

For testing, I've written three very simple classes that implement
RunData, ParameterParser, and Context, with empty bodies for most of the
methods, implementing only the bits my tests need with simple HashMaps.
I've found it makes many tests much easier.

In your example, since my RunData's implementation has just an empty
body for removeUserFromSession(), no exception would be thrown.  If you
needed to test user removal, of course, you would have to add behavior
for that (and presumably for adding the user), but since (generally)
we're testing the behavior of the systems we build, and not of the
supplied components, a trivial implementation usually serves.

If I had a lot of such testing to do, I might create completely empty
implementations of the three interfaces, then subclass and implement the
specific bits needed by a given test or test suite.

Peace,
--Carl

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


Can I create a RunData object that works in my test cases?

Posted by Ludwig Magnusson <lu...@greenstreetconsulting.se>.
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


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


Re: Help to understand the turbine development process.

Posted by Thomas Vandahl <tv...@apache.org>.
MPatil wrote:
> I need advice. I request you to help me.
> We are developing a web bank application to work in vpn (only designated
> users and places will have the access) . We have used struts 1.2, hybernate
> and jsp.we have 400-classes, 25- hbm.xml's and many jsps.
> We are looking at turbine as an alternative platform for  providing
> additional functionality. We wont use the jsp's for current development. 
> our other options are
> 2)Struts 1.3-Velocity
> 3)Struts 2.x-Velocity.
> Our team consists of 2-3 freshers and me.
> 
> Your help on this will be highly appreciated

What is your actual question?

Bye, Thomas.


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


Re: Help to understand the turbine development process.

Posted by MPatil <mo...@indrajitsystems.com>.

May we recommend http://henning.schmiedehausen.org/turbine/ as a source
of information and examples.

Bye, Thomas.

Thanks Thomas 
At last Turbine servlet became "Ready to Rumble".

I need advice. I request you to help me.
We are developing a web bank application to work in vpn (only designated
users and places will have the access) . We have used struts 1.2, hybernate
and jsp.we have 400-classes, 25- hbm.xml's and many jsps.
We are looking at turbine as an alternative platform for  providing
additional functionality. We wont use the jsp's for current development. 
our other options are
2)Struts 1.3-Velocity
3)Struts 2.x-Velocity.
Our team consists of 2-3 freshers and me.

Your help on this will be highly appreciated

Thanks

MPatil

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




-- 
View this message in context: http://www.nabble.com/Help-to-understand-the-turbine-development-process.-tp21079348p21151726.html
Sent from the Turbine - User mailing list archive at Nabble.com.


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


Re: Help to understand the turbine development process.

Posted by Thomas Vandahl <tv...@apache.org>.
Mohan Patil wrote:
> I am a newbi in turbine use.
> I am experienced strut developer.Recently I have learned about Velocity.I am
> using .vm in place of .jsp for the view.(forward in action mapping).
> I have installed maven and helloworld application with the help of maven.
> 
> I am unable to add any ,java in the folders created by maven as I could not
> figure out how to add my jars.

May we recommend http://henning.schmiedehausen.org/turbine/ as a source
of information and examples.

Bye, Thomas.


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