public void testWithMistypedOption2() throws CmdlineOptions.OptionsException { String[] argv = {"-tmid", "propfile", "tmfile.xtm"}; setupRDBMS(argv); try { options.parse(); fail("Incorrect options allowed"); } catch (CmdlineOptions.OptionsException e) { assertTrue("Wrong problem reported" + e.getArgument(), e.getArgument().equals("-tmid")); } }
public void testWithMistypedOption() throws CmdlineOptions.OptionsException { String[] argv = {"-tmid=140", "propfile", "tmfile.xtm"}; setupRDBMS(argv); try { options.parse(); fail("Incorrect options allowed"); } catch (CmdlineOptions.OptionsException e) { assertTrue("Wrong problem reported" + e.getArgument(), e.getArgument().equals("-tmid=140")); } }
@Override public String getMessage() { if (value == null) return "Invalid option '" + getArgument() + "'."; else return "Invalid option '" + getArgument() + "=" + getValue() + "'."; } }