public class InstallUncaughtExceptionHandlerListener
extends org.junit.runner.notification.RunListener
RunListener
used to install an aggressive default Thread.UncaughtExceptionHandler
similar to the one found on Android. No exceptions
should escape from OkHttp that might cause apps to be killed or tests to fail on Android.Modifier and Type | Field and Description |
---|---|
private org.junit.runner.Description |
lastTestStarted |
private java.lang.Thread.UncaughtExceptionHandler |
oldDefaultUncaughtExceptionHandler |
Constructor and Description |
---|
InstallUncaughtExceptionHandlerListener() |
Modifier and Type | Method and Description |
---|---|
void |
testRunFinished(org.junit.runner.Result result) |
void |
testRunStarted(org.junit.runner.Description description) |
void |
testStarted(org.junit.runner.Description description) |
private java.lang.Thread.UncaughtExceptionHandler oldDefaultUncaughtExceptionHandler
private org.junit.runner.Description lastTestStarted
public InstallUncaughtExceptionHandlerListener()
public void testRunStarted(org.junit.runner.Description description) throws java.lang.Exception
testRunStarted
in class org.junit.runner.notification.RunListener
java.lang.Exception
public void testStarted(org.junit.runner.Description description) throws java.lang.Exception
testStarted
in class org.junit.runner.notification.RunListener
java.lang.Exception
public void testRunFinished(org.junit.runner.Result result) throws java.lang.Exception
testRunFinished
in class org.junit.runner.notification.RunListener
java.lang.Exception