Export to GitHub

full-hibernate-plugin-for-struts2 - issue #23

JUnit test


Posted on Sep 15, 2010 by Swift Rabbit

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.

Attachments

Comment #1

Posted on Sep 16, 2010 by Grumpy Rabbit

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.

Status: Invalid

Labels:
Type-Defect Priority-Medium