1 package test.wsdl.interop3; 2 3 import junit.framework.TestSuite; 4 import junit.textui.TestRunner; 5 import org.apache.axis.utils.ClassUtils; 6 7 import java.io.FileInputStream ; 8 import java.lang.reflect.Field ; 9 import java.net.URL ; 10 import java.util.Iterator ; 11 import java.util.Properties ; 12 13 public class Interop3TestCase { 14 15 public static void usage() { 16 System.out.println("java test.wsdl.interop3.Interop3TestCase <URL property file>"); 17 } 19 public static void main(String [] args) { 20 try { 21 if (args.length != 1) { 22 usage(); 23 System.exit(0); 24 } 25 Properties props = new Properties (); 26 props.load(new FileInputStream (args[0])); 27 Iterator it = props.keySet().iterator(); 28 while (it.hasNext()) { 29 String key = (String ) it.next(); 30 URL value = new URL ((String ) props.get(key)); 31 try { 32 Class test = ClassUtils.forName(key); 33 Field urlField = test.getField("url"); 34 urlField.set(null, value); 35 TestRunner.run(new TestSuite(test)); 36 } 37 catch (Throwable t) { 38 System.err.println("Failure running " + key); 39 t.printStackTrace(); 40 } 41 } 42 } 43 catch (Throwable t) { 44 } 45 } } 48 | Popular Tags |