View Javadoc
1   package org.junit.internal.runners.model;
2   
3   import java.lang.reflect.InvocationTargetException;
4   
5   /**
6    * When invoked, throws the exception from the reflected method, rather than
7    * wrapping it in an InvocationTargetException.
8    */
9   public abstract class ReflectiveCallable {
10      public Object run() throws Throwable {
11          try {
12              return runReflectiveCall();
13          } catch (InvocationTargetException e) {
14              throw e.getTargetException();
15          }
16      }
17  
18      protected abstract Object runReflectiveCall() throws Throwable;
19  }