test_class.declarator: LOGGER = LoggerFactory.getLogger(CommandTest.class)
test_class.modifier: private static final
test_class.original_string: private static final Logger LOGGER = LoggerFactory.getLogger(CommandTest.class);
test_class.type: Logger
test_class.var_name: LOGGER
test_class.declarator: testOutputBaseDir = new File("target/test-output/CommandTest")
test_class.modifier: final
test_class.original_string: final File testOutputBaseDir = new File("target/test-output/CommandTest");
test_class.type: File
test_class.var_name: testOutputBaseDir
test_class.file: cli/src/test/java/net/adamcin/oakpal/cli/CommandTest.java
test_class.identifier: CommandTest
test_case.body: @Test
      public void testWriteReports() {
          final List<CheckReport> reports = new ArrayList<>();
          reports.add(new SimpleReport("some check", Collections.emptyList()));
          reports.add(new SimpleReport("check with violations", Arrays.asList(
                  new SimpleViolation(Severity.MINOR, "minor violation"),
                  new SimpleViolation(Severity.SEVERE, "severe violation with one packageId",
                          PackageId.fromString("my_packages/acme/1.0")),
                  new SimpleViolation(Severity.MAJOR, "major violation with several packageIds",
                          PackageId.fromString("my_packages/alpha/1.0"),
                          PackageId.fromString("my_packages/beta/1.0"),
                          PackageId.fromString("my_packages/gamma/1.0"))
          )));
  
          final String output = captureStructured(false, (command, printer) ->
                  command.printReports(reports, printer));
          LOGGER.info("reports: \n{}", output);
          assertFalse("reports should not be empty", output.isEmpty());
  
          final String jsonOutput = captureStructured(true, (command, printer) ->
                  command.printReports(reports, printer));
          LOGGER.info("json reports: \n{}", jsonOutput);
          assertFalse("json reports should not be empty", jsonOutput.isEmpty());
  
          List<CheckReport> readReports = uncheck0(() ->
                  ReportMapper.readReports(() -> new BufferedReader(new StringReader(jsonOutput)))).get();
          for (int i = 0; i < reports.size(); i++) {
              assertEquals("read report should match input report at index " + i,
                      reports.get(i), readReports.get(i));
          }
      }
