cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r429225 - /incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/test/java/org/apache/cayenne/CayenneContextClientChannelEventsTst.java
Date Mon, 07 Aug 2006 01:10:07 GMT
Author: aadamchik
Date: Sun Aug  6 18:10:07 2006
New Revision: 429225

URL: http://svn.apache.org/viewvc?rev=429225&view=rev
Log:
testing many-to-many behavior in multiple contexts

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

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/test/java/org/apache/cayenne/CayenneContextClientChannelEventsTst.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/test/java/org/apache/cayenne/CayenneContextClientChannelEventsTst.java?rev=429225&r1=429224&r2=429225&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/test/java/org/apache/cayenne/CayenneContextClientChannelEventsTst.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/test/java/org/apache/cayenne/CayenneContextClientChannelEventsTst.java
Sun Aug  6 18:10:07 2006
@@ -232,4 +232,34 @@
         assertFalse(c1.internalGraphManager().hasChanges());
         assertFalse(c2.internalGraphManager().hasChanges());
     }
+
+    public void testSyncManyToManyRelationship1() throws Exception {
+        // this resets snapshot cache...
+        createDataContext();
+
+        deleteTestData();
+
+        DataChannel serverChannel = new ClientServerChannel(getDomain(), false);
+        ClientChannel clientChannel = new ClientChannel(
+                new LocalConnection(serverChannel),
+                true);
+
+        CayenneContext c1 = new CayenneContext(clientChannel);
+        CayenneContext c2 = new CayenneContext(clientChannel);
+
+        ClientMtTable4 o1 = (ClientMtTable4) c1.newObject(ClientMtTable4.class);
+        ClientMtTable5 o1r = (ClientMtTable5) c1.newObject(ClientMtTable5.class);
+        c1.commitChanges();
+
+        ClientMtTable4 o2 = (ClientMtTable4) c2.localObject(o1.getObjectId(), null);
+        ClientMtTable5 o2r = (ClientMtTable5) c2.localObject(o1r.getObjectId(), null);
+
+        o2.addToTable5s(o2r);
+        c2.commitChanges();
+
+        assertEquals(1, o1.getTable5s().size());
+        assertEquals(1, o2.getTable5s().size());
+        assertFalse(c1.internalGraphManager().hasChanges());
+        assertFalse(c2.internalGraphManager().hasChanges());
+    }
 }



Mime
View raw message