You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@oozie.apache.org by as...@apache.org on 2017/11/14 10:12:51 UTC
oozie git commit: OOZIE-3125
TestDBLoadDump.testImportInvalidDataLeavesTablesEmpty fails (asasvari)
Repository: oozie
Updated Branches:
refs/heads/master 4ea8a237e -> 567ce9fd2
OOZIE-3125 TestDBLoadDump.testImportInvalidDataLeavesTablesEmpty fails (asasvari)
Project: http://git-wip-us.apache.org/repos/asf/oozie/repo
Commit: http://git-wip-us.apache.org/repos/asf/oozie/commit/567ce9fd
Tree: http://git-wip-us.apache.org/repos/asf/oozie/tree/567ce9fd
Diff: http://git-wip-us.apache.org/repos/asf/oozie/diff/567ce9fd
Branch: refs/heads/master
Commit: 567ce9fd2aa1da2da24f7941b218e1ef1ae0f09b
Parents: 4ea8a23
Author: Attila Sasvari <as...@cloudera.com>
Authored: Tue Nov 14 11:11:04 2017 +0100
Committer: Attila Sasvari <as...@cloudera.com>
Committed: Tue Nov 14 11:11:04 2017 +0100
----------------------------------------------------------------------
core/src/test/resources/hsqldb-oozie-site.xml | 7 ++++++-
release-log.txt | 1 +
.../org/apache/oozie/tools/TestDBLoadDump.java | 21 --------------------
3 files changed, 7 insertions(+), 22 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/oozie/blob/567ce9fd/core/src/test/resources/hsqldb-oozie-site.xml
----------------------------------------------------------------------
diff --git a/core/src/test/resources/hsqldb-oozie-site.xml b/core/src/test/resources/hsqldb-oozie-site.xml
index fa5fe9c..833083e 100644
--- a/core/src/test/resources/hsqldb-oozie-site.xml
+++ b/core/src/test/resources/hsqldb-oozie-site.xml
@@ -22,8 +22,13 @@
<name>oozie.service.JPAService.jdbc.driver</name>
<value>org.hsqldb.jdbcDriver</value>
</property>
+ <!--
+ It is required to enforce length checks for string fields while trying to persist objects with OpenJPA in tests. To this end,
+ we need to set sql.enforce_strict_size to true when creating the EntityManagerFactory object in JPAService.
+ Please see http://hsqldb.org/doc/guide/ch04.html HSQLDB docs for details.
+ -->
<property>
<name>oozie.service.JPAService.jdbc.url</name>
- <value>jdbc:hsqldb:mem:oozie-db;create=true</value>
+ <value>jdbc:hsqldb:mem:oozie-db;create=true;sql.enforce_strict_size=true</value>
</property>
</configuration>
http://git-wip-us.apache.org/repos/asf/oozie/blob/567ce9fd/release-log.txt
----------------------------------------------------------------------
diff --git a/release-log.txt b/release-log.txt
index 64aec65..6a6e6d4 100644
--- a/release-log.txt
+++ b/release-log.txt
@@ -1,5 +1,6 @@
-- Oozie 5.0.0 release (trunk - unreleased)
+OOZIE-3125 TestDBLoadDump.testImportInvalidDataLeavesTablesEmpty fails (asasvari)
OOZIE-3106 upgrade surefire-plugin to 2.20.1 (dbist13 via asasvari)
OOZIE-2061 Remove CoordJobDeleteJPAExecutor (dbist13 via gezapeti)
OOZIE-2997 files contain trailing white spaces in client lib (dbist13 via gezapeti)
http://git-wip-us.apache.org/repos/asf/oozie/blob/567ce9fd/tools/src/test/java/org/apache/oozie/tools/TestDBLoadDump.java
----------------------------------------------------------------------
diff --git a/tools/src/test/java/org/apache/oozie/tools/TestDBLoadDump.java b/tools/src/test/java/org/apache/oozie/tools/TestDBLoadDump.java
index 7777d08..4f9d4bc 100644
--- a/tools/src/test/java/org/apache/oozie/tools/TestDBLoadDump.java
+++ b/tools/src/test/java/org/apache/oozie/tools/TestDBLoadDump.java
@@ -64,7 +64,6 @@ public class TestDBLoadDump extends XTestCase {
validZipDump = zipDump("/dumpData/valid", "validZipDumpTest.zip");
invalidZipDump = zipDump("/dumpData/invalid", "invalidZipDumpTest.zip");
- setSqlStrictEnforce(getEntityManager());
createOozieSysTable(getEntityManager());
System.setSecurityManager(new NoExitSecurityManager());
@@ -166,26 +165,6 @@ public class TestDBLoadDump extends XTestCase {
return services.get(JPAService.class).getEntityManager();
}
- /**
- * To enforce length checks for {@link String} fields while trying to perform to persist invalid {@link WorkflowActionBean}
- * instances as part of {@link #testImportInvalidDataLeavesTablesEmpty()}, we have to issue an SQL command to HSQLDB like this:
- * <tt>SET PROPERTY "sql.enforce_strict_size" TRUE;</tt>
- * as part of the current {@link EntityTransaction}. Please see the
- * {@linkplain http://hsqldb.org/doc/guide/ch04.html HSQLDB docs} for details.
- *
- * @param entityManager
- */
- private void setSqlStrictEnforce(final EntityManager entityManager) {
- final String sqlStrictEnforce = "SET PROPERTY \"sql.enforce_strict_size\" TRUE";
-
- final EntityTransaction tx = entityManager.getTransaction();
- tx.begin();
-
- entityManager.createNativeQuery(sqlStrictEnforce).executeUpdate();
-
- tx.commit();
- }
-
private File zipDump(final String dumpFolderPath, final String zipDumpFileName) throws IOException {
final File zipDump = new File(getTestCaseDir() + File.separator + zipDumpFileName);