java - Inconsistent dbunit behaviour between platforms with null dates using in-memory h2 -
i'm running interesting issue here dbunit test.
we have code test dbunit tests , xml dataset. have inconsistent test results same dataset , code files among platforms, decided follow trail refactoring part of db access classes.
the issue i'm running following:
- the dataset has 3 records match query defined in hbm file.
- the query "order date_field desc", not records in dataset have date_field set (meaning should interpreted null or default value scripts, identical on both platforms).
on 1 platform (linux-server) maven runs tests, ok, on pc windows, records extracted database (dataset) different order, error when test validates order of records.
so, know modifying dataset tests go green on both sides, if wrote dataset without date column in 1 of records, might have known business rule i'm not aware of, i'm not modifying scenario might cause unforseen future problems.
after searching answer, i'm modifying question. answer i'm looking for, how h2 database consistent null dates on different platforms. parameter have set nulls first or nulls last whole db without touching queries?
thank , regards.
well,
i'm answering own question found answer, better follow-up nice think gets point.
i followed instructions on page:
http://www.h2database.com/javadoc/org/h2/constant/sysproperties.html
and set sortnullshigh property on runtime, before loading driver:
system.setproperty("h2.sortnullshigh", "true");
maybe later see way config file, after central unit tests run jenkins/maven , there property set properly.
regards
Comments
Post a Comment