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>
JUnit4 test rule that captures
System.out during tests.- Since:
- 1.0.0
- See Also:
-
Field Summary
Fields inherited from class uk.org.webcompere.systemstubs.stream.SystemStreamBase
currentTarget, originalStream, printStreamGetter, printStreamSetter, targetFactory -
Constructor Summary
ConstructorsConstructorDescriptionDefault 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, wrapMethods 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.stream.output.Output
closeOutput, factoryOfSelf, getLines, getLinesNormalized, getLinesNormalized, getOutputMethods 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
-
SystemOutRule
Construct with an alternativeOutputto use- Parameters:
output- the output to write system error to
-
SystemOutRule
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
-