From 40d9cd1941cc25c210f100f38039008ad728e8f2 Mon Sep 17 00:00:00 2001 From: Carl Mastrangelo Date: Thu, 3 Mar 2016 11:28:04 -0800 Subject: [PATCH] Add more debug output in TlsTest --- .../java/io/grpc/testing/integration/TlsTest.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/interop-testing/src/test/java/io/grpc/testing/integration/TlsTest.java b/interop-testing/src/test/java/io/grpc/testing/integration/TlsTest.java index 4549cfae7c..dd8e75c3f0 100644 --- a/interop-testing/src/test/java/io/grpc/testing/integration/TlsTest.java +++ b/interop-testing/src/test/java/io/grpc/testing/integration/TlsTest.java @@ -34,6 +34,7 @@ package io.grpc.testing.integration; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; +import com.google.common.base.Throwables; import com.google.common.util.concurrent.MoreExecutors; import com.google.protobuf.EmptyProtos.Empty; @@ -76,6 +77,7 @@ import java.util.concurrent.TimeUnit; */ @RunWith(Parameterized.class) public class TlsTest { + /** * Iterable of various configurations to use for tests. */ @@ -192,7 +194,9 @@ public class TlsTest { // GRPC reports this situation by throwing a StatusRuntimeException that wraps either a // javax.net.ssl.SSLHandshakeException or a java.nio.channels.ClosedChannelException. // Thus, reliably detecting the underlying cause is not feasible. - assertEquals(Status.Code.UNAVAILABLE, e.getStatus().getCode()); + assertEquals( + Throwables.getStackTraceAsString(e), + Status.Code.UNAVAILABLE, e.getStatus().getCode()); } } @@ -232,7 +236,9 @@ public class TlsTest { // GRPC reports this situation by throwing a StatusRuntimeException that wraps either a // javax.net.ssl.SSLHandshakeException or a java.nio.channels.ClosedChannelException. // Thus, reliably detecting the underlying cause is not feasible. - assertEquals(Status.Code.UNAVAILABLE, e.getStatus().getCode()); + assertEquals( + Throwables.getStackTraceAsString(e), + Status.Code.UNAVAILABLE, e.getStatus().getCode()); } } @@ -275,7 +281,10 @@ public class TlsTest { // GRPC reports this situation by throwing a StatusRuntimeException that wraps either a // javax.net.ssl.SSLHandshakeException or a java.nio.channels.ClosedChannelException. // Thus, reliably detecting the underlying cause is not feasible. - assertEquals(Status.Code.UNAVAILABLE, e.getStatus().getCode()); + // TODO(carl-mastrangelo): eventually replace this with a hamcrest matcher. + assertEquals( + Throwables.getStackTraceAsString(e), + Status.Code.UNAVAILABLE, e.getStatus().getCode()); } }