Skip to content

Instantly share code, notes, and snippets.

@adamretter
Created November 4, 2014 22:55
Show Gist options
  • Save adamretter/b7bff200a29d6753f0b9 to your computer and use it in GitHub Desktop.
Save adamretter/b7bff200a29d6753f0b9 to your computer and use it in GitHub Desktop.
JUnitRunner with output to the console
package org.rocksdb.test;
import org.junit.runner.JUnitCore;
import org.junit.runner.Result;
import org.junit.internal.JUnitSystem;
import org.junit.internal.RealSystem;
import org.junit.internal.TextListener;
public class JUnitConsoleRunner {
public final static void main(final String args[]) {
public static void main(String... args) {
final JUnitCore junit = new JUnitCore();
final JUnitSystem system = new RealSystem();
junit.addListener(new TextListener(system));
final Result result = junit.runMain(system, args);
System.exit(result.wasSuccessful() ? 0 : 1);
}
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment