Changeset 670 for trunk


Ignore:
Timestamp:
08/28/12 14:18:52 (12 years ago)
Author:
sherbold
Message:
  • TextConsoleTest? now correctly resets System.out (fixes failed test case for CMDlistCommands)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/java-utils-test/src/test/java/de/ugoe/cs/util/console/TextConsoleTest.java

    r636 r670  
    1818 
    1919        private final static String ENDLINE = System.getProperty("line.separator"); 
     20         
     21        private PrintStream sysOut = null; 
     22        private PrintStream sysErr = null; 
    2023 
    2124        private final ByteArrayOutputStream outContent = new ByteArrayOutputStream(); 
     
    106109        @Before 
    107110        public void setUp() throws Exception { 
     111            sysOut = new PrintStream(System.out); 
     112            sysErr = new PrintStream(System.err); 
    108113                System.setOut(new PrintStream(outContent)); 
    109114                System.setErr(new PrintStream(errContent)); 
     
    112117        @After 
    113118        public void tearDown() throws Exception { 
    114                 System.setOut(null); 
    115                 System.setErr(null); 
     119                System.setOut(sysOut); 
     120                System.setErr(sysErr); 
    116121        } 
    117122 
Note: See TracChangeset for help on using the changeset viewer.