You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openjpa.apache.org by dw...@apache.org on 2009/09/25 18:08:15 UTC

svn commit: r818901 - /openjpa/branches/1.3.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/strategy/TestStrategyAnnotaion.java

Author: dwoods
Date: Fri Sep 25 16:08:14 2009
New Revision: 818901

URL: http://svn.apache.org/viewvc?rev=818901&view=rev
Log:
OPENJPA-1116: fix test case error on non-Derby DB by adding CLEAR_TABLES

Modified:
    openjpa/branches/1.3.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/strategy/TestStrategyAnnotaion.java

Modified: openjpa/branches/1.3.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/strategy/TestStrategyAnnotaion.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.3.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/strategy/TestStrategyAnnotaion.java?rev=818901&r1=818900&r2=818901&view=diff
==============================================================================
--- openjpa/branches/1.3.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/strategy/TestStrategyAnnotaion.java (original)
+++ openjpa/branches/1.3.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/strategy/TestStrategyAnnotaion.java Fri Sep 25 16:08:14 2009
@@ -30,23 +30,29 @@
 
 
 public class TestStrategyAnnotaion extends SingleEMFTestCase {
-	 public void testStrategy() {
-	    	EntityManagerFactory emf = Persistence.
-	       		createEntityManagerFactory("testStrategy", System.getProperties());
-	   	EntityManager em = emf.createEntityManager();
-		em.getTransaction().begin();
-		Person person = new Person();
-		person.setName("parul");
-		person.setAge(21);
-
-		// no address entered for person.
-		em.persist(person);
-		em.getTransaction().commit();
-		em.clear();
-
-		// In case of inner join, the result set should be empty
-		List pers = em.createQuery("select p from Person p").getResultList();
-		assertTrue(pers.isEmpty());
-	}
+
+    @Override
+    public void setUp() {
+        super.setUp(Person.class, Address.class, CLEAR_TABLES);
+    }
+
+    public void testStrategy() {
+        EntityManagerFactory emf = Persistence.createEntityManagerFactory(
+            "testStrategy", System.getProperties());
+        EntityManager em = emf.createEntityManager();
+        em.getTransaction().begin();
+        Person person = new Person();
+        person.setName("parul");
+        person.setAge(21);
+
+        // no address entered for person.
+        em.persist(person);
+        em.getTransaction().commit();
+        em.clear();
+
+        // In case of inner join, the result set should be empty
+        List pers = em.createQuery("select p from Person p").getResultList();
+        assertTrue(pers.isEmpty());
+    }
 }