AntennaComplianceToolOptions extends AbstractAntennaCLIOptions { static String helpMessage() { String cr = System.lineSeparator(); return "Usage: java -jar compliancetool.jar [options] <complianceMode> <propertiesFilePath>" + cr + cr + "Supported options:" + cr + SWITCH_HELP_SHORT + ", " + SWITCH_HELP_LONG + ": Displays this help message." + cr + SWITCH_DEBUG_SHORT + ", " + SWITCH_DEBUG_LONG + ": Sets log level to DEBUG for diagnostic purposes." + cr + cr + "Compliance Tool modes: (only one can be set)" + cr + SWITCH_EXPORTER_SHORT + ", " + SWITCH_EXPORTER_LONG + ": Sets the compliance tool execute the SW360Exporter" + cr + SWITCH_UPDATER_SHORT + ", " + SWITCH_UPDATER_LONG + ": Sets the compliance tool execute the SW360Updater" + cr + SWITCH_REPORTER + ": Sets the compliance tool to produce a reporter report of chosen content in your sw360 instance" + cr; } AntennaComplianceToolOptions(String propertiesFilePath, String complianceMode, Set<String> parameters, boolean debugLog, boolean showHelp, boolean valid); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); static final String SWITCH_REPORTER; }
@Test public void testHelpMessage() { List<String> expectedFragments = Arrays.asList("Usage: ", AntennaComplianceToolOptions.SWITCH_DEBUG_LONG, AntennaComplianceToolOptions.SWITCH_DEBUG_SHORT, AntennaComplianceToolOptions.SWITCH_HELP_LONG, AntennaComplianceToolOptions.SWITCH_HELP_SHORT, "[options]", "<propertiesFilePath>", "Compliance Tool modes: (only one can be set)", AntennaComplianceToolOptions.SWITCH_EXPORTER_SHORT, AntennaComplianceToolOptions.SWITCH_EXPORTER_LONG, AntennaComplianceToolOptions.SWITCH_UPDATER_SHORT, AntennaComplianceToolOptions.SWITCH_UPDATER_LONG); String helpMessage = AntennaComplianceToolOptions.helpMessage(); assertThat(helpMessage).contains(expectedFragments); System.out.println(helpMessage); }