* Arguments are of the form:
* -h localhost -p 8080 -s /soap/servlet/rpcrouter
* -h indicats the host
*/
public static void main(String args[]) throws Exception {
Options opts = new Options(args);
boolean testPerformance = opts.isFlagSet('k') > 0;
boolean allTests = opts.isFlagSet('A') > 0;
boolean onlyB = opts.isFlagSet('b') > 0;
boolean testMode = opts.isFlagSet('t') > 0;
// set up tests so that the results are sent to System.out
TestClient client;
if (testPerformance) {
client = new TestClient(testMode) {
public void verify(String method, Object sent, Object gotBack) {
}
};
} else {
client = new TestClient(testMode) {
public void verify(String method, Object sent, Object gotBack) {
String message;
if (this.equals(sent, gotBack)) {
message = "OK";
} else {
if (gotBack instanceof Exception) {
if (gotBack instanceof AxisFault) {
message = "Fault: " +
((AxisFault)gotBack).getFaultString();
} else {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
message = "Exception: ";
((Exception)gotBack).printStackTrace(pw);
message += sw.getBuffer().toString();
}
} else {
message = "Fail:" + gotBack + " expected " + sent;
}
}
// Line up the output
String tab = "";
int l = method.length();
while (l < 25) {
tab += " ";
l++;
}
System.out.println(method + tab + " " + message);
}
};
}
// set up the call object
client.setURL(opts.getURL());
if (testPerformance) {
long startTime = System.currentTimeMillis();
for (int i = 0; i < 10; i++) {
if (allTests) {