Class SystemOutRule
- java.lang.Object
-
- uk.org.webcompere.systemstubs.resource.SingularTestResource
-
- uk.org.webcompere.systemstubs.stream.SystemStreamBase
-
- uk.org.webcompere.systemstubs.stream.SystemOut
-
- uk.org.webcompere.systemstubs.rules.SystemOutRule
-
- All Implemented Interfaces:
org.junit.rules.TestRule,Executable,TestResource,SystemStubTestRule,Output<OutputStream>
public class SystemOutRule extends SystemOut implements SystemStubTestRule
JUnit4 test rule that capturesSystem.outduring tests.- Since:
- 1.0.0
- See Also:
SystemOut
-
-
Field Summary
-
Fields inherited from class uk.org.webcompere.systemstubs.stream.SystemStreamBase
currentTarget, originalStream, printStreamGetter, printStreamSetter, targetFactory
-
-
Constructor Summary
Constructors Constructor Description SystemOutRule()Default constructor, uses aTapStreamto tap system out while the rule is activeSystemOutRule(Output<? extends OutputStream> output)Construct with an alternativeOutputto useSystemOutRule(OutputFactory<? extends OutputStream> outputFactory)Construct with aOutputFactoryfor creating output objects from the existing output
-
Method Summary
-
Methods inherited from class uk.org.webcompere.systemstubs.stream.SystemStreamBase
clear, doSetup, doTeardown, getOutputStream, getText, wrap
-
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.stream.output.Output
closeOutput, factoryOfSelf, getLines, getLinesNormalized, getLinesNormalized, getOutput
-
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
-
SystemOutRule
public SystemOutRule(Output<? extends OutputStream> output)
Construct with an alternativeOutputto use- Parameters:
output- the output to write system error to
-
SystemOutRule
public SystemOutRule(OutputFactory<? extends OutputStream> outputFactory)
Construct with aOutputFactoryfor creating output objects from the existing output- Parameters:
outputFactory- the factory to use
-
SystemOutRule
public SystemOutRule()
Default constructor, uses aTapStreamto tap system out while the rule is active
-
-