[Android-interop-test] Fail the instrumentation if any exception is thrown during the channel initialization.

This commit is contained in:
Xudong Ma 2015-12-02 11:37:30 -08:00
parent ee56c4940d
commit 944edc4601
1 changed files with 23 additions and 16 deletions

View File

@ -40,6 +40,7 @@ import android.os.Bundle;
import android.util.Log; import android.util.Log;
import java.io.InputStream; import java.io.InputStream;
import java.lang.Throwable;
/** /**
@ -87,6 +88,7 @@ public class TesterInstrumentation extends Instrumentation {
} }
} }
try {
new InteropTester(testCase, host, port, serverHostOverride, useTls, testCa, new InteropTester(testCase, host, port, serverHostOverride, useTls, testCa,
androidSocketFactoryTls, androidSocketFactoryTls,
new InteropTester.TestListener() { new InteropTester.TestListener() {
@ -106,5 +108,10 @@ public class TesterInstrumentation extends Instrumentation {
} }
} }
).execute(); ).execute();
} catch (Throwable t) {
Bundle bundle = new Bundle();
bundle.putString("Exception encountered", t.toString());
finish(1, bundle);
}
} }
} }