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