예제 #1
0
 private <T> T createProxy(TestLifecycleHandler h, Class<T> type) {
   Object o = Proxy.newProxyInstance(h.getClass().getClassLoader(), new Class<?>[] {type}, h);
   if (!type.isAssignableFrom(o.getClass())) {
     throw new RuntimeException(o.getClass().toString() + " vs " + type);
   }
   return (T) o;
 }
예제 #2
0
 public boolean checkHandlerHasBeenInvoked(HandlerType type, int i) {
   TestLifecycleHandler h = mapping.get(type);
   return h.wasCalled(i);
 }