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
The
SystemIn system stub as a JUnit 4 test rule- Since:
- 1.0.0
-
Constructor Summary
ConstructorsConstructorDescriptionSystemInRule(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, setInputStreamMethods inherited from class uk.org.webcompere.systemstubs.resource.SingularTestResource
isActive, setup, teardownMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface uk.org.webcompere.systemstubs.resource.Executable
executeMethods inherited from interface uk.org.webcompere.systemstubs.rules.internal.SystemStubTestRule
applyMethods inherited from interface uk.org.webcompere.systemstubs.resource.TestResource
execute, setup, teardown
-
Constructor Details
-
SystemInRule
Construct with multiple lines on System.in- Parameters:
lines- lines to provide - will be separated by system line separator
-
SystemInRule
Construct with an input stream to read from - this will be closed on tidy up- Parameters:
inputStream- the stream to read from
-
SystemInRule
Construct with any of theAltInputStreamobjects - e.g.LinesAltStream- Parameters:
altInputStream- the stream to use while the rule is active
-