I've been looking at the last remaining test master/canon - testclientij.out - that shows the version number.
It looks like this test was explicitly intended as a .sql test to test DerbyNetClient connection strings, so converting to a .java junit test does not seem appropriate.
The difference between other tests executing .sql files (e.g. NistScripts, LangScripts, ToolScripts) is that this one emulates the old harness' RunTest mechanism of using ij.main("-fr", "filename") (by extending util.IjTestCase), whereas the other tests use ij.runScript(..).
-fr is possibly intended to be a undocumented feature, at least, I could find no documentation, even the ij javadoc is very quiet about it, and if you use it incorrectly, (e.g. : java org.apache.derby.tools.ij testclientij.sql) you get an NPE rather than an appropriate message.
I gather it's supposed to list the file in it's full resource path - e.g.: java org.apache.derby.tools.ij /testclientij.sql (if . is in your classpath and the file sits in the current dir).
Apparently, and per the code, running main vs runScript results in some slight differences:
- no version number printed
- first connection is already started
- no messages indicating number of rows selected
These differences do not seem relevant to this particular test.
I think the util.IjTestCase mechanism may possibly be of use in testing ij in the future, but at present, in NetIjTest, it appears to be just another way of doing the same thing as e.g. NistScripts, a way that has the unfortunate effect of printing the version number.
We could consider adding the script to the tools directory/_Suite...But I think it is more appropriate in its current spot. Thus, I intend to rewrite NetIjTest to use the same mechanism as NistScripts. When this is done, I intend to get rid of the master-editing target in tools/release/build.xml.
I'll leave IjTestCase in place for future use. If used, it would need a different compareCanon method in CanonTestCase, one that ignores lines with specified strings (or maybe specifically checks on the version number without it being in the canon).