if(OperatingSystem.isWindows()) {
return;
}
Configuration config = new Configuration();
ExternalProcessInputSplit split = new ExternalProcessInputSplit(1, 1, failingCommand);
format.configure(config);
boolean invalidExitCode = false;
try {
format.open(split);
format.waitForProcessToFinish();
format.close();
} catch (IOException e) {
Assert.fail();
} catch (InterruptedException e) {
Assert.fail();
} catch (RuntimeException e) {
if(e.getMessage().startsWith("External process did not finish with an allowed exit code:")) {
invalidExitCode = true;
}
}
Assert.assertTrue(invalidExitCode);
invalidExitCode = false;
config.setString(ExternalProcessInputFormat.ALLOWEDEXITCODES_PARAMETER_KEY,"0,1,2");
format.configure(config);
try {
format.open(split);
format.waitForProcessToFinish();
format.close();