aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com
diff options
context:
space:
mode:
authorGravatar ruperts <ruperts@google.com>2017-09-22 02:20:27 +0200
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2017-09-22 12:16:04 +0200
commit70d018bb64f2192d82d08990ffd369733c83e9aa (patch)
treee1a6fed04dccafd4edfd5afa06931a6ec9eb3f01 /src/test/java/com
parent54c86b4c6f29f4b0d52e1db702d30c10f3ac8b56 (diff)
Use fail() in tests to catch missing expected exceptions.
RELNOTES: None. PiperOrigin-RevId: 169624979
Diffstat (limited to 'src/test/java/com')
-rw-r--r--src/test/java/com/google/devtools/build/lib/exec/AbstractSpawnStrategyTest.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/exec/AbstractSpawnStrategyTest.java b/src/test/java/com/google/devtools/build/lib/exec/AbstractSpawnStrategyTest.java
index 10ca68d638..b72e9125bd 100644
--- a/src/test/java/com/google/devtools/build/lib/exec/AbstractSpawnStrategyTest.java
+++ b/src/test/java/com/google/devtools/build/lib/exec/AbstractSpawnStrategyTest.java
@@ -14,6 +14,7 @@
package com.google.devtools.build.lib.exec;
import static com.google.common.truth.Truth.assertThat;
+import static org.junit.Assert.fail;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.mock;
@@ -83,6 +84,7 @@ public class AbstractSpawnStrategyTest {
try {
new TestedSpawnStrategy(spawnRunner).exec(SIMPLE_SPAWN, actionExecutionContext);
+ fail("Expected SpawnExecException");
} catch (SpawnExecException e) {
assertThat(e.getSpawnResult()).isSameAs(result);
}
@@ -139,6 +141,7 @@ public class AbstractSpawnStrategyTest {
try {
new TestedSpawnStrategy(spawnRunner).exec(SIMPLE_SPAWN, actionExecutionContext);
+ fail("Expected SpawnExecException");
} catch (SpawnExecException e) {
assertThat(e.getSpawnResult()).isSameAs(result);
}