Beispiel #1
0
 @Test
 public void isCancelledReturnsTrueIffCancelled() {
   assertThat(cut.isCancelled(), is(false));
   cut.setCancelled();
   assertThat(cut.isCancelled(), is(true));
 }
Beispiel #2
0
 @Test
 public void setIsDoneReturnsFalseIfCancelled() {
   cut.setCancelled();
   assertThat(cut.isDone(), is(false));
 }
Beispiel #3
0
 @Test(expected = CancellationException.class)
 public void setCancelledLeadsToCancelledException()
     throws CancellationException, InterruptedException, ExecutionException {
   cut.setCancelled();
   cut.get();
 }