|
||||||||||
PREV NEXT | FRAMES NO FRAMES |
Deprecated Classes | |
---|---|
org.junit.contrib.java.lang.system.StandardErrorStreamLog
Please use SystemErrRule .
The public void MyTest { @Rule public final StandardErrorStreamLog log = new StandardErrorStreamLog(); @Test public void captureErrorStream() { System.err.print("hello world"); assertEquals("hello world", log.getLog()); } }You can clear the log if you only want to test parts of the text written to the standard error stream. @Test public void captureErrorStream() { System.err.print("before"); log.clear(); System.err.print("afterwards"); assertEquals("afterwards", log.getLog()); } Prevent output to the standard error streamIn general it is not necessary that a test writes to the standard error stream. Avoiding this output may speed up the test and reduce the clutter on the commandline.The test does not write to the stream if the rule is created with the
@Rule public final StandardErrorStreamLog log = new StandardErrorStreamLog(LOG_ONLY); |
|
org.junit.contrib.java.lang.system.StandardOutputStreamLog
Please use SystemOutRule .
The public void MyTest { @Rule public final StandardOutputStreamLog log = new StandardOutputStreamLog(); @Test public void captureOutputStream() { System.out.print("hello world"); assertEquals("hello world", log.getLog()); } }You can clear the log if you only want to test parts of the text written to the standard output stream. @Test public void captureOutputStream() { System.out.print("before"); log.clear(); System.out.print("afterwards"); assertEquals("afterwards", log.getLog()); } Prevent output to the standard output streamIn general it is not necessary that a test writes to the standard output stream. Avoiding this output may speed up the test and reduce the clutter on the commandline.The test does not write to the stream if the rule is created with the
@Rule public final StandardOutputStreamLog log = new StandardOutputStreamLog(LOG_ONLY); |
Deprecated Enums | |
---|---|
org.junit.contrib.java.lang.system.LogMode
This enum is no longer needed, because all rules that are using it have been replaced with rules that don't need the enum. Mode of the
|
Deprecated Constructors | |
---|---|
org.junit.contrib.java.lang.system.ProvideSystemProperty()
see ProvideSystemProperty.setProperty(String, String) . |
|
org.junit.contrib.java.lang.system.RestoreSystemProperties(String...)
Please use RestoreSystemProperties.RestoreSystemProperties() . The
rule restores all properties. That's why you don't have to
specify the properties anymore. |
|
org.junit.contrib.java.lang.system.StandardErrorStreamLog()
Please use new SystemErrRule().enableLog() .
Creates a rule that records writes while they are still written to the standard error stream. |
|
org.junit.contrib.java.lang.system.StandardErrorStreamLog(LogMode)
Please use new SystemErrRule().enableLog()
instead of
new StandardErrorStreamLog(LogMode.LOG_AND_WRITE_TO_STREAM) or
new SystemErrRule().enableLog() .mute()
instead of new StandardErrorStreamLog(LogMode.LOG_ONLY) .
Creates a rule that records writes to the standard error stream
according to the specified |
|
org.junit.contrib.java.lang.system.StandardOutputStreamLog()
Please use new SystemOutRule().enableLog() .
Creates a rule that records writes while they are still written to the standard output stream. |
|
org.junit.contrib.java.lang.system.StandardOutputStreamLog(LogMode)
Please use new SystemOutRule().enableLog()
instead of
new StandardOutputStreamLog(LogMode.LOG_AND_WRITE_TO_STREAM) or
new SystemOutRule().enableLog() .mute()
instead of new StandardOutputStreamLog(LogMode.LOG_ONLY) .
Creates a rule that records writes to the standard output stream
according to the specified |
|
org.junit.contrib.java.lang.system.TextFromStandardInputStream(String)
use TextFromStandardInputStream.provideLines(String...) |
Deprecated Enum Constants | |
---|---|
org.junit.contrib.java.lang.system.LogMode.LOG_AND_WRITE_TO_STREAM
Please use SystemErrRule.enableLog() or
SystemOutRule.enableLog() .
Record the writes while they are still written to the stream. |
|
org.junit.contrib.java.lang.system.LogMode.LOG_ONLY
Please use SystemErrRule.enableLog() .mute() or
SystemOutRule.enableLog() .mute() .
Capture the writes to the stream. Nothing is written to the stream itself. |
|
||||||||||
PREV NEXT | FRAMES NO FRAMES |