1 21 22 package org.apache.derbyTesting.functionTests.harness; 23 24 import java.lang.reflect.Method ; 25 26 27 public class RunClass implements Runnable 29 { 30 31 34 public RunClass(Method methodToCall, Object args[]) 35 { 36 mainMethod = methodToCall; 37 arguments=args; 38 } 39 40 Object arguments[]; 41 Method mainMethod; 42 43 public void run() 44 { 45 synchronized (this) 46 { 47 try 48 { 49 mainMethod.invoke(null, arguments); 53 } 54 catch (IllegalAccessException iae) 55 { 56 iae.printStackTrace(); 57 System.out.println("RunClass: " + iae + " make sure the test class is public."); 58 System.exit(1); 59 } 60 catch (Exception e) 61 { 62 System.out.println("RunClass --> " + e); 63 e.printStackTrace(); 64 } 65 } 66 } 67 } 68 | Popular Tags |