mardi 5 avril 2016

Use another dabase for test

I have a program who use oracle. I would like to do some test about the query who are done. Db test is HSQLDB.

public class UserDAODataAccess {
    private Connection connection;

    private void getConnection() throws MMException {
        connection = AutoExternalServices.getDatabase().newConnection();
    }


    List<User> getUser(){
        getConnection();
        ...
    }
}   

In test is it possible to bypass the current getConnection and obtain a connection for another db?

Aucun commentaire:

Enregistrer un commentaire