1 package net.sf.twip.internal; 2 3 import java.lang.reflect.Method; 4 5 import org.junit.runners.model.FrameworkMethod; 6 7 /** 8 * A dummy {@link FrameworkMethod} that just throws an exception on 9 * {@link FrameworkMethod#invokeExplosively(Object, Object...)} 10 */ 11 public class FailedFrameworkMethod extends FrameworkMethod { 12 13 private final Throwable throwable; 14 15 public FailedFrameworkMethod(Method method, Throwable throwable) { 16 super(method); 17 this.throwable = throwable; 18 } 19 20 @Override 21 public Object invokeExplosively(Object target, Object... params) throws Throwable { 22 throw throwable; 23 } 24 }