cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r775722 - /cayenne/main/tags/3.0M6/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/merge/SetAllowNullToDbTest.java
Date Sun, 17 May 2009 17:29:24 GMT
Author: aadamchik
Date: Sun May 17 17:29:24 2009
New Revision: 775722

URL: http://svn.apache.org/viewvc?rev=775722&view=rev
Log:
fixing merge tests cleanup that causes chain reaction with tests downstream

Modified:
    cayenne/main/tags/3.0M6/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/merge/SetAllowNullToDbTest.java

Modified: cayenne/main/tags/3.0M6/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/merge/SetAllowNullToDbTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/tags/3.0M6/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/merge/SetAllowNullToDbTest.java?rev=775722&r1=775721&r2=775722&view=diff
==============================================================================
--- cayenne/main/tags/3.0M6/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/merge/SetAllowNullToDbTest.java
(original)
+++ cayenne/main/tags/3.0M6/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/merge/SetAllowNullToDbTest.java
Sun May 17 17:29:24 2009
@@ -32,27 +32,32 @@
         // create and add new column to model and db
         DbAttribute column = new DbAttribute("NEWCOL2", Types.VARCHAR, dbEntity);
 
-        column.setMandatory(true);
-        column.setMaxLength(10);
-        dbEntity.addAttribute(column);
-        assertTokensAndExecute(node, map, 2, 0);
-
-        // check that is was merged
-        assertTokensAndExecute(node, map, 0, 0);
-
-        // set null
-        column.setMandatory(false);
-
-        // merge to db
-        assertTokensAndExecute(node, map, 1, 0);
-
-        // check that is was merged
-        assertTokensAndExecute(node, map, 0, 0);
-
-        // clean up
-        dbEntity.removeAttribute(column.getName());
-        assertTokensAndExecute(node, map, 1, 0);
-        assertTokensAndExecute(node, map, 0, 0);
+        try {
+
+            column.setMandatory(true);
+            column.setMaxLength(10);
+            dbEntity.addAttribute(column);
+            assertTokensAndExecute(node, map, 2, 0);
+
+            // check that is was merged
+            assertTokensAndExecute(node, map, 0, 0);
+
+            // set null
+            column.setMandatory(false);
+
+            // merge to db
+            assertTokensAndExecute(node, map, 1, 0);
+
+            // check that is was merged
+            assertTokensAndExecute(node, map, 0, 0);
+
+            // clean up
+        }
+        finally {
+            dbEntity.removeAttribute(column.getName());
+            assertTokensAndExecute(node, map, 1, 0);
+            assertTokensAndExecute(node, map, 0, 0);
+        }
     }
 
 }



Mime
View raw message