karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject karaf git commit: [KARAF-4681]System.setOut(null) in GrepTest cause other tests failure which need use System.out
Date Tue, 30 Aug 2016 03:46:20 GMT
Repository: karaf
Updated Branches:
  refs/heads/master bbe4b14df -> 82fd5bf32


[KARAF-4681]System.setOut(null) in GrepTest cause other tests failure which need use System.out


Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/82fd5bf3
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/82fd5bf3
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/82fd5bf3

Branch: refs/heads/master
Commit: 82fd5bf32b3c97a029ab9ad493d6ae5426491fb9
Parents: bbe4b14
Author: Freeman Fang <freeman.fang@gmail.com>
Authored: Tue Aug 30 11:46:07 2016 +0800
Committer: Freeman Fang <freeman.fang@gmail.com>
Committed: Tue Aug 30 11:46:07 2016 +0800

----------------------------------------------------------------------
 .../test/java/org/apache/karaf/shell/commands/impl/GrepTest.java  | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/82fd5bf3/shell/commands/src/test/java/org/apache/karaf/shell/commands/impl/GrepTest.java
----------------------------------------------------------------------
diff --git a/shell/commands/src/test/java/org/apache/karaf/shell/commands/impl/GrepTest.java
b/shell/commands/src/test/java/org/apache/karaf/shell/commands/impl/GrepTest.java
index 877b2b8..10dbe51 100644
--- a/shell/commands/src/test/java/org/apache/karaf/shell/commands/impl/GrepTest.java
+++ b/shell/commands/src/test/java/org/apache/karaf/shell/commands/impl/GrepTest.java
@@ -46,6 +46,7 @@ public class GrepTest extends TestCase {
 
     public void testHonorColorNever() throws Exception {
         InputStream input = System.in;
+        PrintStream output = System.out;
         try {
             ByteArrayInputStream bais = new ByteArrayInputStream("abc".getBytes());
             System.setIn(bais);
@@ -59,7 +60,7 @@ public class GrepTest extends TestCase {
             assertEquals("abc", outContent.toString().trim());
         } finally {
             System.setIn(input);
-            System.setOut(null);
+            System.setOut(output);
         }
     }
 }


Mime
View raw message