[Clirr-devel] CVS: clirr/core/src/test/net/sf/clirr/core CheckerFactory.java,NONE,1.1 MessageTest.ja
Status: Alpha
Brought to you by:
lkuehne
From: <lk...@us...> - 2004-07-11 10:29:33
|
Update of /cvsroot/clirr/clirr/core/src/test/net/sf/clirr/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15487/test/net/sf/clirr/core Added Files: CheckerFactory.java MessageTest.java Log Message: Whoops - forgot to add tests after moving sources to core subproject --- NEW FILE --- package net.sf.clirr.core; import net.sf.clirr.core.internal.ClassChangeCheck; import net.sf.clirr.core.Checker; /** * Provides a way for check tests to create a checker via the package private * Checker constructor, even if the tests are not in the same package. */ public class CheckerFactory { public static Checker createChecker(ClassChangeCheck check) { return new Checker(check); } } --- NEW FILE --- package net.sf.clirr.core; import java.util.Locale; import junit.framework.TestCase; import net.sf.clirr.core.MessageManager; import net.sf.clirr.core.MessageTranslator; /** * Tests for the Message and MessageManager classes. * <p> * It is assumed here that the other unit tests have forced every Check * class to be loaded into memory, hence all the static Message objects * have been created and registered with the MessageManager. */ public class MessageTest extends TestCase { /** * 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. */ public void testUnique() { MessageManager.getInstance().checkUnique(); } /** * This test verifies that the default resource bundle contains an * entry for every known message. * <p> * Unfortunately, it is not possible to check whether, for example, * the "de" locale has a complete set of translations. This is because * the ResourceBundle implementation simply returns a string from an * inherited "parent" resource bundle if the key is not found in a * locale-specific bundle, and there is no way of telling which * bundle the message was retrieved from. */ public void testComplete() { java.util.Collection messages = MessageManager.getInstance().getMessages(); // check the english locale MessageTranslator translator = new MessageTranslator(); translator.setLocale(Locale.ENGLISH); translator.checkComplete(messages); } } |