Package org.apache.lucene.util
Class TestRuleLimitSysouts
- java.lang.Object
-
- com.carrotsearch.randomizedtesting.rules.TestRuleAdapter
-
- org.apache.lucene.util.TestRuleLimitSysouts
-
- All Implemented Interfaces:
org.junit.rules.TestRule
public class TestRuleLimitSysouts extends com.carrotsearch.randomizedtesting.rules.TestRuleAdapter
Fails the suite if it prints over the given limit of bytes to eitherSystem.out
orSystem.err
, unless the condition is not enforced (seeisEnforced()
).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
TestRuleLimitSysouts.Limit
An annotation specifying the limit of bytes per class.
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_SYSOUT_BYTES_THRESHOLD
Max limit of bytes printed to eitherSystem.out
orSystem.err
.
-
Constructor Summary
Constructors Constructor Description TestRuleLimitSysouts(TestRuleMarkFailure failureMarker)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
afterAlways(List<Throwable> errors)
protected void
afterIfSuccessful()
We're only interested in failing the suite if it was successful (otherwise just propagate the original problem and don't bother doing anything else).protected void
before()
static void
checkCaptureStreams()
EnsuresSystem.out
andSystem.err
point to delegate streams.protected boolean
isEnforced()
-
-
-
Field Detail
-
DEFAULT_SYSOUT_BYTES_THRESHOLD
public static final int DEFAULT_SYSOUT_BYTES_THRESHOLD
Max limit of bytes printed to eitherSystem.out
orSystem.err
. This limit is enforced per-class (suite).- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TestRuleLimitSysouts
public TestRuleLimitSysouts(TestRuleMarkFailure failureMarker)
-
-
Method Detail
-
before
protected void before() throws Throwable
- Overrides:
before
in classcom.carrotsearch.randomizedtesting.rules.TestRuleAdapter
- Throws:
Throwable
-
checkCaptureStreams
public static void checkCaptureStreams()
EnsuresSystem.out
andSystem.err
point to delegate streams.
-
isEnforced
protected boolean isEnforced()
-
afterIfSuccessful
protected void afterIfSuccessful() throws Throwable
We're only interested in failing the suite if it was successful (otherwise just propagate the original problem and don't bother doing anything else).- Overrides:
afterIfSuccessful
in classcom.carrotsearch.randomizedtesting.rules.TestRuleAdapter
- Throws:
Throwable
-
-