JUnit - Pb design Test

From: Franck DARRAS (franck_darras_at__no_spam_yahoo.fr_)
Date: 01/28/05


Date: Fri, 28 Jan 2005 16:40:31 +0100

Hello,

I begin with JUnit and I try to developp a automated test for an
application J2EE

I want to test the Hibernate component in my application, but the
implementation of Hibernate Connection is different when you deploy to
JBoss or when you test a simple java application.

I have a Hibernate Connection Class with a final static variable to
modify when i test my application or when i deploy my application.

Hibernate Connection.java

private final static boolean MODE_TEST = false;

public static InterfacePersistentHibernate getInstance() {
        if (MODE_TEST) {
                return PersistentHibernateTest.getInstance();
        } else {
                return new PersistentHibernate();
        }
}

It's not a big problem when a developper want to test own application,
but if i want to automated test i can change this variable.

I hope you understand my problem. I you want more informations, please
send me an e-mail

Do you have some ideas to help me in my problem.

Thks for your help

Franck