[openjpa] branch master updated (ad4ed02 -> 25cde67)

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[openjpa] branch master updated (ad4ed02 -> 25cde67)

struberg
This is an automated email from the ASF dual-hosted git repository.

struberg pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/openjpa.git.


    from ad4ed02  OPENJPA-2713 fix h2
     new 0cd523b  move back to h2-1.4.196 due to a Time bug in h2 197
     new 43aa42c  OPENJPA-2771 fix h2 'unlimited' LIMIT case
     new 17ef63b  Those 2 tests only work when running on Derby.
     new 25cde67  test cleanup

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/openjpa/jdbc/sql/H2Dictionary.java  |   2 -
 .../conf/TestOverrideNonJtaDataSource.java         |   7 +-
 .../persistence/conf/TestSwitchConnection.java     |   7 +-
 .../TestTemporalTypeQueryParameterBinding.java     | 278 ++++++++++-----------
 .../jpql/clauses/TestEJBQueryInterface.java        |   7 +-
 .../persistence/query/TestEJBQueryInterface.java   |   8 +-
 pom.xml                                            |   2 +-
 7 files changed, 150 insertions(+), 161 deletions(-)

Reply | Threaded
Open this post in threaded view
|

[openjpa] 01/04: move back to h2-1.4.196 due to a Time bug in h2 197

struberg
This is an automated email from the ASF dual-hosted git repository.

struberg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openjpa.git

commit 0cd523b1f564ec7d1c27de6e017423471f94b4af
Author: Mark Struberg <[hidden email]>
AuthorDate: Fri Feb 1 14:58:23 2019 +0100

    move back to h2-1.4.196 due to a Time bug in h2 197
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 45bb243..265a72e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -439,7 +439,7 @@
                 </property>
             </activation>
             <properties>
-                <h2.version>1.4.197</h2.version>
+                <h2.version>1.4.196</h2.version>
                 <connection.driver.name>org.h2.Driver</connection.driver.name>
                 <connection.url>jdbc:h2:./target/database/openjpa-h2-database</connection.url>
                 <connection.username />

Reply | Threaded
Open this post in threaded view
|

[openjpa] 02/04: OPENJPA-2771 fix h2 'unlimited' LIMIT case

struberg
In reply to this post by struberg
This is an automated email from the ASF dual-hosted git repository.

struberg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openjpa.git

commit 43aa42ccb533212db9acf1a238d24172b18dc513
Author: Mark Struberg <[hidden email]>
AuthorDate: Sat Feb 2 12:02:58 2019 +0100

    OPENJPA-2771 fix h2 'unlimited' LIMIT case
   
    With h2 one should omit the LIMIT section to get all results.
    Our old LIMIT 0 did effectively prune the whole result list to zero entries.
---
 .../src/main/java/org/apache/openjpa/jdbc/sql/H2Dictionary.java         | 2 --
 1 file changed, 2 deletions(-)

diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/H2Dictionary.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/H2Dictionary.java
index a6f1e79..925e2c9 100644
--- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/H2Dictionary.java
+++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/H2Dictionary.java
@@ -225,8 +225,6 @@ public class H2Dictionary extends DBDictionary {
         if (end != Long.MAX_VALUE)
             buf.append(" LIMIT ").appendValue(end - start);
         if (start != 0) {
-            if(end == Long.MAX_VALUE)
-                buf.append(" LIMIT 0");
             buf.append(" OFFSET ").appendValue(start);
         }
     }

Reply | Threaded
Open this post in threaded view
|

[openjpa] 03/04: Those 2 tests only work when running on Derby.

struberg
In reply to this post by struberg
This is an automated email from the ASF dual-hosted git repository.

struberg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openjpa.git

commit 17ef63bbe4a96ce8b41727a0ace15fdd1ff312a7
Author: Mark Struberg <[hidden email]>
AuthorDate: Sat Feb 2 12:06:57 2019 +0100

    Those 2 tests only work when running on Derby.
   
    They hardcoded slurp in some derby driver via simple-ldap.
    Thus they only work if the derby profile is activated.
    In any other case those tests blow up with a CNFE.
---
 .../openjpa/persistence/conf/TestOverrideNonJtaDataSource.java     | 7 +++++--
 .../org/apache/openjpa/persistence/conf/TestSwitchConnection.java  | 7 +++++--
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/conf/TestOverrideNonJtaDataSource.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/conf/TestOverrideNonJtaDataSource.java
index 72159df..922d4d8 100644
--- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/conf/TestOverrideNonJtaDataSource.java
+++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/conf/TestOverrideNonJtaDataSource.java
@@ -27,12 +27,16 @@ import javax.persistence.EntityManagerFactory;
 import javax.persistence.RollbackException;
 
 import org.apache.openjpa.jdbc.conf.JDBCConfiguration;
