Class PreventSystemExit

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean getExitCalled()
      Checks whether System.exit() has been called after reset().
      int getExitValue()
      Looks up the value given to the latest invocation of System.exit()
      void reset()
      Resets internal state.
      void setUp()
      Stores original SecurityManager and set a new one blocking System.exit() Calls reset().
      void tearDown()
      Restores original SecurityManager.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • setUp

        public void setUp()
        Stores original SecurityManager and set a new one blocking System.exit() Calls reset().
        Specified by:
        setUp in interface TestConfigurationIF
      • reset

        public void reset()
        Resets internal state.
      • getExitCalled

        public boolean getExitCalled()
        Checks whether System.exit() has been called after reset().
        Returns:
        true if and only if System.exit() has been called after reset().
      • getExitValue

        public int getExitValue()
        Looks up the value given to the latest invocation of System.exit()
        Returns:
        The int value. Throws UnknownID if System.exit() has not been called after reset().