ApexCli { static GetOperatorClassesCommandLineInfo getGetOperatorClassesCommandLineInfo(String[] args) throws ParseException { CommandLineParser parser = new PosixParser(); GetOperatorClassesCommandLineInfo result = new GetOperatorClassesCommandLineInfo(); CommandLine line = parser.parse(GET_OPERATOR_CLASSES_OPTIONS.options, args); result.parent = line.getOptionValue("parent"); result.args = line.getArgs(); return result; } ApexCli(); void preImpersonationInit(String[] args); void init(); void run(); @SuppressWarnings("static-access") static Options getShowLogicalPlanCommandLineOptions(); void mainHelper(); static void main(final String[] args);  }
@Test public void testGetOperatorClassesCommandLineInfo() throws Exception { String arg2 = "option value"; String arg3 = "regular parameter"; ApexCli.GetOperatorClassesCommandLineInfo commandLineOptions = ApexCli.getGetOperatorClassesCommandLineInfo(new String[] {"-parent", arg2, arg3}); Assert.assertEquals(commandLineOptions.parent, arg2); Assert.assertEquals(commandLineOptions.args.length, 1); Assert.assertEquals(commandLineOptions.args[0], arg3); }