cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r695407 - /cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CDOOne2OneDepTest.java
Date Mon, 15 Sep 2008 10:12:06 GMT
Author: aadamchik
Date: Mon Sep 15 03:12:06 2008
New Revision: 695407

URL: http://svn.apache.org/viewvc?rev=695407&view=rev
Log:
unit test for rollbacks of 1..1

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

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CDOOne2OneDepTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CDOOne2OneDepTest.java?rev=695407&r1=695406&r2=695407&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CDOOne2OneDepTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CDOOne2OneDepTest.java
Mon Sep 15 03:12:06 2008
@@ -26,6 +26,24 @@
 import org.apache.art.PaintingInfo;
 
 public class CDOOne2OneDepTest extends CayenneDOTestBase {
+    
+    public void testRollbackDependent() {
+        Artist a1 = newArtist();
+        Painting p1 = newPainting();
+
+        // needed to save without errors
+        p1.setToArtist(a1);
+        ctxt.commitChanges();
+        
+        PaintingInfo info = ctxt.newObject(PaintingInfo.class);
+        info.setTextReview("XXX");
+        p1.setToPaintingInfo(info);
+        
+        assertSame(info, p1.getToPaintingInfo());
+        
+        ctxt.rollbackChanges();
+        assertNull(p1.getToPaintingInfo());
+    }
 
     public void test2Null() throws Exception {
         Artist a1 = newArtist();



Mime
View raw message