Show exceptions after network stress test run as main class

This commit is contained in:
Ivan Vilata-i-Balaguer 2016-05-11 18:25:47 +02:00
parent 0fc8a1b5c0
commit c4bb180dbf

View File

@ -26,6 +26,7 @@ import org.junit.Test;
import org.junit.runner.JUnitCore;
import org.junit.runner.Request;
import org.junit.runner.Result;
import org.junit.runner.notification.Failure;
import java.io.File;
import java.io.IOException;
@ -93,6 +94,8 @@ public class NetworkStressTest {
: Request.method(NetworkStressTest.class, args[0]);
Result result = new JUnitCore().run(request);
for (Failure f : result.getFailures())
System.err.printf("\n%s\n%s", f, f.getTrace());
System.exit(result.wasSuccessful() ? 0 : 1);
}