View Javadoc
1   package org.junit.tests;
2   
3   import java.io.ByteArrayOutputStream;
4   import java.io.OutputStream;
5   import java.io.PrintStream;
6   
7   import org.junit.internal.JUnitSystem;
8   
9   public class TestSystem implements JUnitSystem {
10      private PrintStream out;
11      public int fCode;
12      private ByteArrayOutputStream fOutContents;
13  
14      public TestSystem() {
15          fOutContents = new ByteArrayOutputStream();
16          out = new PrintStream(fOutContents);
17      }
18  
19      /**
20       * Will be removed in the next major release
21       */
22      @Deprecated
23      public void exit(int code) {
24          fCode = code;
25      }
26  
27      public PrintStream out() {
28          return out;
29      }
30  
31      public OutputStream outContents() {
32          return fOutContents;
33      }
34  
35  }