Ejemplo n.º 1
0
 public void assertInitOptionSuccess(Option option) {
   try {
     option.validate();
   } catch (InvalidOptionException e) {
     throw new AssertionError("Initialization failed: " + e.getMessage());
   }
 }
Ejemplo n.º 2
0
 public void assertInitOptionFailed(Option option, String expectedErrorMessage) {
   try {
     option.validate();
     throw new AssertionError("Initialization should be failed");
   } catch (InvalidOptionException e) {
     if (expectedErrorMessage != null) {
       assertEquals(
           expectedErrorMessage, e.getMessage().substring(0, expectedErrorMessage.length()));
     }
   }
 }