diff options
Diffstat (limited to 'tests/harness/ajctest/Driver.java')
-rw-r--r-- | tests/harness/ajctest/Driver.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/harness/ajctest/Driver.java b/tests/harness/ajctest/Driver.java new file mode 100644 index 000000000..dca23a717 --- /dev/null +++ b/tests/harness/ajctest/Driver.java @@ -0,0 +1,21 @@ + + +/** Drive normal, system.exit, error or exception result from main */ +public class Driver { + + /** + * @param args {[-exit <number>|[-error|-exception] <string>]} + */ + public static void main (String[] args) throws Exception { + for (int i = 0; i < args.length; i++) { + String arg = args[i]; + if ("-exit".equals(arg)) { + System.exit(Integer.valueOf(args[i+1]).intValue()); + } else if ("-error".equals(arg)) { + throw new Error(args[i+1]); + } else if ("-exception".equals(arg)) { + throw new RuntimeException(args[i+1]); + } + } + } +} |