Repository: karaf
Updated Branches:
  refs/heads/karaf-4.0.x 130caa858 -> 68485200a


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

(cherry picked from commit 82fd5bf32b3c97a029ab9ad493d6ae5426491fb9)


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

Branch: refs/heads/karaf-4.0.x
Commit: 68485200aff3b06f3a269ea2e7e53253402fda75
Parents: 130caa8
Author: Freeman Fang <[email protected]>
Authored: Tue Aug 30 11:46:07 2016 +0800
Committer: Freeman Fang <[email protected]>
Committed: Tue Aug 30 11:49:16 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/68485200/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);
         }
     }
 }

Reply via email to