public class TestClassExistsCmdLineOptionValidator extends TestCase {
public void testValidate() {
// Check null option instance not allowed.
try {
new ClassExistsCmdLineOptionValidator().validate(null);
} catch (IllegalArgumentException ignore) { /* expect throw */
}
// Check fail case.
CmdLineOptionInstance instance = createOptionInstance(
createSimpleOption("test", false), "bogus");
assertEquals(Result.Grade.FAIL, new ClassExistsCmdLineOptionValidator()
.validate(instance).getGrade());
// Check pass case.
instance = createOptionInstance(createSimpleOption("test", false),
"java.lang.String");
assertEquals(Result.Grade.PASS, new ClassExistsCmdLineOptionValidator()
.validate(instance).getGrade());
}