package edu.ucdenver.ccp.common.io;

import java.io.PrintStream;

import org.apache.log4j.Category;
import org.apache.log4j.Priority;
import org.apache.log4j.BasicConfigurator;

public class LoggingOutputStreamTest {
	
	public static void main(String args[])
	{
		BasicConfigurator.configure();
		System.out.println("you should see this 1");
		
        PrintStream oldOut = System.out;
        PrintStream oldErr = System.err;
        System.setOut(new PrintStream(new LoggingOutputStream(Category.getRoot(), Priority.WARN),true));
        System.setErr(new PrintStream(new LoggingOutputStream(Category.getRoot(), Priority.ERROR),true));
		System.out.println("you should NOT see this 2");
		System.err.println("You should not see this either 2.5");
		
	    System.setOut(oldOut);
	    System.setErr(oldErr);
		System.out.println("you should see this 3");
	}

}

@@ -59,16 +59,48 @@
 tream;%0A%0A
+import junit.framework.Assert;%0A%0A
 import o
@@ -201,16 +201,39 @@
 gurator;
+%0Aimport org.junit.Test;
 %0A%0Apublic
@@ -905,12 +905,94 @@
  3%22);%0A%09%7D
+%0A%09%0A%09@Test%0A%09public void masqueradeAsRealJUnitTest() %7B%0A%09%09Assert.assertTrue(true);%0A%09%7D
 %0A%0A%7D%0A

add a no-op test so JUnit is happy. This test must be run as an application, not a junit test. re-routing System.out in order to test System.out seems silly.