A way to get print to console in RunListener?

"Oleskandr" <[email protected]>
Newsgroups gmane.comp.java.junit.user
Message-ID <[email protected]>
JUnit internally call System.setOut http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/System.html#setOut%28java.io.PrintStream%29

I write my custom simple RunListener to get a way to debug in some test execution by printing what test started and what stopped. But System.out.println() doesn't work...

I found solution at:

  http://stackoverflow.com/questions/3340342/java-writing-to-the-real-stdout-after-system-setout

import java.io.*;
...
PrintStream ps = new PrintStream(new FileOutputStream(FileDescriptor.out))

This code solve my problem.

I worry only about the right way to do output in RunListener. Is my solution ideologically right or there are exist object for printing message to console in JUnit API?



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/junit/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/junit/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.