Where is this class? My project use the JUnit 4.12, and not found the StandardOutputStreamLog. Is it be removed at this release? or it come from the other lib? and what is the relation between these tow?
SystemOutRule
superseded StandardOutputStreamLog
as suggested by @Rahul Tripathi.
Just adding few more pointers to get started right away.
Maven dependency:
<dependency>
<groupId>com.github.stefanbirkner</groupId>
<artifactId>system-rules</artifactId>
<version>1.18.0</version>
<scope>test</scope>
</dependency>
Add the jar to the buildpath to get the below import.
import org.junit.contrib.java.lang.system.SystemOutRule;
public void MyTest {
@Rule
public final SystemOutRule systemOutRule = new SystemOutRule().enableLog();
@Test
public void writesTextToSystemOut() {
System.out.print("hello world");
assertEquals("hello world", systemOutRule.getLog());
}
}
Reference: http://stefanbirkner.github.io/system-rules/
This class is deprecated and you should use SystemOutRule.
Check the source
StandardOutputStreamLog()
Deprecated.
Please use new SystemOutRule().enableLog().
Creates a rule that records writes while they are still written to the standard output stream.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With