Hi Pierre,

basically, that's why singletons are discouraged nowadays, unless you're really sure you don't need to change them. I suggest you create a factory interface instead on implement a mock version for your testing.

Best regards,

Geert

On 16-mrt-06, at 08:37, Raoul Pierre wrote:

Hello,

Is there any easy way to reinitialize a singleton during unit test, for exemple:

public class I18nSingleton
{
static final I18n INSTANCE = I18n.getInstance(); static final LocaleProviderFactory DEFAULT_LOCALE_PROVIDER_FACTORY = INSTANCE.getDefaultLocaleProviderFactory(); static final TranslatorFactory DEFAULT_TRANSLATOR_FACTORY = INSTANCE.getDefaultTranslatorFactory();
}

The goal is to test different implementation of I18n, LocaleProviderFactory & TranslatorFactory .

Regards

Pierre


_______________________________________________
Rife-users mailing list
[email protected]
http://lists.uwyn.com/mailman/listinfo/rife-users


--
Geert Bevin             Uwyn bvba               GTalk: [EMAIL PROTECTED]
"Use what you need"     Avenue de Scailmont 34  Skype: gbevin
http://www.uwyn.com     7170 Manage, Belgium      AIM: geertbevin
gbevin at uwyn dot com  Tel: +32 64 84 80 03   Mobile: +32 477 302 599

PGP Fingerprint : 4E21 6399 CD9E A384 6619  719A C8F4 D40D 309F D6A9
Public PGP key  : available at servers pgp.mit.edu, wwwkeys.pgp.net


_______________________________________________
Rife-users mailing list
[email protected]
http://lists.uwyn.com/mailman/listinfo/rife-users

Reply via email to