@Test public void testHelpOption() { Botsing botsing = new Botsing(); String[] prop = {"-" + CommandLineParameters.HELP_OPT}; Object result = botsing.parseCommandLine(prop); assertThat("Call with option " + CommandLineParameters.HELP_OPT, result, nullValue()); }
public List<TestGenerationResult> parseCommandLine(String[] args) { CrashProperties crashProperties = CrashProperties.getInstance(); Options options = CommandLineParameters.getCommandLineOptions(); CommandLine commands = parseCommands(args, options, false); if (commands.hasOption(HELP_OPT)) { printHelpMessage(options, false); } else if(!(commands.hasOption(PROJECT_CP_OPT) && commands.hasOption(CRASH_LOG_OPT) && commands.hasOption(TARGET_FRAME_OPT))) { LOG.error("A mandatory option -{} -{} -{} is missing!", PROJECT_CP_OPT, CRASH_LOG_OPT, TARGET_FRAME_OPT); printHelpMessage(options, false); } else { java.util.Properties properties = commands.getOptionProperties(D_OPT); updateEvoSuiteProperties(properties); crashProperties.setClasspath(getCompatibleCP(commands.getOptionValue(PROJECT_CP_OPT))); setupProjectClasspath(crashProperties.getProjectClassPaths()); setupStackTrace(crashProperties, commands); if(commands.hasOption(SEARCH_ALGORITHM)){ setSearchAlgorithm(commands.getOptionValue(SEARCH_ALGORITHM)); } if(commands.hasOption(FITNESS_FUNCTION)){ setFF(commands.getOptionValue(FITNESS_FUNCTION)); } if(commands.hasOption(INTEGRATION_TESTING)){ CrashProperties.integrationTesting = true; } if(commands.hasOption(DISABLE_LINE_ESTIMATION)){ CrashProperties.lineEstimation = false; } if(commands.hasOption(IO_DIVERSITY)){ CrashProperties.IODiversity = true; } if(commands.hasOption(MODEL_PATH_OPT)){ setupModelSeedingRelatedProperties(commands); } return CrashReproduction.execute(); } return null; }
Botsing { public List<TestGenerationResult> parseCommandLine(String[] args) { CrashProperties crashProperties = CrashProperties.getInstance(); Options options = CommandLineParameters.getCommandLineOptions(); CommandLine commands = parseCommands(args, options, false); if (commands.hasOption(HELP_OPT)) { printHelpMessage(options, false); } else if(!(commands.hasOption(PROJECT_CP_OPT) && commands.hasOption(CRASH_LOG_OPT) && commands.hasOption(TARGET_FRAME_OPT))) { LOG.error("A mandatory option -{} -{} -{} is missing!", PROJECT_CP_OPT, CRASH_LOG_OPT, TARGET_FRAME_OPT); printHelpMessage(options, false); } else { java.util.Properties properties = commands.getOptionProperties(D_OPT); updateEvoSuiteProperties(properties); crashProperties.setClasspath(getCompatibleCP(commands.getOptionValue(PROJECT_CP_OPT))); setupProjectClasspath(crashProperties.getProjectClassPaths()); setupStackTrace(crashProperties, commands); if(commands.hasOption(SEARCH_ALGORITHM)){ setSearchAlgorithm(commands.getOptionValue(SEARCH_ALGORITHM)); } if(commands.hasOption(FITNESS_FUNCTION)){ setFF(commands.getOptionValue(FITNESS_FUNCTION)); } if(commands.hasOption(INTEGRATION_TESTING)){ CrashProperties.integrationTesting = true; } if(commands.hasOption(DISABLE_LINE_ESTIMATION)){ CrashProperties.lineEstimation = false; } if(commands.hasOption(IO_DIVERSITY)){ CrashProperties.IODiversity = true; } if(commands.hasOption(MODEL_PATH_OPT)){ setupModelSeedingRelatedProperties(commands); } return CrashReproduction.execute(); } return null; } }
Botsing { public List<TestGenerationResult> parseCommandLine(String[] args) { CrashProperties crashProperties = CrashProperties.getInstance(); Options options = CommandLineParameters.getCommandLineOptions(); CommandLine commands = parseCommands(args, options, false); if (commands.hasOption(HELP_OPT)) { printHelpMessage(options, false); } else if(!(commands.hasOption(PROJECT_CP_OPT) && commands.hasOption(CRASH_LOG_OPT) && commands.hasOption(TARGET_FRAME_OPT))) { LOG.error("A mandatory option -{} -{} -{} is missing!", PROJECT_CP_OPT, CRASH_LOG_OPT, TARGET_FRAME_OPT); printHelpMessage(options, false); } else { java.util.Properties properties = commands.getOptionProperties(D_OPT); updateEvoSuiteProperties(properties); crashProperties.setClasspath(getCompatibleCP(commands.getOptionValue(PROJECT_CP_OPT))); setupProjectClasspath(crashProperties.getProjectClassPaths()); setupStackTrace(crashProperties, commands); if(commands.hasOption(SEARCH_ALGORITHM)){ setSearchAlgorithm(commands.getOptionValue(SEARCH_ALGORITHM)); } if(commands.hasOption(FITNESS_FUNCTION)){ setFF(commands.getOptionValue(FITNESS_FUNCTION)); } if(commands.hasOption(INTEGRATION_TESTING)){ CrashProperties.integrationTesting = true; } if(commands.hasOption(DISABLE_LINE_ESTIMATION)){ CrashProperties.lineEstimation = false; } if(commands.hasOption(IO_DIVERSITY)){ CrashProperties.IODiversity = true; } if(commands.hasOption(MODEL_PATH_OPT)){ setupModelSeedingRelatedProperties(commands); } return CrashReproduction.execute(); } return null; }  }
Botsing { public List<TestGenerationResult> parseCommandLine(String[] args) { CrashProperties crashProperties = CrashProperties.getInstance(); Options options = CommandLineParameters.getCommandLineOptions(); CommandLine commands = parseCommands(args, options, false); if (commands.hasOption(HELP_OPT)) { printHelpMessage(options, false); } else if(!(commands.hasOption(PROJECT_CP_OPT) && commands.hasOption(CRASH_LOG_OPT) && commands.hasOption(TARGET_FRAME_OPT))) { LOG.error("A mandatory option -{} -{} -{} is missing!", PROJECT_CP_OPT, CRASH_LOG_OPT, TARGET_FRAME_OPT); printHelpMessage(options, false); } else { java.util.Properties properties = commands.getOptionProperties(D_OPT); updateEvoSuiteProperties(properties); crashProperties.setClasspath(getCompatibleCP(commands.getOptionValue(PROJECT_CP_OPT))); setupProjectClasspath(crashProperties.getProjectClassPaths()); setupStackTrace(crashProperties, commands); if(commands.hasOption(SEARCH_ALGORITHM)){ setSearchAlgorithm(commands.getOptionValue(SEARCH_ALGORITHM)); } if(commands.hasOption(FITNESS_FUNCTION)){ setFF(commands.getOptionValue(FITNESS_FUNCTION)); } if(commands.hasOption(INTEGRATION_TESTING)){ CrashProperties.integrationTesting = true; } if(commands.hasOption(DISABLE_LINE_ESTIMATION)){ CrashProperties.lineEstimation = false; } if(commands.hasOption(IO_DIVERSITY)){ CrashProperties.IODiversity = true; } if(commands.hasOption(MODEL_PATH_OPT)){ setupModelSeedingRelatedProperties(commands); } return CrashReproduction.execute(); } return null; }  List<TestGenerationResult> parseCommandLine(String[] args); void setupStackTrace(CrashProperties crashProperties, CommandLine commands); @SuppressWarnings("checkstyle:systemexit") static void main(String[] args); }
Botsing { public List<TestGenerationResult> parseCommandLine(String[] args) { CrashProperties crashProperties = CrashProperties.getInstance(); Options options = CommandLineParameters.getCommandLineOptions(); CommandLine commands = parseCommands(args, options, false); if (commands.hasOption(HELP_OPT)) { printHelpMessage(options, false); } else if(!(commands.hasOption(PROJECT_CP_OPT) && commands.hasOption(CRASH_LOG_OPT) && commands.hasOption(TARGET_FRAME_OPT))) { LOG.error("A mandatory option -{} -{} -{} is missing!", PROJECT_CP_OPT, CRASH_LOG_OPT, TARGET_FRAME_OPT); printHelpMessage(options, false); } else { java.util.Properties properties = commands.getOptionProperties(D_OPT); updateEvoSuiteProperties(properties); crashProperties.setClasspath(getCompatibleCP(commands.getOptionValue(PROJECT_CP_OPT))); setupProjectClasspath(crashProperties.getProjectClassPaths()); setupStackTrace(crashProperties, commands); if(commands.hasOption(SEARCH_ALGORITHM)){ setSearchAlgorithm(commands.getOptionValue(SEARCH_ALGORITHM)); } if(commands.hasOption(FITNESS_FUNCTION)){ setFF(commands.getOptionValue(FITNESS_FUNCTION)); } if(commands.hasOption(INTEGRATION_TESTING)){ CrashProperties.integrationTesting = true; } if(commands.hasOption(DISABLE_LINE_ESTIMATION)){ CrashProperties.lineEstimation = false; } if(commands.hasOption(IO_DIVERSITY)){ CrashProperties.IODiversity = true; } if(commands.hasOption(MODEL_PATH_OPT)){ setupModelSeedingRelatedProperties(commands); } return CrashReproduction.execute(); } return null; }  List<TestGenerationResult> parseCommandLine(String[] args); void setupStackTrace(CrashProperties crashProperties, CommandLine commands); @SuppressWarnings("checkstyle:systemexit") static void main(String[] args);  }