Methods Summary |
---|
public static void | main(java.lang.String[] args)
final TestRunner runner= new TestRunner();
final TestResult result = runner.doRun(BaseLifeCycleCommandTest.suite(), false);
System.exit(result.errorCount() + result.failureCount());
|
private void | nyi()
fail("Not Yet Implemented");
|
protected void | setUp()
//Properties systemProperties = new java.util.Propertis();
//systemProperties.put("com.sun.aas.configRoot",)
//String configProperty = SystemPropertyConstants.CONFIG_ROOT_PROPERTY;
//System.out.println(configProperty + " = " + System.getProperty(configProperty));
final CLIDescriptorsReader cliDescriptorsReader = CLIDescriptorsReader.getInstance();
ValidCommand validCommand = cliDescriptorsReader.getCommand(null);
LocalStringsManagerFactory.setCommandLocalStringsManagerProperties(
CLIDescriptorsReader.getInstance().getProperties());
testCommand = new CreateMBeanCommand();
testCommand.setName("sampleCommand");
|
public static junit.framework.Test | suite()
TestSuite suite = new TestSuite(BackupCommandsTest.class);
return suite;
|
protected void | tearDown()
|
public void | testgetParamsInfo()
testCommand.setOption(testCommand.TARGET_OPTION, "server");
testCommand.setOption(testCommand.NAME_OPTION, "name");
testCommand.setOption(testCommand.OBJECT_NAME_OPTION, "objName1");
Vector operands = new Vector();
operands.add("impl1");
testCommand.setOperands(operands);
testCommand.setOption("attributes", "attr1=value1:attr2=value2");
Object[] params = testCommand.getParamsInfo();
Map mbeanParams = (Map) params[1];
Map attributesList = (Map) params[2];
assertEquals(params[0], "server");
assertEquals(mbeanParams.get(ServerTags.IMPL_CLASS_NAME), "impl1");
assertEquals(mbeanParams.get(ServerTags.OBJECT_NAME), "objName1");
assertEquals(mbeanParams.get(ServerTags.NAME), "name");
assertEquals(attributesList.get("attr1"), "value1");
assertEquals(attributesList.get("attr2"), "value2");
|
public void | testgetParamsInfoWithInvalidAttrs()
//testCommand.setOption(testCommand.TARGET_OPTION, "server");
//testCommand.setOption(testCommand.NAME_OPTION, "name");
//testCommand.setOption(testCommand.OBJECT_NAME_OPTION, "objName1");
Vector operands = new Vector();
operands.add("impl1");
testCommand.setOperands(operands);
testCommand.setOption("attributes", "attr1=value1attr2=value2");
try{
Object[] params = testCommand.getParamsInfo();
}catch (CommandValidationException cve){
assertEquals(cve.getMessage(), "CLI178 Invalid attribute syntax.");
}
|