Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7544651
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:43:37+00:00 2026-05-30T08:43:37+00:00

We are working on a project where database requirement is not clear. So we

  • 0

We are working on a project where database requirement is not clear. So we are building a database agnostic application.

See my previous question here: Database Agnostic Application

Now I want to test my Spring application DAO with multiple database. I’ve written number of test cases using TestNG and DBUnit.

When I run these test in a CI environment, I want them to test the application against all the configured databases. I’ve installed the databases on the ‘test server’.

e.g. I want something like this:

for ( each database configured ) {
 run each dao test
}

Not sure what is the best way of doing this? And help is welcome.

Thanks,
Adi

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T08:43:38+00:00Added an answer on May 30, 2026 at 8:43 am
    1. If you want to be database independent, you have to test against every single database system you want to support. There are very fine differences which leak through Hibernate.

    2. What I did in the past was to make the test retrieve their database configuration through some System Property. Typically by using hibernate_.property instead of the default hibernate.property. Then setup CI Jobs, which set the property to different values and provide one hibernate_xxx.property for every database to test against. I did this using JUnit Rules, to have the logic in one place. Don’t know the apropriate tool for TestNG

    3. I’m not to fond of the loop construct you are hinting at, because it might make it difficult to run a test suit against a single specific database.

    4. I’m also not to fond of dbunit, because it seems to make maintaining testdata rather painful. I prefer in most cases a handcrafted DSL. Have a look at some articles I wrote about it:

    http://blog.schauderhaft.de/2011/03/13/testing-databases-with-junit-and-hibernate-part-1-one-to-rule-them/

    http://blog.schauderhaft.de/2011/03/20/testing-databases-with-junit-and-hibernate-part-2-the-mother-of-all-things/

    http://blog.schauderhaft.de/2011/03/27/testing-databases-with-junit-and-hibernate-part-3-cleaning-up-and-further-ideas/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a project with a rather large Oracle database (although my question
My team working in a project using Winforms application(c#) & MSSQL 2005 as database.
I am working in a project where database items are not deleted, but only
Question: Why can't I open the database? Info: I'm working on a project using
I'm working on a database project and I need to create Outlook 2007 plugin
I am working on a (database-ish) project, where data is stored in a flat
I am working on a project that needs to use a database driven MVC
I'm working on a project that is considering using Cassandra as a database. We
I'm working on a project in which we have a database, data layer (entity
I'm working on a project that uses several languages: SQL for querying a database

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.