File tree Expand file tree Collapse file tree
src/test/java/de/doubleslash/kata/designpattern/factory Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33import org .apache .commons .io .output .TeeOutputStream ;
44import org .hamcrest .CoreMatchers ;
5+ import org .junit .After ;
56import org .junit .Before ;
67import org .junit .Test ;
78
@@ -23,15 +24,22 @@ public class LoggerFactoryTest {
2324
2425 private ByteArrayOutputStream baos ;
2526
27+ private PrintStream originalSystemOut ;
28+
2629 @ Before
2730 public void setUp () throws Exception {
2831 // Ausgaben nach System.out in einen ByteArrayOutputStream kopieren, damit die Ausgaben später ausgewertet
2932 // werden können
3033 baos = new ByteArrayOutputStream ();
31- PrintStream originalSystemOut = System .out ;
34+ originalSystemOut = System .out ;
3235 System .setOut (new PrintStream (new TeeOutputStream (originalSystemOut , baos )));
3336 }
3437
38+ @ After
39+ public void tearDown () throws Exception {
40+ System .setOut (originalSystemOut );
41+ }
42+
3543 /**
3644 * Damit dieser Test erfolgreich ist, muss die LoggerFactory ein Objekt zurückliefern, das nicht null ist und das
3745 * Logger-Interface implementiert.
You can’t perform that action at this time.
0 commit comments