butek       02/02/28 12:05:14

  Added:       java/test/wsdl/interop3 test.properties
                        Interop3TestCase.java
  Log:
  This test case takes a properties file.  The keys are test names, the values
  are the URL that test should run against.
  
  Revision  Changes    Path
  1.1                  xml-axis/java/test/wsdl/interop3/test.properties
  
  Index: test.properties
  ===================================================================
  
test.wsdl.interop3.import1.Import1TestCase=http\://mssoapinterop.org/stkv3/wsdl/import1.wsdl
  
  
  1.1                  xml-axis/java/test/wsdl/interop3/Interop3TestCase.java
  
  Index: Interop3TestCase.java
  ===================================================================
  package test.wsdl.interop3;
  
  import java.io.FileInputStream;
  
  import java.lang.reflect.Field;
  
  import java.net.URL;
  
  import java.util.Iterator;
  import java.util.Properties;
  
  import junit.framework.TestCase;
  import junit.framework.TestSuite;
  
  import junit.textui.TestRunner;
  
  public class Interop3TestCase {
  
      public static void usage() {
          System.out.println("java test.wsdl.interop3.Interop3TestCase <URL property 
file>");
      } // usage
  
      public static void main(String[] args) {
          try {
              if (args.length != 1) {
                  usage();
                  System.exit(0);
              }
              Properties props = new Properties();
              props.load(new FileInputStream(args[0]));
              Iterator it = props.keySet().iterator();
              while (it.hasNext()) {
                  String key = (String) it.next();
                  URL value = new URL((String) props.get(key));
                  try {
                      Class test = Class.forName(key);
                      Field urlField = test.getField("url");
                      urlField.set(null, value);
                      TestRunner.run(new TestSuite(test));                    
                  }
                  catch (Throwable t) {
                      System.err.println("Failure running " + key);
                      t.printStackTrace();
                  }
              }
          }
          catch (Throwable t) {
          }
      } // main
  } // class Interop3TestCase
  
  
  
  


Reply via email to