Class SystemInRule

All Implemented Interfaces:
org.junit.rules.TestRule, Executable, TestResource, SystemStubTestRule

public class SystemInRule extends SystemIn implements SystemStubTestRule
The SystemIn system stub as a JUnit 4 test rule
Since:
1.0.0
  • Constructor Details

    • SystemInRule

      public SystemInRule(String... lines)
      Construct with multiple lines on System.in
      Parameters:
      lines - lines to provide - will be separated by system line separator
    • SystemInRule

      public SystemInRule(InputStream inputStream)
      Construct with an input stream to read from - this will be closed on tidy up
      Parameters:
      inputStream - the stream to read from
    • SystemInRule

      public SystemInRule(AltInputStream altInputStream)
      Construct with any of the AltInputStream objects - e.g. LinesAltStream
      Parameters:
      altInputStream - the stream to use while the rule is active