Methods Summary |
---|
private static final java.lang.String | getCommandPackageName()
return "com.sun.enterprise.cli";
|
public static void | main(java.lang.String[] args)
if (args.length == 0){
junit.textui.TestRunner.run(GlobalsManagerTest.class);
} else {
junit.textui.TestRunner.run(makeSuite(args));
}
|
private static junit.framework.TestSuite | makeSuite(java.lang.String[] args)
final TestSuite ts = new TestSuite();
for (int i = 0; i < args.length; i++){
ts.addTest(new GlobalsManagerTest(args[i]));
}
return ts;
|
private void | nyi()
fail("Not Yet Implemented");
|
protected void | setUp()
|
protected void | tearDown()
|
public void | testCommandStringLocalization()
final ICommandEnvironment env = new Env();
final GlobalsManager gm = new GlobalsManager(env);
GlobalsManager.setInstance(gm);
GlobalsManager.setBasePackage(getCommandPackageName());
GlobalsManager.setPropertyFile("CommandPropertyFile");
assertEquals("command property", GlobalsManager.getString("a"));
assertEquals("command property", GlobalsManager.getString("a", (Object []) null));
GlobalsManager.setBasePackage((String) null);
|
public void | testCommandStringLocalizationNoBundle()
final ICommandEnvironment env = new Env();
final GlobalsManager gm = new GlobalsManager(env);
GlobalsManager.setInstance(gm);
try {
assertEquals("", GlobalsManager.getString("a"));
fail("Expected error indicating no base package could be found");
}
catch (CommandException ce){
// assertEquals("Can't find bundle for base name null.CommandPropertyFile, locale en_US", ce.getMessage());
assertEquals("Can't find bundle for base name null.CommandPropertyFile, locale "+Locale.getDefault(), ce.getMessage());
assertNull(ce.getCause());
}
|
public void | testEnvironment()
final ICommandEnvironment env = new Env();
final GlobalsManager gm = new GlobalsManager(env);
final ICommandEnvironment env2 = new Env();
gm.setGlobalsEnv(env2);
assertEquals(env2, gm.getGlobalsEnv());
|
public void | testFrameworkStringLocalization()
final ICommandEnvironment env = new Env();
final GlobalsManager gm = new GlobalsManager(env);
GlobalsManager.setInstance(gm);
assertEquals("framework property", GlobalsManager.getFrameworkString("a", (Object []) null));
assertEquals("framework property", GlobalsManager.getFrameworkString("a"));
|
public void | testGetSetRemove()
final ICommandEnvironment env = new Env();
final GlobalsManager gm = new GlobalsManager(env);
gm.setOption("key", "value");
assertEquals("value", gm.getOption("key"));
gm.removeOption("key");
assertNull(gm.getOption("key"));
|
public void | testSimpleConstructionAndObservers()
final ICommandEnvironment env = new Env();
final GlobalsManager gm = new GlobalsManager(env);
assertEquals(env, gm.getGlobalsEnv());
|
public void | testSingletonMethods()
final ICommandEnvironment env = new Env();
final GlobalsManager gm = new GlobalsManager(env);
GlobalsManager.setInstance(gm);
assertEquals(gm, GlobalsManager.getInstance());
|