cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r951709 - /cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/VerticalInheritanceTest.java
Date Sat, 05 Jun 2010 13:06:23 GMT
Author: aadamchik
Date: Sat Jun  5 13:06:22 2010
New Revision: 951709

URL: http://svn.apache.org/viewvc?rev=951709&view=rev
Log:
CAY-1090 vertical inheritance

* fixing table cleanup for the unit tests to prevent derby errors

Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/VerticalInheritanceTest.java

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/VerticalInheritanceTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/VerticalInheritanceTest.java?rev=951709&r1=951708&r2=951709&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/VerticalInheritanceTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/VerticalInheritanceTest.java
Sat Jun  5 13:06:22 2010
@@ -37,6 +37,17 @@ import org.apache.cayenne.unit.CayenneRe
 public class VerticalInheritanceTest extends CayenneCase {
 
     @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+
+        DBHelper dbHelper = getDbHelper();
+        dbHelper.deleteAll("IV_SUB1_SUB1");
+        dbHelper.deleteAll("IV_SUB1");
+        dbHelper.deleteAll("IV_SUB2");
+        dbHelper.deleteAll("IV_ROOT");
+    }
+
+    @Override
     protected AccessStack buildAccessStack() {
         return CayenneResources.getResources().getAccessStack("InheritanceVerticalStack");
     }
@@ -46,7 +57,6 @@ public class VerticalInheritanceTest ext
 
         TableHelper ivRootTable = new TableHelper(dbHelper, "IV_ROOT");
         ivRootTable.setColumns("ID", "NAME", "DISCRIMINATOR");
-        ivRootTable.deleteAll();
 
         assertEquals(0, ivRootTable.getRowCount());
 
@@ -73,9 +83,6 @@ public class VerticalInheritanceTest ext
         TableHelper ivSub1Table = new TableHelper(dbHelper, "IV_SUB1");
         ivSub1Table.setColumns("ID", "SUB1_NAME");
 
-        ivSub1Table.deleteAll();
-        ivRootTable.deleteAll();
-
         IvSub1 sub1 = createDataContext().newObject(IvSub1.class);
         sub1.setName("XyZX");
         sub1.getObjectContext().commitChanges();
@@ -128,10 +135,6 @@ public class VerticalInheritanceTest ext
         TableHelper ivSub1Sub1Table = new TableHelper(dbHelper, "IV_SUB1_SUB1");
         ivSub1Sub1Table.setColumns("ID", "SUB1_SUB1_NAME");
 
-        ivSub1Sub1Table.deleteAll();
-        ivSub1Table.deleteAll();
-        ivRootTable.deleteAll();
-
         IvSub1Sub1 sub1Sub1 = createDataContext().newObject(IvSub1Sub1.class);
         sub1Sub1.setName("XyZN");
         sub1Sub1.setSub1Name("mDA");
@@ -169,10 +172,6 @@ public class VerticalInheritanceTest ext
         TableHelper ivSub1Table = new TableHelper(dbHelper, "IV_SUB1");
         ivSub1Table.setColumns("ID", "SUB1_NAME");
 
-        // delete
-        ivSub1Table.deleteAll();
-        ivRootTable.deleteAll();
-
         // insert
         ivRootTable.insert(1, "xROOT", null);
         ivRootTable.insert(2, "xSUB1_ROOT", "IvSub1");
@@ -219,12 +218,6 @@ public class VerticalInheritanceTest ext
         TableHelper ivSub1Sub1Table = new TableHelper(dbHelper, "IV_SUB1_SUB1");
         ivSub1Sub1Table.setColumns("ID", "SUB1_SUB1_NAME");
 
-        // delete
-        ivSub1Sub1Table.deleteAll();
-        ivSub2Table.deleteAll();
-        ivSub1Table.deleteAll();
-        ivRootTable.deleteAll();
-
         // insert
         ivRootTable.insert(1, "xROOT", null);
 
@@ -292,12 +285,6 @@ public class VerticalInheritanceTest ext
         TableHelper ivSub1Sub1Table = new TableHelper(dbHelper, "IV_SUB1_SUB1");
         ivSub1Sub1Table.setColumns("ID", "SUB1_SUB1_NAME");
 
-        // delete
-        ivSub1Sub1Table.deleteAll();
-        ivSub2Table.deleteAll();
-        ivSub1Table.deleteAll();
-        ivRootTable.deleteAll();
-
         // insert
         ivRootTable.insert(1, "xROOT", null);
 
@@ -354,12 +341,6 @@ public class VerticalInheritanceTest ext
         TableHelper ivSub1Sub1Table = new TableHelper(dbHelper, "IV_SUB1_SUB1");
         ivSub1Sub1Table.setColumns("ID", "SUB1_SUB1_NAME");
 
-        // delete
-        ivSub1Sub1Table.deleteAll();
-        ivSub2Table.deleteAll();
-        ivSub1Table.deleteAll();
-        ivRootTable.deleteAll();
-
         // insert
         ivRootTable.insert(1, "xROOT", null);
 



Mime
View raw message