cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r450448 - /incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/CayenneContextClientChannelEventsTst.java
Date Wed, 27 Sep 2006 14:10:30 GMT
Author: aadamchik
Date: Wed Sep 27 07:10:29 2006
New Revision: 450448

URL: http://svn.apache.org/viewvc?view=rev&rev=450448
Log:
CAY-663 extra test case

Modified:
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/CayenneContextClientChannelEventsTst.java

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/CayenneContextClientChannelEventsTst.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/CayenneContextClientChannelEventsTst.java?view=diff&rev=450448&r1=450447&r2=450448
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/CayenneContextClientChannelEventsTst.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/CayenneContextClientChannelEventsTst.java
Wed Sep 27 07:10:29 2006
@@ -76,6 +76,38 @@
         assertFalse(c2.internalGraphManager().hasChanges());
     }
 
+    public void testSyncNewDeletedObject() throws Exception {
+        // this resets snapshot cache...
+        createDataContext();
+        deleteTestData();
+
+        DataChannel serverChannel = new ClientServerChannel(getDomain());
+        ClientChannel clientChannel = new ClientChannel(
+                new LocalConnection(serverChannel),
+                true);
+
+        CayenneContext c1 = new CayenneContext(clientChannel);
+        CayenneContext c2 = new CayenneContext(clientChannel);
+
+        // insert, then delete - this shouldn't propagate via an event.
+        ClientMtTable1 o1 = (ClientMtTable1) c1.newObject(ClientMtTable1.class);
+        o1.setGlobalAttribute1("X");
+        c1.deleteObject(o1);
+
+        // introduce some other change so that commit can go ahead...
+        ClientMtTable1 o1x = (ClientMtTable1) c1.newObject(ClientMtTable1.class);
+        o1x.setGlobalAttribute1("Y");
+        c1.commitChanges();
+
+        ClientMtTable1 o2 = (ClientMtTable1) c2.getGraphManager().getNode(
+                o1.getObjectId());
+
+        assertNull(o2);
+
+        assertFalse(c1.internalGraphManager().hasChanges());
+        assertFalse(c2.internalGraphManager().hasChanges());
+    }
+
     public void testSyncNewObjectIntoDirtyContext() throws Exception {
         // this resets snapshot cache...
         createDataContext();



Mime
View raw message