test_case.class_method_signature: CommandTest.testWriteReports()
test_case.full_signature: @Test public void testWriteReports()
test_case.identifier: testWriteReports
test_case.invocations: add emptyList add asList fromString fromString fromString fromString captureStructured printReports info assertFalse isEmpty captureStructured printReports info assertFalse isEmpty get uncheck0 readReports size assertEquals get get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testWriteReports()
focal_class.declarator: LOGGER = LoggerFactory.getLogger(Command.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = LoggerFactory.getLogger(Command.class);
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.declarator: SHORT_NO_OPT_PREFIX = "+"
focal_class.modifier: private static final
focal_class.original_string: private static final String SHORT_NO_OPT_PREFIX = "+";
focal_class.type: String
focal_class.var_name: SHORT_NO_OPT_PREFIX
focal_class.declarator: LONG_NO_OPT_PREFIX = "--no-"
focal_class.modifier: private static final
focal_class.original_string: private static final String LONG_NO_OPT_PREFIX = "--no-";
focal_class.type: String
focal_class.var_name: LONG_NO_OPT_PREFIX
focal_class.declarator: VERSION_PROPERTIES_NAME = "version.properties"
focal_class.modifier: private static final
focal_class.original_string: private static final String VERSION_PROPERTIES_NAME = "version.properties";
focal_class.type: String
focal_class.var_name: VERSION_PROPERTIES_NAME
focal_class.declarator: COMMAND_HELP_TXT = "help.txt"
focal_class.modifier: private static final
focal_class.original_string: private static final String COMMAND_HELP_TXT = "help.txt";
focal_class.type: String
focal_class.var_name: COMMAND_HELP_TXT
focal_class.declarator: EXIT_GENERAL_ERROR = 1
focal_class.modifier: static final
focal_class.original_string: static final Integer EXIT_GENERAL_ERROR = 1;
focal_class.type: Integer
focal_class.var_name: EXIT_GENERAL_ERROR
focal_class.declarator: EXIT_ABORTED_SCAN = 9
focal_class.modifier: static final
focal_class.original_string: static final Integer EXIT_ABORTED_SCAN = 9;
focal_class.type: Integer
focal_class.var_name: EXIT_ABORTED_SCAN
focal_class.declarator: EXIT_SEVERE_VIOLATION = 10
focal_class.modifier: static final
focal_class.original_string: static final Integer EXIT_SEVERE_VIOLATION = 10;
focal_class.type: Integer
focal_class.var_name: EXIT_SEVERE_VIOLATION
focal_class.declarator: EXIT_MAJOR_VIOLATION = 11
focal_class.modifier: static final
focal_class.original_string: static final Integer EXIT_MAJOR_VIOLATION = 11;
focal_class.type: Integer
focal_class.var_name: EXIT_MAJOR_VIOLATION
focal_class.declarator: EXIT_MINOR_VIOLATION = 12
focal_class.modifier: static final
focal_class.original_string: static final Integer EXIT_MINOR_VIOLATION = 12;
focal_class.type: Integer
focal_class.var_name: EXIT_MINOR_VIOLATION
focal_class.file: cli/src/main/java/net/adamcin/oakpal/cli/Command.java
focal_class.identifier: Command
focal_class.class_method_signature: Command.perform(final @NotNull Console console, final @NotNull String[] args)
focal_class.full_signature:  IO<Integer> perform(final @NotNull Console console, final @NotNull String[] args)
focal_class.identifier: perform
focal_class.parameters: (final @NotNull Console console, final @NotNull String[] args)
focal_class.return: IO<Integer>
focal_class.signature: IO<Integer> perform(final @NotNull Console console, final @NotNull String[] args)
focal_class.class_method_signature: Command.getNodeStoreSupplier(final @NotNull Options opts)
focal_class.full_signature:  Supplier<NodeStore> getNodeStoreSupplier(final @NotNull Options opts)
focal_class.identifier: getNodeStoreSupplier
focal_class.parameters: (final @NotNull Options opts)
focal_class.return: Supplier<NodeStore>
focal_class.signature: Supplier<NodeStore> getNodeStoreSupplier(final @NotNull Options opts)
focal_class.class_method_signature: Command.doScan(final @NotNull Console console, final @NotNull Options opts)
focal_class.full_signature:  IO<Integer> doScan(final @NotNull Console console, final @NotNull Options opts)
focal_class.identifier: doScan
focal_class.parameters: (final @NotNull Console console, final @NotNull Options opts)
focal_class.return: IO<Integer>
focal_class.signature: IO<Integer> doScan(final @NotNull Console console, final @NotNull Options opts)
focal_class.class_method_signature: Command.runOakScan(final @NotNull Options opts, final @NotNull OakMachine oak)
focal_class.full_signature:  Result<List<CheckReport>> runOakScan(final @NotNull Options opts, final @NotNull OakMachine oak)
focal_class.identifier: runOakScan
focal_class.parameters: (final @NotNull Options opts, final @NotNull OakMachine oak)
focal_class.return: Result<List<CheckReport>>
focal_class.signature: Result<List<CheckReport>> runOakScan(final @NotNull Options opts, final @NotNull OakMachine oak)
focal_class.class_method_signature: Command.getHighestReportSeverity(final @NotNull Options opts,
                                                 final @NotNull List<CheckReport> reports)
focal_class.full_signature:  Optional<Integer> getHighestReportSeverity(final @NotNull Options opts,
                                                 final @NotNull List<CheckReport> reports)
focal_class.identifier: getHighestReportSeverity
focal_class.parameters: (final @NotNull Options opts,
                                                 final @NotNull List<CheckReport> reports)
focal_class.return: Optional<Integer>
focal_class.signature: Optional<Integer> getHighestReportSeverity(final @NotNull Options opts,
                                                 final @NotNull List<CheckReport> reports)
focal_class.class_method_signature: Command.printReports(final @NotNull List<CheckReport> reports,
                               final @NotNull Function<StructuredMessage, IO<Nothing>> linePrinter)
focal_class.full_signature:  IO<Nothing> printReports(final @NotNull List<CheckReport> reports,
                               final @NotNull Function<StructuredMessage, IO<Nothing>> linePrinter)
focal_class.identifier: printReports
focal_class.parameters: (final @NotNull List<CheckReport> reports,
                               final @NotNull Function<StructuredMessage, IO<Nothing>> linePrinter)
focal_class.return: IO<Nothing>
focal_class.signature: IO<Nothing> printReports(final @NotNull List<CheckReport> reports,
                               final @NotNull Function<StructuredMessage, IO<Nothing>> linePrinter)
focal_class.class_method_signature: Command.printHelp(final @NotNull Function<Object, IO<Nothing>> linePrinter)
focal_class.full_signature:  IO<Nothing> printHelp(final @NotNull Function<Object, IO<Nothing>> linePrinter)
focal_class.identifier: printHelp
focal_class.parameters: (final @NotNull Function<Object, IO<Nothing>> linePrinter)
focal_class.return: IO<Nothing>
focal_class.signature: IO<Nothing> printHelp(final @NotNull Function<Object, IO<Nothing>> linePrinter)
focal_class.class_method_signature: Command.printVersion(final @NotNull Function<Object, IO<Nothing>> linePrinter)
focal_class.full_signature:  IO<Nothing> printVersion(final @NotNull Function<Object, IO<Nothing>> linePrinter)
focal_class.identifier: printVersion
focal_class.parameters: (final @NotNull Function<Object, IO<Nothing>> linePrinter)
focal_class.return: IO<Nothing>
focal_class.signature: IO<Nothing> printVersion(final @NotNull Function<Object, IO<Nothing>> linePrinter)
focal_class.class_method_signature: Command.flipOpt(final @NotNull String wholeOpt)
focal_class.full_signature:  Optional<String> flipOpt(final @NotNull String wholeOpt)
focal_class.identifier: flipOpt
focal_class.parameters: (final @NotNull String wholeOpt)
focal_class.return: Optional<String>
focal_class.signature: Optional<String> flipOpt(final @NotNull String wholeOpt)
focal_class.class_method_signature: Command.parseArgs(final @NotNull Console console, final @NotNull String[] args)
focal_class.full_signature: @NotNull Result<Options> parseArgs(final @NotNull Console console, final @NotNull String[] args)
focal_class.identifier: parseArgs
focal_class.modifiers: @NotNull
focal_class.parameters: (final @NotNull Console console, final @NotNull String[] args)
focal_class.return: Result<Options>
focal_class.signature: Result<Options> parseArgs(final @NotNull Console console, final @NotNull String[] args)
focal_method.body: IO<Nothing> printReports(final @NotNull List<CheckReport> reports,
                               final @NotNull Function<StructuredMessage, IO<Nothing>> linePrinter) {
          return linePrinter.apply(new AllReportsMessage(reports));
      }
focal_method.class_method_signature: Command.printReports(final @NotNull List<CheckReport> reports,
                               final @NotNull Function<StructuredMessage, IO<Nothing>> linePrinter)
focal_method.full_signature:  IO<Nothing> printReports(final @NotNull List<CheckReport> reports,
                               final @NotNull Function<StructuredMessage, IO<Nothing>> linePrinter)
focal_method.identifier: printReports
focal_method.invocations: apply
focal_method.parameters: (final @NotNull List<CheckReport> reports,
                               final @NotNull Function<StructuredMessage, IO<Nothing>> linePrinter)
focal_method.return: IO<Nothing>
focal_method.signature: IO<Nothing> printReports(final @NotNull List<CheckReport> reports,
                               final @NotNull Function<StructuredMessage, IO<Nothing>> linePrinter)