aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib/shell/InterruptibleTest.java
diff options
context:
space:
mode:
authorGravatar lberki <lberki@google.com>2017-05-30 12:35:33 +0200
committerGravatar László Csomor <laszlocsomor@google.com>2017-05-30 12:51:57 +0200
commitaea56b36af994b269800602e36000c293cabd00b (patch)
tree794f6b3b2528353cc39bd383730d408d4ff25233 /src/test/java/com/google/devtools/build/lib/shell/InterruptibleTest.java
parent229f393bf460700594ae032a551879e026bd0b91 (diff)
Migrate Java tests to Truth.
RELNOTES: None. PiperOrigin-RevId: 157446717
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/shell/InterruptibleTest.java')
-rw-r--r--src/test/java/com/google/devtools/build/lib/shell/InterruptibleTest.java13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/shell/InterruptibleTest.java b/src/test/java/com/google/devtools/build/lib/shell/InterruptibleTest.java
index 6ef9915843..006f89113d 100644
--- a/src/test/java/com/google/devtools/build/lib/shell/InterruptibleTest.java
+++ b/src/test/java/com/google/devtools/build/lib/shell/InterruptibleTest.java
@@ -13,8 +13,7 @@
// limitations under the License.
package com.google.devtools.build.lib.shell;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static com.google.common.truth.Truth.assertWithMessage;
import org.junit.After;
import org.junit.Before;
@@ -56,7 +55,7 @@ public class InterruptibleTest {
@Before
public final void startInterrupter() throws Exception {
Thread.interrupted(); // side effect: clear interrupted status
- assertFalse("Unexpected interruption!", mainThread.isInterrupted());
+ assertWithMessage("Unexpected interruption!").that(mainThread.isInterrupted()).isFalse();
// We interrupt after 1 sec, so this gives us plenty of time for the library to notice the
// subprocess exit.
@@ -81,11 +80,11 @@ public class InterruptibleTest {
command.execute();
// The interrupter thread should have exited about 1000ms ago.
- assertFalse("Interrupter thread is still alive!",
- interrupter.isAlive());
+ assertWithMessage("Interrupter thread is still alive!").that(interrupter.isAlive()).isFalse();
// The interrupter thread should have set the main thread's interrupt flag.
- assertTrue("Main thread was not interrupted during command execution!",
- mainThread.isInterrupted());
+ assertWithMessage("Main thread was not interrupted during command execution!")
+ .that(mainThread.isInterrupted())
+ .isTrue();
}
}