1 7 package com.inversoft.junit.internal; 8 9 10 import java.lang.reflect.InvocationTargetException ; 11 import java.lang.reflect.Method ; 12 13 import com.inversoft.junit.WebTestCase; 14 15 16 24 public class LocationCaller { 25 26 32 public void callTestMethod(WebTestCase testCase) throws Throwable { 33 34 try { 35 Class klass = testCase.getClass(); 36 Method method = klass.getMethod(testCase.getName(), new Class [0]); 37 38 method.invoke(testCase, new Object [0]); 39 } catch (InvocationTargetException ite) { 40 ite.fillInStackTrace(); 41 throw ite.getTargetException(); 42 } catch (IllegalAccessException e) { 43 e.fillInStackTrace(); 44 throw e; 45 } catch (NoSuchMethodException nsme) { 46 nsme.fillInStackTrace(); 47 throw nsme; 48 } 49 } 50 } | Popular Tags |