-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: JUnit testing strategy
PostPosted: Fri Jan 30, 2004 3:50 pm 
Newbie

Joined: Tue Nov 11, 2003 6:24 pm
Posts: 17
I've been having trouble developing a testing scheme in our architecture with Hibernate.

We're using Hibernate inside of an EAR and loading the SessionFactory into JNDI at startup of the container. This works perfectly for our Struts web application. We use POJO's to map out our business logic and call them from Struts actions.

However, our problem lies in trying to use JUnit to test our POJO's outside of the EAR container. Since all of the POJO's rely on using JNDI to retrieve Hibernate from JNDI, Hibernate does not remote outside the container to the JUnit classes. WebLogic throws an exception with the POJO's try and access JNDI outside of the EAR container.

I'm interested to know what others do in this situation. I'm sure there are plenty of alternatives. Thoughts?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 30, 2004 4:59 pm 
Regular
Regular

Joined: Fri Sep 05, 2003 12:01 am
Posts: 80
Location: Bogot
you should really have a look at the spring framework.

Spring provides different contexts (web, filesystem, etc...).

What we do with Junit is use the spring filesystem context. In struts actions we call the spring provided webcontext. Such contexts are made both by the same spring configuration file, thus you are testing the same POJOs and DAOs in different environments.


http://www.springframework.org

Hope it helps.

_________________
Mauricio Hern


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.