Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add JUnitSystem.exit() back #989

Merged
merged 1 commit into from
Sep 12, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/main/java/org/junit/internal/JUnitSystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,12 @@
import java.io.PrintStream;

public interface JUnitSystem {

/**
* Will be removed in the next major release
*/
@Deprecated
void exit(int code);

PrintStream out();
}
9 changes: 9 additions & 0 deletions src/main/java/org/junit/internal/RealSystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
import java.io.PrintStream;

public class RealSystem implements JUnitSystem {

/**
* Will be removed in the next major release
*/
@Deprecated
public void exit(int code) {
System.exit(code);
}

public PrintStream out() {
return System.out;
}
Expand Down
9 changes: 9 additions & 0 deletions src/test/java/org/junit/tests/TestSystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,22 @@

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

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

/**
* Will be removed in the next major release
*/
@Deprecated
public void exit(int code) {
fCode = code;
}

public PrintStream out() {
return out;
}
Expand Down