コード例 #1
0
 @Test(expected = NullPointerException.class)
 public void testInvokingNotExistentTimer() throws Throwable {
   try {
     helper.invokeTimerFor(TestAggregator.class, "blkjhsdgfksdyufgks");
   } catch (RuntimeException e) {
     assertThat(e.getClass().getName(), is(RuntimeException.class.getName()));
     throw e.getCause();
   }
 }
コード例 #2
0
 @Test(expected = NullPointerException.class)
 public void testInvokingTimerWithNullMethodName() throws Throwable {
   try {
     helper.invokeTimerFor(TestAggregator.class, null);
   } catch (RuntimeException e) {
     assertThat(e.getClass().getName(), is(RuntimeException.class.getName()));
     throw e.getCause();
   }
 }
コード例 #3
0
  @Test
  public void testInvokingSetFlagTimerOnly() {
    helper.invokeTimerFor(TestAggregator.class, "setFlag");

    verifyResetStateCalled(0);
    verifySetFlagCalled(1);
    assertMessage(notNullValue());
    assertFlag(true);
  }