warlockza / full-hibernate-plugin-for-struts2

Automatically exported from code.google.com/p/full-hibernate-plugin-for-struts2
0 stars 0 forks source link

JUnit test #23

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I was attempting to write a JUnit test for my DAO classes without having to run 
tru struts 2.  The ones I attempted to write failed because the session object 
is NULL.   Is it possible to write a Junit text with the plug-in? I havent seen 
any examples for Junit test cases. 
Please provide me with some guidance,
Thanks in advance.

Ronaldo. 

Original issue reported on code.google.com by rmjoh...@gmail.com on 15 Sep 2010 at 1:12

Attachments:

GoogleCodeExporter commented 8 years ago
This plugin uses Struts2 Interceptors for Session injection. So you cannot use 
pure JUnit test cases. Use Struts2 Junit Plugin.

Although, you can change your "setUp" method. Inject, by reflection or by 
"setter", the session object in your DAO object.

Original comment by jyoshiriro on 16 Sep 2010 at 4:55