1 15 package org.apache.hivemind.impl; 16 17 import java.util.Locale ; 18 19 import org.apache.hivemind.internal.MessageFinder; 20 import org.apache.hivemind.test.HiveMindTestCase; 21 import org.apache.hivemind.util.ClasspathResource; 22 23 26 public class TestMessageFinder extends HiveMindTestCase 27 { 28 private MessageFinder newFinder() 29 { 30 ClasspathResource r = new ClasspathResource(getClassResolver(), 31 "org/apache/hivemind/impl/MessageFinder.xml"); 32 33 return new MessageFinderImpl(r); 34 } 35 36 public void testLocaleOverridesBase() 37 { 38 MessageFinder mf = newFinder(); 39 40 assertEquals("MessageFinder_fr.overriden-in-base", mf.getMessage( 41 "overridden-in-base", 42 Locale.FRENCH)); 43 44 48 assertEquals("MessageFinder_fr.overriden-in-base", mf.getMessage( 49 "overridden-in-base", 50 Locale.FRANCE)); 51 } 52 53 public void testLocaleDoeNotObscureBase() 54 { 55 MessageFinder mf = newFinder(); 56 57 assertEquals("MessageFinder.only-in-properties", mf.getMessage( 58 "only-in-base", 59 Locale.FRENCH)); 60 } 61 } | Popular Tags |