Package org.apache.oodt.cas.cli.option.validator

Examples of org.apache.oodt.cas.cli.option.validator.AllowedArgsCmdLineOptionValidator.validate()


      AllowedArgsCmdLineOptionValidator validator = new AllowedArgsCmdLineOptionValidator();
      validator.setAllowedArgs(Lists.newArrayList("value1", "value2"));

      // Test no null option instance allowed.
      try {
         validator.validate(null);
         fail("Should have thrown IllegalArgumentException");
      } catch (IllegalArgumentException ignore) { /* expect throw */
      }

      // Test should fail case.
View Full Code Here


      }

      // Test should fail case.
      CmdLineOptionInstance instance = createOptionInstance(
            createSimpleOption("test", false), "value");
      assertEquals(Result.Grade.FAIL, validator.validate(instance).getGrade());

      // Test should pass case.
      instance = createOptionInstance(createSimpleOption("test", false),
            "value1");
      assertEquals(Result.Grade.PASS, validator.validate(instance).getGrade());
View Full Code Here

      assertEquals(Result.Grade.FAIL, validator.validate(instance).getGrade());

      // Test should pass case.
      instance = createOptionInstance(createSimpleOption("test", false),
            "value1");
      assertEquals(Result.Grade.PASS, validator.validate(instance).getGrade());
   }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.