commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r895714 - /commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestManual.java
Date Mon, 04 Jan 2010 17:29:02 GMT
Author: sebb
Date: Mon Jan  4 17:28:59 2010
New Revision: 895714

URL: http://svn.apache.org/viewvc?rev=895714&view=rev
Log:
Suppress unnecessary stack trace output
Avoid deprecation warnings

Modified:
    commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestManual.java

Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestManual.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestManual.java?rev=895714&r1=895713&r2=895714&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestManual.java (original)
+++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestManual.java Mon Jan  4
17:28:59 2010
@@ -17,6 +17,7 @@
 
 package org.apache.commons.dbcp;
 
+import java.io.ByteArrayOutputStream;
 import java.io.PrintStream;
 import java.io.PrintWriter;
 import java.sql.Connection;
@@ -177,9 +178,11 @@
         assertTrue(conn.isClosed());
     }
 
+    @SuppressWarnings("deprecation") // SQLNestedException
     public void testLogWriter() throws Exception {
-        PrintStream ps = System.out;
-        PrintWriter pw = new PrintWriter(System.err);
+        PrintStream ps = new PrintStream(new ByteArrayOutputStream());
+        PrintWriter pw = new PrintWriter(new ByteArrayOutputStream());
+        System.setErr(new PrintStream(new ByteArrayOutputStream()));
         SQLException ex;
         
         DriverManager.setLogWriter(pw);



Mime
View raw message