fitnesse.fixtures.SystemExitTable Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fitnesse Show documentation
Show all versions of fitnesse Show documentation
The fully integrated standalone wiki, and acceptance testing framework.
package fitnesse.fixtures;
import fit.ColumnFixture;
public class SystemExitTable extends ColumnFixture {
private int exitCode;
private Throwable exception;
public void setSystemExitCode(int exitCode) {
this.exitCode = exitCode;
}
// slim:
@Override
public void execute() {
try {
System.exit(exitCode);
} catch (Throwable e) { // NOSONAR
exception = e;
}
}
// fit:
public boolean valid() throws Exception {
exitSystem(exitCode);
return true;
}
public String exceptionMessage() {
return exception.getMessage();
}
public void exitSystem(int code) {
System.exit(code);
}
}