OPENJPA-2768 delete xmlstore test db between runs.
This did lead to errors when running the tests multiple times.
diff --git a/openjpa-xmlstore/src/test/java/org/apache/openjpa/xmlstore/simple/TestPersistence.java b/openjpa-xmlstore/src/test/java/org/apache/openjpa/xmlstore/simple/TestPersistence.java
index 3e4f3c7..d1a5f98 100644
--- a/openjpa-xmlstore/src/test/java/org/apache/openjpa/xmlstore/simple/TestPersistence.java
+++ b/openjpa-xmlstore/src/test/java/org/apache/openjpa/xmlstore/simple/TestPersistence.java
@@ -18,6 +18,11 @@
*/
package org.apache.openjpa.xmlstore.simple;
+import java.io.File;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
import javax.persistence.EntityManager;
import javax.persistence.EntityTransaction;
@@ -30,6 +35,19 @@
*/
public class TestPersistence extends AbstractPersistenceTestCase {
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ // delete previous DB
+ Path dbDir = Paths.get("target/openjpa-xmlstore-db");
+ if (dbDir.toFile().exists()) {
+ Files.walk(dbDir)
+ .map(Path::toFile)
+ .forEach(File::delete);
+ }
+ }
+
public void testCreateEntityManager() {
OpenJPAEntityManagerFactorySPI emf = createNamedEMF("xmlstore-simple");
try {
diff --git a/pom.xml b/pom.xml
index c1cc1ad..2de3e79 100644
--- a/pom.xml
+++ b/pom.xml
@@ -42,7 +42,7 @@
<java.class.version>1.8</java.class.version>
<java.testclass.version>1.8</java.testclass.version>
- <doclint>none</doclint>
+ <doclint>none</doclint>
<openjpa.version>${project.version}</openjpa.version>
<openjpa.Log>DefaultLevel=INFO</openjpa.Log>