All Downloads are FREE. Search and download functionalities are using the official Maven repository.

fitnesse.fixtures.SystemExitTable Maven / Gradle / Ivy

There is a newer version: 20181217
Show newest version
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);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy