[Clirr-devel] CVS: clirr/core/src/test/net/sf/clirr/core MessageTest.java,1.1,1.2
Status: Alpha
Brought to you by:
lkuehne
From: Simon K. <s_k...@us...> - 2004-07-20 07:52:52
|
Update of /cvsroot/clirr/clirr/core/src/test/net/sf/clirr/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17838 Modified Files: MessageTest.java Log Message: Ensure checks are instantiated by instantiating a Checker instance. Without this, the Message objects are never created! Index: MessageTest.java =================================================================== RCS file: /cvsroot/clirr/clirr/core/src/test/net/sf/clirr/core/MessageTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MessageTest.java 11 Jul 2004 10:29:24 -0000 1.1 +++ MessageTest.java 20 Jul 2004 07:52:44 -0000 1.2 @@ -16,13 +16,15 @@ { /** * This test verifies that none of the check classes has used - * a message-id which is already in use elsewhere. It is assumed - * that the other unit tests will already have caused every available - * check class to be loaded into memory, therefore causing all the - * static Message objects to be created. + * a message-id which is already in use elsewhere. + * <p> + * It is assumed that instantiating the Checker class causes every + * check class to be loaded, which in turn causes every Message + * object (which are expected to be static members of checks) to be created. */ public void testUnique() { + Checker checker = CheckerFactory.createChecker(); MessageManager.getInstance().checkUnique(); } @@ -39,8 +41,12 @@ */ public void testComplete() { + Checker checker = CheckerFactory.createChecker(); java.util.Collection messages = MessageManager.getInstance().getMessages(); + // there are at least 10 messages in the system + assertTrue(messages.size() > 10); + // check the english locale MessageTranslator translator = new MessageTranslator(); translator.setLocale(Locale.ENGLISH); |