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 CreateServiceCommand();
testCommand.setName("sampleCommand");
|
public static junit.framework.Test | suite()
TestSuite suite = new TestSuite(BackupCommandsTest.class);
return suite;
|
protected void | tearDown()
|
public void | testValidateOptionsWithInvalidPasswordFile()
try{
Vector operands = new Vector();
operands.add("typeDir");
testCommand.setOperands(operands);
testCommand.setOption(testCommand.PASSWORDFILE, "FileDoesNotExist");
testCommand.validateOptions();
}catch (CommandValidationException cve){
assertEquals(cve.getMessage(), "CLI146 FileDoesNotExist does not exist in the file system or read permission denied.");
}
|
public void | testValidateOptionsWithInvalidServiceType()
try{
final File f = File.createTempFile("testValidateOptionsWithInvalidServiceType", ".password");
f.deleteOnExit();
testCommand.setOption(testCommand.PASSWORDFILE, f.getAbsolutePath());
final File dir = new File("testValidateOptionsWithInvalidServiceTypeDir");
dir.mkdir();
dir.deleteOnExit();
Vector operands = new Vector();
operands.add(dir.getAbsolutePath());
testCommand.setOperands(operands);
testCommand.setOption("type", "invalidType");
testCommand.validateOptions();
}catch (CommandValidationException cve){
assertEquals(cve.getMessage(),
"CLI185 Invalid type specified. --type should be das or node-agent");
}
|
public void | testValidateOptionsWithInvalidTypeDir()
try{
final File f = File.createTempFile("testValidateOptionsWithInvalidTypeDir", ".password");
f.deleteOnExit();
testCommand.setOption(testCommand.PASSWORDFILE, f.getAbsolutePath());
Vector operands = new Vector();
operands.add("typeDir");
testCommand.setOperands(operands);
testCommand.setOption("type", "das");
testCommand.validateOptions();
}catch (CommandValidationException cve){
assertEquals(cve.getMessage(),
"CLI153 typeDir does not exist or does not have write permission");
}
|
public void | testValidateOptionsWithValidOptions()
final File f = File.createTempFile("testValidateOptionsWithInvalidServiceType", ".password");
f.deleteOnExit();
testCommand.setOption(testCommand.PASSWORDFILE, f.getAbsolutePath());
final File dir = new File("testValidateOptionsWithInvalidServiceTypeDir");
dir.mkdir();
dir.deleteOnExit();
Vector operands = new Vector();
operands.add(dir.getAbsolutePath());
testCommand.setOperands(operands);
testCommand.setOption("type", "das");
testCommand.validateOptions();
|