Changeset: d755af8d88dc for monetdb-java
URL: https://dev.monetdb.org/hg/monetdb-java/rev/d755af8d88dc
Modified Files:
src/test/java/JUnitTester.java
Branch: mvn
Log Message:
JunitTester: fix arg parsing
- -a takes an argument but -supportsNestedTypes doesn't
- Mtest often passes an additional empty argument, ignore that
diffs (39 lines):
diff --git a/src/test/java/JUnitTester.java b/src/test/java/JUnitTester.java
--- a/src/test/java/JUnitTester.java
+++ b/src/test/java/JUnitTester.java
@@ -24,21 +24,28 @@ public abstract class JUnitTester {
String value = null;
boolean verbose = false;
+ System.err.println("# Invoked with " + args.length + " args");
+ for (int i = 0; i < args.length; i++)
+ System.err.println("# - " + args[i]);
+
for (int i = 0; i < args.length; i++) {
String arg = args[i];
if (arg.equals("-v"))
verbose = true;
else if (arg.equals("-a"))
- i++ /* sometimes passed to TLSTester, ignore */;
- else if (arg.equals("-supportsNestedTypes"))
- i++ /* sometimes passed to JDBC_API_Tester,
ignore */;
- else if (arg.startsWith("-")) {
+ i++ /* sometimes passed to TLSTester, ignore
following argument */;
+ else if (arg.equals("-supportsNestedTypes")) {
+ /* sometimes passed to JDBC_API_Tester,
autodetected now, ignore it */;
+ } else if (arg.startsWith("-")) {
System.err.println("Invalid flag " + arg);
exit(1);
- } else if (value != null) {
+ } else if (value == null) {
+ value = arg; /* positional argument to be
assigned to the property */
+ } else if (arg.isEmpty()) {
+ /* Mtest sometimes passes an empty, unnecessary
argument. just ignore it */
+ } else {
System.err.println("Duplicate value: " + arg +
". Already have " + value);
- } else {
- value = arg;
+ System.exit(1);
}
}
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]