From 630c5b8820662cba8fc1380fc32f989e0c9d6c66 Mon Sep 17 00:00:00 2001 From: "A. Unique TensorFlower" Date: Wed, 25 Mar 2020 16:22:51 -0700 Subject: [PATCH] Remove usage of `@Test(expected = ...)` in ZerosTest. PiperOrigin-RevId: 302995001 Change-Id: Ide4358742b784131a3b22a21db399760493ad287 --- .../src/test/java/org/tensorflow/op/core/ZerosTest.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tensorflow/java/src/test/java/org/tensorflow/op/core/ZerosTest.java b/tensorflow/java/src/test/java/org/tensorflow/op/core/ZerosTest.java index cf3910b594f..7fd68a0f720 100644 --- a/tensorflow/java/src/test/java/org/tensorflow/op/core/ZerosTest.java +++ b/tensorflow/java/src/test/java/org/tensorflow/op/core/ZerosTest.java @@ -17,6 +17,7 @@ package org.tensorflow.op.core; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; +import static org.junit.Assert.fail; import java.util.List; @@ -142,14 +143,15 @@ public class ZerosTest { } } - @Test(expected = IllegalArgumentException.class) + @Test public void cannotCreateStringZeros() { try (Graph g = new Graph(); Session sess = new Session(g)) { Scope scope = new Scope(g); long[] shape = {2, 2}; Zeros.create(scope, Constant.create(scope, shape), String.class); - } + fail(); + } catch (IllegalArgumentException expected) {} } @Test