Methods Summary |
---|
void | initProperty(java.util.Properties prop, java.lang.String file)
prop.setProperty("base-package", PACKAGE);
prop.setProperty("property-file-name", file);
|
public static void | main(java.lang.String[] args)
final TestRunner runner= new TestRunner();
final TestResult result = runner.doRun(LocalStringsManagerFactoryTest.suite(), false);
System.exit(result.errorCount() + result.failureCount());
|
private void | nyi()
fail("Not Yet Implemented");
|
protected void | setUp()
p1 = new Properties();
p2 = new Properties();
initProperty(p1, P1_PROP);
initProperty(p2, P2_PROP);
|
public static junit.framework.Test | suite()
TestSuite suite = new TestSuite(LocalStringsManagerFactoryTest.class);
return suite;
|
protected void | tearDown()
|
public void | testConstructor()
final LocalStringsManagerFactory lsmf = new LocalStringsManagerFactory();
|
public void | testMultiplePropertyLookupOverride()
List hs = new ArrayList();
hs.add(p1);
hs.add(p2);
LocalStringsManagerFactory.setCommandLocalStringsManagerProperties(hs.iterator());
LocalStringsManager lsm = LocalStringsManagerFactory.getCommandLocalStringsManager();
assertEquals("expected a to be overridden and come from P1", "P1.a", lsm.getString("a"));
|
public void | testMultiplePropertyUniqueValuesMissing()
Set hs = new HashSet();
hs.add(p1);
hs.add(p2);
LocalStringsManagerFactory.setCommandLocalStringsManagerProperties(hs.iterator());
LocalStringsManager lsm = LocalStringsManagerFactory.getCommandLocalStringsManager();
assertEquals("expected b to be from P1", "P1.b", lsm.getString("b"));
assertEquals("expected c to be from P2", "P2.c", lsm.getString("c"));
|
public void | testP1Lookup()
Set hs = new HashSet();
hs.add(p1);
LocalStringsManagerFactory.setCommandLocalStringsManagerProperties(hs.iterator());
LocalStringsManager lsm = LocalStringsManagerFactory.getCommandLocalStringsManager();
assertEquals("P1.a", lsm.getString("a"));
assertEquals("P1.b", lsm.getString("b"));
|
public void | testP2Lookup()
Set hs = new HashSet();
hs.add(p2);
LocalStringsManagerFactory.setCommandLocalStringsManagerProperties(hs.iterator());
LocalStringsManager lsm = LocalStringsManagerFactory.getCommandLocalStringsManager();
assertEquals("P2.a", lsm.getString("a"));
assertEquals("P2.c", lsm.getString("c"));
|
public void | testSetInstance()
final LocalStringsManager lsm = new LocalStringsManager(PACKAGE, P1_PROP);
LocalStringsManagerFactory.setInstance(PACKAGE, lsm);
assertEquals(lsm, LocalStringsManagerFactory.getLocalStringsManager(PACKAGE, P1_PROP));
|