For my integration tests I have build common validation class which has methods like
public void countcheck(table1, table 2){ // makes a JDBC connection and run the query to check counts and then closes the connection };
public void nullcheck(Table, ColumnName) {// makes a JDBC connection and the run query to make sure there are no Nulls and then closes the connection );
and so on. I distribute these common validation methods as Jars for integration testers. My dilemma is whether I should open and close connection for each method , I don't want testers to worry about opening and closing connections and just worry about calling validation methods. I am looking for alternative design or this is something good enough. My worry is if there in a test suite there are 10 tests then there would be 10 connections going and closing which perhaps is not a good sign? I want testers to worry about makig and closing connections. Its a Junit based test framework and DB is Oracle.