summaryrefslogtreecommitdiffstats
path: root/junit4/src/test/java/org/junit/tests/TestSystem.java
blob: 9271d3b88884da38c3a17ca6142f1a3ea26a8762 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package org.junit.tests;

import java.io.ByteArrayOutputStream;
import java.io.OutputStream;
import java.io.PrintStream;

import org.junit.internal.JUnitSystem;

public class TestSystem implements JUnitSystem {
	private PrintStream out;
	public int fCode;
	private ByteArrayOutputStream fOutContents;

	public TestSystem() {
		fOutContents= new ByteArrayOutputStream();
		out= new PrintStream(fOutContents);
	}

	public void exit(int code) {
		fCode= code;
	}

	public PrintStream out() {
		return out;
	}

	public OutputStream outContents() {
		return fOutContents;
	}

}