Class SystemInRule
- java.lang.Object
-
- uk.org.webcompere.systemstubs.resource.SingularTestResource
-
- uk.org.webcompere.systemstubs.stream.SystemIn
-
- uk.org.webcompere.systemstubs.rules.SystemInRule
-
- All Implemented Interfaces:
org.junit.rules.TestRule,Executable,TestResource,SystemStubTestRule
public class SystemInRule extends SystemIn implements SystemStubTestRule
TheSystemInsystem stub as a JUnit 4 test rule- Since:
- 1.0.0
-
-
Constructor Summary
Constructors Constructor Description SystemInRule(InputStream inputStream)Construct with an input stream to read from - this will be closed on tidy upSystemInRule(String... lines)Construct with multiple lines on System.inSystemInRule(AltInputStream altInputStream)Construct with any of theAltInputStreamobjects - e.g.
-
Method Summary
-
Methods inherited from class uk.org.webcompere.systemstubs.stream.SystemIn
andExceptionThrownOnInputEnd, andExceptionThrownOnInputEnd, doSetup, doTeardown, setInputStream, setInputStream
-
Methods inherited from class uk.org.webcompere.systemstubs.resource.SingularTestResource
isActive, setup, teardown
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface uk.org.webcompere.systemstubs.resource.Executable
execute
-
Methods inherited from interface uk.org.webcompere.systemstubs.rules.internal.SystemStubTestRule
apply
-
Methods inherited from interface uk.org.webcompere.systemstubs.resource.TestResource
execute, setup, teardown
-
-
-
-
Constructor Detail
-
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 theAltInputStreamobjects - e.g.LinesAltStream- Parameters:
altInputStream- the stream to use while the rule is active
-
-