I think that these problems arise from the fact that ScriptTestCase.runTest calls
ij.runScript, which in turn calls utilMain.goScript, and these are not the "normal"
ij invocation methods, but rather are slightly special and don't do quite the
Since ij.runScript calls utilMain.goScript, rather than utilMain.go, we don't
ever process the ij.showNoConnectionsAtStart logic, because the code to
show the connections at start is in utilMain.go, and isn't being executed.
Similar to (1), ij.showNoCountForSelect is handled by utilMain.go, and so
it isn't being executed, either.
ScriptTestCase passes a newly-created connection through to utilMain.goScript,
and it gets set to be the current connection, which does indeed affect the
expected result. I had some limited success with fixing this by making the
following change to utilMain.goScript; the idea is that if there is already a current
session when goScript() is called, it should preserve that current session
instead of using the connection passed to it from the caller.
— utilMain.java (revision 1145422)
+++ utilMain.java (working copy)
@@ -273,7 +273,10 @@
JDBCDisplayUtil.showSelectCount = false;
+ Session curSess = connEnv.getSession();
connEnv.addSession(conn, (String) null);
+ if( curSess != null )
+ connEnv.setCurrentSession( curSess.name );
fileInput = initialFileInput = !in.isStandardInput();
I guess the bottom line here is that 'ij5.sql' is testing certain
features of utilMain.go(), and therefore it is hard to test these
through ScriptTestCase because it uses runScript/goScript
rather than go().