Clover coverage report - clover
Coverage timestamp: Sat Oct 8 2005 22:54:17 EDT
file stats: LOC: 44   Methods: 4
NCLOC: 33   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
StringsTest.java - 93.3% 75% 89.5%
coverage coverage
 1   
 package abbot.i18n;
 2   
 
 3   
 import java.util.Locale;
 4   
 
 5   
 import junit.extensions.abbot.TestHelper;
 6   
 
 7   
 /** Test Resource loading. */
 8   
 public class StringsTest extends junit.framework.TestCase {
 9   
 
 10  1
     public void testMissingResource() throws Throwable {
 11  1
         Locale oldLocale = Locale.getDefault();
 12  1
         try {
 13  1
             Locale.setDefault(Locale.FRENCH);
 14  1
             String key = "NoSuchResource";
 15  1
             String value = Strings.get(key);
 16  1
             assertEquals("Missing resource will be a flagged key",
 17   
                          "#" + key + "#", value);
 18   
             
 19  1
             key = "abbot.DefaultPropertiesLoaded";
 20  1
             value = Strings.get(key);
 21  1
             assertEquals("Missing i18n resource should get default value",
 22   
                          "yes", value);
 23   
         }
 24   
         finally {
 25  1
             Locale.setDefault(oldLocale);
 26   
         }
 27   
     }
 28   
 
 29  1
     public void testOptionalResource() throws Throwable {
 30   
         // Accelerator; may or may not be present
 31  1
         String key = "Menu.acc";
 32  1
         String value = Strings.get(key, true);
 33  1
         assertNull("Non-existent, optional value should be null", value);
 34   
     }
 35   
 
 36  2
     public StringsTest(String name) {
 37  2
         super(name);
 38   
     }
 39   
 
 40  0
     public static void main(String[] args) {
 41  0
         TestHelper.runTests(args, StringsTest.class);
 42   
     }
 43   
 }
 44