-->
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: populating mock objects for testing
PostPosted: Sat Mar 04, 2006 11:35 am 
Beginner
Beginner

Joined: Thu Feb 10, 2005 12:23 pm
Posts: 21
hi,
I have some big hibernate mappings. I do not want to write code for populating each java objects manually.
Which is preferred tool to autogenerate test java POJOs that can be tested for CRUD
Thx in Advance,
Hari


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 04, 2006 7:30 pm 
Beginner
Beginner

Joined: Fri Jul 30, 2004 2:53 pm
Posts: 33
Location: Washington, DC
What I do to test hibernate mappings is create a test database, with a certain set of test data, then write tests that start a transaction at the beginning of the test then rollback at the end. In the test, I can to get, find, save, delete, etc., assert the objects returned from the hibernate DAO methods are correct, and then any changes are rolled back. I acutally keep two database schemas, one for running the unit tests and another for running the whole webapp against, so that the test data never changes. If you use Spring, AbstractTransactionalDataSourceSpringContextTests handles all of the transaction rollback stuff for you.


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.