[slf4j-dev] svn commit: r1173 - slf4j/trunk/slf4j-simple/src/test/java/org/slf4j

ceki at slf4j.org ceki at slf4j.org
Thu Oct 2 23:31:24 CEST 2008


Author: ceki
Date: Thu Oct  2 23:31:23 2008
New Revision: 1173

Added:
   slf4j/trunk/slf4j-simple/src/test/java/org/slf4j/SilentPrintStream.java
Modified:
   slf4j/trunk/slf4j-simple/src/test/java/org/slf4j/InvocationTest.java

Log:
keep slfj-simple tests silent as well...

Modified: slf4j/trunk/slf4j-simple/src/test/java/org/slf4j/InvocationTest.java
==============================================================================
--- slf4j/trunk/slf4j-simple/src/test/java/org/slf4j/InvocationTest.java	(original)
+++ slf4j/trunk/slf4j-simple/src/test/java/org/slf4j/InvocationTest.java	Thu Oct  2 23:31:23 2008
@@ -32,6 +32,8 @@
 
 package org.slf4j;
 
+import java.io.PrintStream;
+
 import junit.framework.TestCase;
 
 
@@ -43,16 +45,20 @@
  */
 public class InvocationTest extends TestCase {
 
+  PrintStream old = System.err;
+  
   public InvocationTest (String arg0) {
     super(arg0);
   }
 
   protected void setUp() throws Exception {
     super.setUp();
+    System.setErr(new SilentPrintStream(old));
   }
 
   protected void tearDown() throws Exception {
     super.tearDown();
+    System.setErr(old);
   }
   
   public void test1() {

Added: slf4j/trunk/slf4j-simple/src/test/java/org/slf4j/SilentPrintStream.java
==============================================================================
--- (empty file)
+++ slf4j/trunk/slf4j-simple/src/test/java/org/slf4j/SilentPrintStream.java	Thu Oct  2 23:31:23 2008
@@ -0,0 +1,22 @@
+package org.slf4j;
+
+import java.io.PrintStream;
+
+public class SilentPrintStream extends PrintStream {
+
+  PrintStream other;
+
+  public SilentPrintStream(PrintStream ps) {
+    super(ps);
+    other = ps;
+  }
+
+  public void print(String s) {
+  }
+
+  public void println(String s) {
+  }
+  
+  public void println(Object x) {
+  }
+}



More information about the slf4j-dev mailing list