Running mvn test -Dtest=TestDBLoadDump#testImportInvalidDataLeavesTablesEmpty results in a test failure:
TestDBLoadDump.testImportInvalidDataLeavesTablesEmpty tests that processing an invalid dump file results in transactions are rolled back and tables are left unpopulated (empty).
tools/src/test/resources/dumpData/invalid/ooziedb_ac.json contains an executionPath that consists of more than 1024 characters (2000).
OozieDBImportCLI.importOneInputFileToOneEntityTable deserialize the WorkflowActionBean object from the JSON using final E newEntity = gson.fromJson(line, entityClass); . However, persisting this object should fail even because invariants (see @Column(name = "execution_path", length = 1024) in WorkflowActionBean) do not hold.
In the setup method of TestDBLoadDump, setSqlStricEnforce() is used to make sure strict size is enforced:
However it does not seem to take effect. HSQL db's documentation says:
Management of properties has changed since version 1.8. The old SET PROPERTY statement does not change a property and is ignored. The statement is retained to simplify application upgrades.
Running mvn dependency:tree, it turns out Oozie core uses 22.214.171.124
It is, however, strange that tests pass if running all the test cases in TestDBLoadDump with mvn test -Dmaven.surefire.debug -Dtest=TestDBLoadDump. In other words, tests are not independent of execution order.
Looking at a successfull test execution in surefire-reports (TEST-org.apache.oozie.tools.TestDBLoadDump.xml) :
We shall make sure individual tests pass. As a first step, TestDBLoadDump.testImportInvalidDataLeavesTablesEmpty is to be fixed.