+import org.apache.openjpa.jdbc.sql.DerbyDictionary;
 import org.apache.openjpa.persistence.ArgumentException;
 import org.apache.openjpa.persistence.OpenJPAEntityManager;
 import org.apache.openjpa.persistence.OpenJPAEntityManagerFactorySPI;
 import org.apache.openjpa.persistence.OpenJPAEntityManagerSPI;
 import org.apache.openjpa.persistence.test.SingleEMFTestCase;
 
+/**
+ * Test only works in Derby due to the simple-JNDI setup
+ */
 public class TestOverrideNonJtaDataSource extends SingleEMFTestCase {
     private String defaultJndiName = "jdbc/mocked";
     private String[] jndiNames = { "jdbc/mocked1" };
@@ -52,8 +56,7 @@ public class TestOverrideNonJtaDataSource extends SingleEMFTestCase {
         super.setUp(Person.class, CLEAR_TABLES);
         OpenJPAEntityManager em = emf.createEntityManager();
         JDBCConfiguration conf = (JDBCConfiguration) em.getConfiguration();
-        String user = conf.getConnectionUserName();
-        if (user != null && !user.equals("")) {
+        if (!(conf.getDBDictionaryInstance() instanceof DerbyDictionary)) {
             // Disable for non-Derby, due to connectionUserName to schema mapping failures
             setTestsDisabled(true);
             getLog().trace("TestOverrideNonJtaDataSource can only be executed against Derby w/o a schema");
diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/conf/TestSwitchConnection.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/conf/TestSwitchConnection.java
index 5704786..23cac89 100644
--- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/conf/TestSwitchConnection.java
+++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/conf/TestSwitchConnection.java
@@ -27,12 +27,16 @@ import javax.persistence.EntityManagerFactory;
 import javax.persistence.RollbackException;
 
 import org.apache.openjpa.jdbc.conf.JDBCConfiguration;
+import org.apache.openjpa.jdbc.sql.DerbyDictionary;
 import org.apache.openjpa.persistence.ArgumentException;
 import org.apache.openjpa.persistence.OpenJPAEntityManager;
 import org.apache.openjpa.persistence.OpenJPAEntityManagerFactorySPI;
 import org.apache.openjpa.persistence.OpenJPAEntityManagerSPI;
 import org.apache.openjpa.persistence.test.SingleEMFTestCase;
 
+/**
+ * Test only works in Derby due to the simple-JNDI setup
+ */
 public class TestSwitchConnection extends SingleEMFTestCase {
     private String defaultJndiName = "jdbc/mocked";
     private String[] jndiNames = { "jdbc/mocked1" };
@@ -52,8 +56,7 @@ public class TestSwitchConnection extends SingleEMFTestCase {
         super.setUp(Person.class, CLEAR_TABLES);
         OpenJPAEntityManager em = emf.createEntityManager();
         JDBCConfiguration conf = (JDBCConfiguration) em.getConfiguration();
-        String user = conf.getConnectionUserName();
-        if (user != null && !user.equals("")) {
+        if (!(conf.getDBDictionaryInstance() instanceof DerbyDictionary)) {
             // Disable for non-Derby, due to connectionUserName to schema mapping failures
             setTestsDisabled(true);
             getLog().trace("TestOverrideNonJtaDataSource can only be executed against Derby w/o a schema");

Reply | Threaded
Open this post in threaded view
|

[openjpa] 04/04: test cleanup

struberg
In reply to this post by struberg
This is an automated email from the ASF dual-hosted git repository.

struberg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openjpa.git

commit 25cde67172b9fb9f8e11a0db0cd77a05fe3a31ad
Author: Mark Struberg <[hidden email]>
AuthorDate: Sat Feb 2 12:08:57 2019 +0100

    test cleanup
   
    * remove unused methods
    * fix formatting
    * delete entries owt we will randomly blow up
---
 .../TestTemporalTypeQueryParameterBinding.java     | 278 ++++++++++-----------
 .../jpql/clauses/TestEJBQueryInterface.java        |   7 +-
 .../persistence/query/TestEJBQueryInterface.java   |   8 +-
 3 files changed, 139 insertions(+), 154 deletions(-)

diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/TestTemporalTypeQueryParameterBinding.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/TestTemporalTypeQueryParameterBinding.java
index 8dfe367..e6108d9 100644
--- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/TestTemporalTypeQueryParameterBinding.java
+++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/TestTemporalTypeQueryParameterBinding.java
@@ -44,33 +44,32 @@ import org.apache.openjpa.persistence.test.SingleEMFTestCase;
  *
  */
 public class TestTemporalTypeQueryParameterBinding extends SingleEMFTestCase {
- private static Calendar PARAM_CALENDAR = Calendar.getInstance();
- private  static long T1 = PARAM_CALENDAR.getTimeInMillis();
- private  static long T2 = T1 + 2000;
- private  static long T3 = T1 + 3000;
-
- private static Date     VALUE_DATE     = new Date(T1);
- private static Time     VALUE_TIME     = new Time(T2);
- private static Timestamp VALUE_TSTAMP   = new Timestamp(T3);
-
-
- private static String JPQL_NAMED  =
- "SELECT p FROM TimeKeeper p " +
- "WHERE p.date=:d AND p.time=:t AND p.tstamp=:ts";
- private static String JPQL_POSITIONAL  =
- "SELECT p FROM TimeKeeper p " +
- "WHERE p.date=?1 AND p.time=?2 AND p.tstamp=?3";
-
- private EntityManager em;
- @Override
- public void setUp() throws Exception {
- super.setUp(CLEAR_TABLES, TimeKeeper.class, TimeEntity.class);
- em = emf.createEntityManager();
-
- TimeKeeper pc = new TimeKeeper();
- pc.setDate(VALUE_DATE);
- pc.setTime(VALUE_TIME);
- pc.setTstamp(VALUE_TSTAMP);
+    private static Calendar PARAM_CALENDAR = Calendar.getInstance();
+    private  static long T1 = PARAM_CALENDAR.getTimeInMillis();
+    private  static long T2 = T1 + 2000;
+    private  static long T3 = T1 + 3000;
+
+    private static Date     VALUE_DATE     = new Date(T1);
+    private static Time     VALUE_TIME     = new Time(T2);
+    private static Timestamp VALUE_TSTAMP   = new Timestamp(T3);
+
+
+    private static String JPQL_NAMED  =
+        "SELECT p FROM TimeKeeper p WHERE p.date=:d AND p.time=:t AND p.tstamp=:ts";
+    
+    private static String JPQL_POSITIONAL  =
+        "SELECT p FROM TimeKeeper p WHERE p.date=?1 AND p.time=?2 AND p.tstamp=?3";
+
+    private EntityManager em;
+    @Override
+    public void setUp() throws Exception {
+        super.setUp(CLEAR_TABLES, TimeKeeper.class, TimeEntity.class);
+        em = emf.createEntityManager();
+
+        TimeKeeper pc = new TimeKeeper();
+        pc.setDate(VALUE_DATE);
+        pc.setTime(VALUE_TIME);
+        pc.setTstamp(VALUE_TSTAMP);
 
         TimeEntity te = new TimeEntity();
         te.setName("name1");
@@ -78,112 +77,112 @@ public class TestTemporalTypeQueryParameterBinding extends SingleEMFTestCase {
         te.setCal2Timestamp(PARAM_CALENDAR);
         te.setCal2Time(PARAM_CALENDAR);
         te.setCal2Date(PARAM_CALENDAR);
- te.setUDate2SDate(VALUE_DATE);
- te.setUDate2Time(VALUE_DATE);
- te.setUDate2Timestamp(VALUE_DATE);
-
- em.getTransaction().begin();
- em.persist(pc);
- em.persist(te);
- em.getTransaction().commit();
- }
-
- public void testNamedParameterConvertedFromCalendarValue() {
- Calendar c1 = Calendar.getInstance();
- Calendar c2 = Calendar.getInstance();
- Calendar c3 = Calendar.getInstance();
- c1.setTimeInMillis(T1);
- c2.setTimeInMillis(T2);
- c3.setTimeInMillis(T3);
-
- Query q = em.createQuery(JPQL_NAMED);
- q.setParameter("d",  c1, TemporalType.DATE);
- q.setParameter("t",  c2, TemporalType.TIME);
- q.setParameter("ts", c3, TemporalType.TIMESTAMP);
-
- assertEquals(1, q.getResultList().size());
- }
-
- public void testPositionalParameterConvertedFromCalendarValue() {
- Calendar c1 = Calendar.getInstance();
- Calendar c2 = Calendar.getInstance();
- Calendar c3 = Calendar.getInstance();
- c1.setTimeInMillis(T1);
- c2.setTimeInMillis(T2);
- c3.setTimeInMillis(T3);
-
- Query q = em.createQuery(JPQL_POSITIONAL);
- q.setParameter(1,  c1, TemporalType.DATE);
- q.setParameter(2,  c2, TemporalType.TIME);
- q.setParameter(3,  c3, TemporalType.TIMESTAMP);
-
- assertEquals(1, q.getResultList().size());
- }
- public void testNamedParameterConvertedFromDateValue() {
- Date d1 = new Date(T1);
- Date d2 = new Date(T2);
- Date d3 = new Date(T3);
-
- Query q = em.createQuery(JPQL_NAMED);
- q.setParameter("d",  d1, TemporalType.DATE);
- q.setParameter("t",  d2, TemporalType.TIME);
- q.setParameter("ts", d3, TemporalType.TIMESTAMP);
-
- assertEquals(1, q.getResultList().size());
- }
-
- public void testPositionalParameterConvertedFromDateValue() {
- Date d1 = new Date(T1);
- Date d2 = new Date(T2);
- Date d3 = new Date(T3);
-
- Query q = em.createQuery(JPQL_POSITIONAL);
- q.setParameter(1,  d1, TemporalType.DATE);
- q.setParameter(2,  d2, TemporalType.TIME);
- q.setParameter(3,  d3, TemporalType.TIMESTAMP);
-
- assertEquals(1, q.getResultList().size());
- }
-
-
- public void testNamedParameterWithMismatchedValue() {
- Date d1 = new Date(T1);
- Date d2 = new Date(T2);
- Date d3 = new Date(T3);
-
- Query q = em.createQuery(JPQL_NAMED);
- q.setParameter("d",  d1, TemporalType.TIME);
- q.setParameter("ts",  d2, TemporalType.TIMESTAMP);
-
- try {
-        q.setParameter("t",  d3, TemporalType.DATE);
- fail("Expeceted " + ArgumentException.class.getName());
- } catch (IllegalArgumentException ex) {
- // good
- }
- }
-
- public void testPositionalParameterWithMismatchedValue() {
- Date d1 = new Date(T1);
- Date d2 = new Date(T2);
- Date d3 = new Date(T3);
-
- Query q = em.createQuery(JPQL_POSITIONAL);
- q.setParameter(1,  d1, TemporalType.TIME);
-
- try {
-        q.setParameter(2,  d2, TemporalType.TIMESTAMP);
- fail("Expeceted " + ArgumentException.class.getName());
- } catch (IllegalArgumentException ex) {
-    // expected.
- }
+        te.setUDate2SDate(VALUE_DATE);
+        te.setUDate2Time(VALUE_DATE);
+        te.setUDate2Timestamp(VALUE_DATE);
+
+        em.getTransaction().begin();
+        em.persist(pc);
+        em.persist(te);
+        em.getTransaction().commit();
+    }
+
+    public void testNamedParameterConvertedFromCalendarValue() {
+        Calendar c1 = Calendar.getInstance();
+        Calendar c2 = Calendar.getInstance();
+        Calendar c3 = Calendar.getInstance();
+        c1.setTimeInMillis(T1);
+        c2.setTimeInMillis(T2);
+        c3.setTimeInMillis(T3);
+
+        Query q = em.createQuery(JPQL_NAMED);
+        q.setParameter("d",  c1, TemporalType.DATE);
+        q.setParameter("t",  c2, TemporalType.TIME);
+        q.setParameter("ts", c3, TemporalType.TIMESTAMP);
+
+        assertEquals(1, q.getResultList().size());
+    }
+
+    public void testPositionalParameterConvertedFromCalendarValue() {
+        Calendar c1 = Calendar.getInstance();
+        Calendar c2 = Calendar.getInstance();
+        Calendar c3 = Calendar.getInstance();
+        c1.setTimeInMillis(T1);
+        c2.setTimeInMillis(T2);
+        c3.setTimeInMillis(T3);
+
+        Query q = em.createQuery(JPQL_POSITIONAL);
+        q.setParameter(1,  c1, TemporalType.DATE);
+        q.setParameter(2,  c2, TemporalType.TIME);
+        q.setParameter(3,  c3, TemporalType.TIMESTAMP);
+
+        assertEquals(1, q.getResultList().size());
+    }
+    public void testNamedParameterConvertedFromDateValue() {
+        Date d1 = new Date(T1);
+        Date d2 = new Date(T2);
+        Date d3 = new Date(T3);
+
+        Query q = em.createQuery(JPQL_NAMED);
+        q.setParameter("d",  d1, TemporalType.DATE);
+        q.setParameter("t",  d2, TemporalType.TIME);
+        q.setParameter("ts", d3, TemporalType.TIMESTAMP);
+
+        assertEquals(1, q.getResultList().size());
+    }
+
+    public void testPositionalParameterConvertedFromDateValue() {
+        Date d1 = new Date(T1);
+        Date d2 = new Date(T2);
+        Date d3 = new Date(T3);
+
+        Query q = em.createQuery(JPQL_POSITIONAL);
+        q.setParameter(1,  d1, TemporalType.DATE);
+        q.setParameter(2,  d2, TemporalType.TIME);
+        q.setParameter(3,  d3, TemporalType.TIMESTAMP);
+
+        assertEquals(1, q.getResultList().size());
+    }
+
+
+    public void testNamedParameterWithMismatchedValue() {
+        Date d1 = new Date(T1);
+        Date d2 = new Date(T2);
+        Date d3 = new Date(T3);
+
+        Query q = em.createQuery(JPQL_NAMED);
+        q.setParameter("d",  d1, TemporalType.TIME);
+        q.setParameter("ts",  d2, TemporalType.TIMESTAMP);
+
+        try {
+            q.setParameter("t",  d3, TemporalType.DATE);
+            fail("Expeceted " + ArgumentException.class.getName());
+        } catch (IllegalArgumentException ex) {
+            // good
+        }
+    }
+
+    public void testPositionalParameterWithMismatchedValue() {
+        Date d1 = new Date(T1);
+        Date d2 = new Date(T2);
+        Date d3 = new Date(T3);
+
+        Query q = em.createQuery(JPQL_POSITIONAL);
+        q.setParameter(1,  d1, TemporalType.TIME);
+
+        try {
+            q.setParameter(2,  d2, TemporalType.TIMESTAMP);
+            fail("Expeceted " + ArgumentException.class.getName());
+        } catch (IllegalArgumentException ex) {
+            // expected.
+        }
         try {
             q.setParameter(3,  d3, TemporalType.DATE);
             fail("Expeceted " + ArgumentException.class.getName());
         } catch (IllegalArgumentException ex) {
             // expected.
         }
- }
+    }
 
     public void testTemporalType() {
         EntityManager em = emf.createEntityManager();
@@ -239,31 +238,6 @@ public class TestTemporalTypeQueryParameterBinding extends SingleEMFTestCase {
     }
 
 
-    void verifyParams(String jpql, Class<? extends Exception> error,
-        Object... params) {
-        EntityManager em = emf.createEntityManager();
-        em.getTransaction().begin();
- Query query = em.createNativeQuery(jpql);
- for (int i=0; params != null && i<params.length; i=+2) {
- try {
- if (params[i] instanceof Number) {
-                    query.setParameter(((Number) params[i]).intValue(),
-                        params[i + 1]);
-                } else {
-                    query.setParameter(params[i].toString(), params[i+1]);
- }
- if (error != null)
- fail("Expected " + error.getName());
- } catch (Exception e) {
- if (!error.isAssignableFrom(e.getClass())) {
-    // let the test harness handle the exception
-                    throw new RuntimeException("An unexpected exception " +
-                            "occurred see initCause for details", e);
- }
- }
- }
- em.getTransaction().commit();
- }
 
     void assertSetTemporalParameter(Query q, int pos, Date v, TemporalType temporalType) {
         try {
diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/clauses/TestEJBQueryInterface.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/clauses/TestEJBQueryInterface.java
index a4940ac..4b3a057 100644
--- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/clauses/TestEJBQueryInterface.java
+++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/clauses/TestEJBQueryInterface.java
@@ -37,11 +37,16 @@ public class TestEJBQueryInterface extends AbstractTestCase {
 
     @Override
     public void setUp() {
-        deleteAll(Entity1.class);
 
         int instNum = 10;
 
         EntityManager em = currentEntityManager();
+
+        startTx(em);
+        deleteAll(Entity1.class, em);
+        deleteAll(Entity2.class, em);
+        endTx(em);
+
         startTx(em);
 
         //create and persist multiple entity1 instances
diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestEJBQueryInterface.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestEJBQueryInterface.java
index 621a081..e90c22a 100644
--- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestEJBQueryInterface.java
+++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestEJBQueryInterface.java
@@ -33,11 +33,17 @@ public class TestEJBQueryInterface extends BaseQueryTest {
 
     @Override
     public void setUp() throws Exception {
-        super.setUp(Entity1.class, Entity2.class, Order.class, OrderItem.class);
+        super.setUp(Entity1.class, Entity2.class, Order.class, OrderItem.class, "openjpa.Log", "SQL=Trace");
 
         int instNum = 10;
 
         EntityManager em = currentEntityManager();
+
+        startTx(em);
+        deleteAll(Entity1.class, em);
+        deleteAll(Entity2.class, em);
+        endTx(em);
+
         startTx(em);
 
         //create and persist multiple entity1 instances