File: Interop3TestCase.java

package info (click to toggle)
axis 1.4-29
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 52,100 kB
  • sloc: java: 129,124; xml: 10,602; jsp: 983; sh: 84; cs: 36; makefile: 18
file content (47 lines) | stat: -rw-r--r-- 1,472 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package test.wsdl.interop3;

import junit.framework.TestSuite;
import junit.textui.TestRunner;
import org.apache.axis.utils.ClassUtils;

import java.io.FileInputStream;
import java.lang.reflect.Field;
import java.net.URL;
import java.util.Iterator;
import java.util.Properties;

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 = ClassUtils.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