openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From allee8...@apache.org
Subject svn commit: r702180 - in /openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence: jdbc/update/TestParentChild.java recursive/TestRecursiveRelationships.java spring/TestLibService.java
Date Mon, 06 Oct 2008 15:33:57 GMT
Author: allee8285
Date: Mon Oct  6 08:33:57 2008
New Revision: 702180

URL: http://svn.apache.org/viewvc?rev=702180&view=rev
Log:
Fix test case db preparation to allow tests to repeat run without taking various runtime exception.

Modified:
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/update/TestParentChild.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/recursive/TestRecursiveRelationships.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/spring/TestLibService.java

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/update/TestParentChild.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/update/TestParentChild.java?rev=702180&r1=702179&r2=702180&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/update/TestParentChild.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/update/TestParentChild.java
Mon Oct  6 08:33:57 2008
@@ -98,7 +98,7 @@
 		// The last argument tells that this is a runtime option. So the
 		// values are included to generate combinations but are excluded
 		// from generating OpenJPA configuration.
-		getHelper().addOption("persist-order", PersistOrder.values(), true);
+		getHelper().addOption(Key_PersistOrder, PersistOrder.values(), true);
 	}
 
 	public void setUp() {
@@ -109,7 +109,7 @@
 		getHelper().addOption(Key_SchemaFactory, Option_SchemaFactory);
 		getHelper().addOption(Key_UpdateManager, Option_UpdateManager);
 
-		getHelper().addOption("persist-order", PersistOrder.values(), true);
+		getHelper().addOption(Key_PersistOrder, PersistOrder.values(), true);
 		
 		sql.clear();
 		super.setUp(DROP_TABLES, Parent.class, Child.class);
@@ -191,7 +191,8 @@
 	 */
 	void assertPostInsertUpdate() {
 		if (getPersistOrder().equals(PersistOrder.CHILD_THEN_PARENT)
-		 && getMappingDefaults().contains("restrict")) {
+		 && getMappingDefaults().contains("restrict")
+		 && getUpdateManagerDefaults().contains("operation-order")) {
 			assertSQL("UPDATE .* SET PARENT_ID .* WHERE .*");
 		}
 	}
@@ -226,6 +227,10 @@
 		return getHelper().getOptionAsString(Key_MappingDefaults);
 	}
 
+    String getUpdateManagerDefaults() {
+        return getHelper().getOptionAsString(Key_UpdateManager);
+    }
+
 	String getSchemaFactory() {
 		return getHelper().getOptionAsString(Key_SchemaFactory);
 	}

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/recursive/TestRecursiveRelationships.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/recursive/TestRecursiveRelationships.java?rev=702180&r1=702179&r2=702180&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/recursive/TestRecursiveRelationships.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/recursive/TestRecursiveRelationships.java
Mon Oct  6 08:33:57 2008
@@ -27,7 +27,7 @@
     private int _l2Nodes = 3;
 
     public void setUp() {
-        setUp(Node.class);
+        setUp(DROP_TABLES, Node.class);
     }
 
     public void testRecursiveNodes() {

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/spring/TestLibService.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/spring/TestLibService.java?rev=702180&r1=702179&r2=702180&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/spring/TestLibService.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/spring/TestLibService.java
Mon Oct  6 08:33:57 2008
@@ -25,12 +25,13 @@
     
     public void setUp() {
         // declare the library model classes
-        super.setUp(Book.class, Borrower.class, Subject.class, Volunteer.class);
+        super.setUp(DROP_TABLES, Book.class, Borrower.class, Subject.class,
+            Volunteer.class);
         
         // put golden data in database
         LibTestingService libTestingService = new LibTestingService();
         libTestingService.setEntityManager(emf.createEntityManager());
-        libTestingService. repopulateDB();
+        libTestingService.repopulateDB();
         libTestingService.close();
         
         // create the LibService



Mime
View raw message