system-lambda icon indicating copy to clipboard operation
system-lambda copied to clipboard

Is it possible to suppress the output of catchSystemExit()

Open SixFelix opened this issue 3 years ago • 0 comments
trafficstars

When I run this code:

for (File image : testImages) { String[] args = {"imageconvert", "-f", "JPEG", image.toString(), "src/test/resources/testoutput"}; try { int exitcode = catchSystemExit(() -> { Main.main(args); }); assertEquals(0, exitcode); } catch (Exception e) { }

it results in this output on the console:

com.github.stefanbirkner.systemlambda.SystemLambda$CheckExitCalled at com.github.stefanbirkner.systemlambda.SystemLambda$NoExitSecurityManager.checkExit(SystemLambda.java:1419) at java.lang.Runtime.exit(Runtime.java:107) at java.lang.System.exit(System.java:973) at imageprocessor.imageconvert.ImageConvert.endOfConvert(ImageConvert.java:435) at imageprocessor.imageconvert.ImageConvert.convert(ImageConvert.java:180) at imageprocessor.imageconvert.ImageConvertParameters.run(ImageConvertParameters.java:71) at picocli.CommandLine.executeUserObject(CommandLine.java:1939) at picocli.CommandLine.access$1300(CommandLine.java:145) at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2358) at picocli.CommandLine$RunLast.handle(CommandLine.java:2352) at picocli.CommandLine$RunLast.handle(CommandLine.java:2314) at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179) at picocli.CommandLine$RunLast.execute(CommandLine.java:2316) at picocli.CommandLine.execute(CommandLine.java:2078) at imageprocessor.Main.main(Main.java:10) ...

Is it possible to suppress this output?

Main.main(args) calls a picocli subcommand.

SixFelix avatar Nov 02 '22 20:11 SixFelix