-->
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.  [ 5 posts ] 
Author Message
 Post subject: MSAccessDialect for Test Data
PostPosted: Mon Sep 26, 2005 11:56 am 
Newbie

Joined: Fri Jul 22, 2005 9:14 pm
Posts: 10
I am sure everyone knows the maintaining of test data is not a simple task because of all the issues surrounding test data. Over the years I have found the same issues consistently arise...
  • What format should the test data be stored in?
  • How to manage the transactional resetting of the test data between tests?

Well with a combination of a set of tools I have come up with what I feel is a solution solves these issues in a simple and "pretty slick" way.

I use DBUnit to manage the transactional resetting of the data between tests. DBUnit provides several formats to store the test data in which is great, however none of them are maintainable in the sense that if a record has to change you have to search through what could be a 5000 line text file for the record. You also have to maintain all FK relationships and constaints in this text file. Which often times results in having to running the tests to see if the test data is correct. To get around these issues I decided why not use what is a readily available tool to maintain FK relationships and constraints and that is MS Access.

What I do is change my dialect to the SQLServer dialect and regenerate a schema then I create a MS Access database with this sql and all of my look up values. Once I have my database I begin to enter in the test data and the value comes when Access tells I am violating a constraint or FK relationship. Then through JDBC I query the MS Access database and generate the DBUnit dataset.xml. If I ever need to change the data I simply modify my Access database and regenerate. So to my point...

One problem is SQLServer and MSAccess are not 100% compatible in terms of the sql they except (e.g. tinyint => yesno). So I ask has there ever been any discussion as to implementing a MSAccessDialect for purposes such as this?

If you would like more information as to my solution please feel free to ask.

Thanks
Tim


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 26, 2005 12:34 pm 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
MS Access is windows only database - better is hsqldb - it is pure java in memory database and hibernate developer use it for tests - you need jdbc driver (jar) only

i suppose that you welcome to add new Dialect


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 26, 2005 1:16 pm 
Newbie

Joined: Fri Jul 22, 2005 9:14 pm
Posts: 10
I am not familar with HSQLDB. Does a gui exist for executing sql statements to generate additional test data? For instance more often than not mapping tables can be populated through join statements rather than by hand. Also how does one share a in memory db with other members of his team... can it be checked into CVS or some other source control mechanism.

Also if you could provide some details in terms how to go about creating a new dialect, I have no objections to submitting the code.
  • What questions do I need to answer to ensure I have correctly implemented the dialect?
  • Where do I submit the code to get it rolled into Hibernate?


Thanks
Tim


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 26, 2005 2:31 pm 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
There is GUI, but it is base only
MS access isn't relational database and hibernate is ORM - mapping tool to relational databases
Hsqldb is perfect for testing - your team have to create test data for every test (this is request for good test)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 26, 2005 3:04 pm 
Newbie

Joined: Fri Jul 22, 2005 9:14 pm
Posts: 10
Last I check MS Access is a relational database and I think you misunderstood me in terms of how I am using it. I never connect to MS Access with Hibernate, but one could seeing how it has a jdbc driver, I simply use it to maintain my test data.

Anyways I am still looking for answers to my two dialect questions above if anyone could help it would be greatly appreciated.

Thanks
Tim


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.