cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From and...@apache.org
Subject svn commit: r724777 - /cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/
Date Tue, 09 Dec 2008 16:52:26 GMT
Author: andrey
Date: Tue Dec  9 08:52:25 2008
New Revision: 724777

URL: http://svn.apache.org/viewvc?rev=724777&view=rev
Log:
CAY-1119 Nested contexts on ROP
Removing now-deprecated 'createChildDataContext' API from JUnits code

Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextDataChannelEventsTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/NestedDataContextLocalCacheTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/NestedDataContextParentEventsTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/NestedDataContextParentPeerEventsTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/NestedDataContextPeerEventsTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/NestedDataContextReadTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/NestedDataContextRollbackTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/NestedDataContextValidationTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/NestedDataContextWriteTest.java

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextDataChannelEventsTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextDataChannelEventsTest.java?rev=724777&r1=724776&r2=724777&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextDataChannelEventsTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextDataChannelEventsTest.java
Tue Dec  9 08:52:25 2008
@@ -20,7 +20,9 @@
 package org.apache.cayenne.access;
 
 import org.apache.art.Artist;
+import org.apache.cayenne.DataChannel;
 import org.apache.cayenne.DataChannelListener;
+import org.apache.cayenne.ObjectContext;
 import org.apache.cayenne.graph.GraphEvent;
 import org.apache.cayenne.unit.CayenneCase;
 import org.apache.cayenne.unit.util.ThreadedTestHelper;
@@ -28,7 +30,7 @@
 
 /**
  * Tests that DataContext sends DataChannel events.
- * 
+ *
  */
 public class DataContextDataChannelEventsTest extends CayenneCase {
 
@@ -78,7 +80,7 @@
         MockChannelListener listener = new MockChannelListener();
         EventUtil.listenForChannelEvents(context, listener);
 
-        DataContext child = context.createChildDataContext();
+        ObjectContext child = context.createChildObjectContext();
         Artist a1 = (Artist) child.localObject(a.getObjectId(), a);
 
         a1.setArtistName("Y");
@@ -118,16 +120,17 @@
 
     public void testChangeEventOnPeerChangeSecondNestingLevel() throws Exception {
         DataContext context = createDataContext();
-        DataContext childPeer1 = context.createChildDataContext();
+
+        ObjectContext childPeer1 = context.createChildObjectContext();
 
         Artist a = childPeer1.newObject(Artist.class);
         a.setArtistName("X");
         childPeer1.commitChanges();
 
         final MockChannelListener listener = new MockChannelListener();
-        EventUtil.listenForChannelEvents(childPeer1, listener);
+        EventUtil.listenForChannelEvents((DataChannel) childPeer1, listener);
 
-        DataContext childPeer2 = context.createChildDataContext();
+        ObjectContext childPeer2 = context.createChildObjectContext();
 
         Artist a1 = (Artist) childPeer2.localObject(a.getObjectId(), a);
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/NestedDataContextLocalCacheTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/NestedDataContextLocalCacheTest.java?rev=724777&r1=724776&r2=724777&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/NestedDataContextLocalCacheTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/NestedDataContextLocalCacheTest.java
Tue Dec  9 08:52:25 2008
@@ -21,7 +21,9 @@
 import java.util.List;
 
 import org.apache.art.Artist;
-import org.apache.cayenne.query.QueryMetadata;
+import org.apache.cayenne.BaseContext;
+import org.apache.cayenne.ObjectContext;
+import org.apache.cayenne.query.QueryCacheStrategy;
 import org.apache.cayenne.query.SelectQuery;
 import org.apache.cayenne.unit.CayenneCase;
 
@@ -36,19 +38,19 @@
     public void testLocalCacheStaysLocal() {
 
         SelectQuery query = new SelectQuery(Artist.class);
-        query.setCachePolicy(QueryMetadata.LOCAL_CACHE);
+        query.setCacheStrategy(QueryCacheStrategy.LOCAL_CACHE);
 
         DataContext context = createDataContext();
-        DataContext child1 = context.createChildDataContext();
+        ObjectContext child1 = context.createChildObjectContext();
 
-        assertNull(child1.getQueryCache().get(
+        assertNull(((BaseContext) child1).getQueryCache().get(
                 query.getMetaData(child1.getEntityResolver())));
 
         assertNull(context.getQueryCache().get(
                 query.getMetaData(context.getEntityResolver())));
 
         List<?> results = child1.performQuery(query);
-        assertSame(results, child1.getQueryCache().get(
+        assertSame(results, ((BaseContext) child1).getQueryCache().get(
                 query.getMetaData(child1.getEntityResolver())));
 
         assertNull(context.getQueryCache().get(

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/NestedDataContextParentEventsTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/NestedDataContextParentEventsTest.java?rev=724777&r1=724776&r2=724777&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/NestedDataContextParentEventsTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/NestedDataContextParentEventsTest.java
Tue Dec  9 08:52:25 2008
@@ -20,13 +20,14 @@
 package org.apache.cayenne.access;
 
 import org.apache.art.Artist;
+import org.apache.cayenne.ObjectContext;
 import org.apache.cayenne.unit.CayenneCase;
 
 public class NestedDataContextParentEventsTest extends CayenneCase {
 
     public void testParentUpdatedId() {
         DataContext context = createDataContext();
-        DataContext child1 = context.createChildDataContext();
+        ObjectContext child1 = context.createChildObjectContext();
 
         Artist ac = child1.newObject(Artist.class);
         ac.setArtistName("X");

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/NestedDataContextParentPeerEventsTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/NestedDataContextParentPeerEventsTest.java?rev=724777&r1=724776&r2=724777&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/NestedDataContextParentPeerEventsTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/NestedDataContextParentPeerEventsTest.java
Tue Dec  9 08:52:25 2008
@@ -21,6 +21,7 @@
 
 import org.apache.art.Artist;
 import org.apache.art.Painting;
+import org.apache.cayenne.ObjectContext;
 import org.apache.cayenne.unit.CayenneCase;
 import org.apache.cayenne.unit.util.ThreadedTestHelper;
 
@@ -36,7 +37,7 @@
         DataContext parentPeer = context.getParentDataDomain().createDataContext();
         Artist a1 = (Artist) parentPeer.localObject(a.getObjectId(), a);
 
-        final DataContext peer2 = context.createChildDataContext();
+        final ObjectContext peer2 = context.createChildObjectContext();
         final Artist a2 = (Artist) peer2.localObject(a.getObjectId(), a);
 
         a1.setArtistName("Y");
@@ -73,7 +74,7 @@
         Painting p1 = (Painting) parentPeer.localObject(p.getObjectId(), p);
         Artist altA1 = (Artist) parentPeer.localObject(altA.getObjectId(), altA);
 
-        final DataContext peer2 = context.createChildDataContext();
+        final ObjectContext peer2 = context.createChildObjectContext();
         final Painting p2 = (Painting) peer2.localObject(p.getObjectId(), p);
         final Artist altA2 = (Artist) peer2.localObject(altA.getObjectId(), altA);
         Artist a2 = (Artist) peer2.localObject(a.getObjectId(), a);
@@ -114,7 +115,7 @@
         Painting py1 = (Painting) parentPeer.localObject(py.getObjectId(), py);
         Artist a1 = (Artist) parentPeer.localObject(a.getObjectId(), a);
 
-        final DataContext peer2 = context.createChildDataContext();
+        final ObjectContext peer2 = context.createChildObjectContext();
         final Painting py2 = (Painting) peer2.localObject(py.getObjectId(), py);
         final Artist a2 = (Artist) peer2.localObject(a.getObjectId(), a);
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/NestedDataContextPeerEventsTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/NestedDataContextPeerEventsTest.java?rev=724777&r1=724776&r2=724777&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/NestedDataContextPeerEventsTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/NestedDataContextPeerEventsTest.java
Tue Dec  9 08:52:25 2008
@@ -21,6 +21,7 @@
 
 import org.apache.art.Artist;
 import org.apache.art.Painting;
+import org.apache.cayenne.ObjectContext;
 import org.apache.cayenne.ObjectId;
 import org.apache.cayenne.unit.CayenneCase;
 
@@ -29,12 +30,12 @@
     public void testPeerObjectUpdatedTempOID() {
         DataContext context = createDataContext();
 
-        DataContext peer1 = context.createChildDataContext();
+        ObjectContext peer1 = context.createChildObjectContext();
         Artist a1 = peer1.newObject(Artist.class);
         a1.setArtistName("Y");
         ObjectId a1TempId = a1.getObjectId();
 
-        DataContext peer2 = context.createChildDataContext();
+        ObjectContext peer2 = context.createChildObjectContext();
         Artist a2 = (Artist) peer2.localObject(a1TempId, a1);
 
         assertEquals(a1TempId, a2.getObjectId());
@@ -52,10 +53,10 @@
         a.setArtistName("X");
         context.commitChanges();
 
-        DataContext peer1 = context.createChildDataContext();
+        ObjectContext peer1 = context.createChildObjectContext();
         Artist a1 = (Artist) peer1.localObject(a.getObjectId(), a);
 
-        DataContext peer2 = context.createChildDataContext();
+        ObjectContext peer2 = context.createChildObjectContext();
         Artist a2 = (Artist) peer2.localObject(a.getObjectId(), a);
 
         a1.setArtistName("Y");
@@ -81,11 +82,11 @@
         altA.setArtistName("Y");
         context.commitChanges();
 
-        DataContext peer1 = context.createChildDataContext();
+        ObjectContext peer1 = context.createChildObjectContext();
         Painting p1 = (Painting) peer1.localObject(p.getObjectId(), p);
         Artist altA1 = (Artist) peer1.localObject(altA.getObjectId(), altA);
 
-        DataContext peer2 = context.createChildDataContext();
+        ObjectContext peer2 = context.createChildObjectContext();
         Painting p2 = (Painting) peer2.localObject(p.getObjectId(), p);
         Artist altA2 = (Artist) peer2.localObject(altA.getObjectId(), altA);
         Artist a2 = (Artist) peer2.localObject(a.getObjectId(), a);
@@ -115,11 +116,11 @@
 
         context.commitChanges();
 
-        DataContext peer1 = context.createChildDataContext();
+        ObjectContext peer1 = context.createChildObjectContext();
         Painting py1 = (Painting) peer1.localObject(py.getObjectId(), py);
         Artist a1 = (Artist) peer1.localObject(a.getObjectId(), a);
 
-        DataContext peer2 = context.createChildDataContext();
+        ObjectContext peer2 = context.createChildObjectContext();
         Painting py2 = (Painting) peer2.localObject(py.getObjectId(), py);
         Artist a2 = (Artist) peer2.localObject(a.getObjectId(), a);
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/NestedDataContextReadTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/NestedDataContextReadTest.java?rev=724777&r1=724776&r2=724777&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/NestedDataContextReadTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/NestedDataContextReadTest.java
Tue Dec  9 08:52:25 2008
@@ -26,6 +26,7 @@
 import org.apache.art.Painting;
 import org.apache.cayenne.DataObject;
 import org.apache.cayenne.DataObjectUtils;
+import org.apache.cayenne.ObjectContext;
 import org.apache.cayenne.ObjectId;
 import org.apache.cayenne.PersistenceState;
 import org.apache.cayenne.Persistent;
@@ -39,26 +40,26 @@
         DataContext parent = createDataContext();
         parent.setValidatingObjectsOnCommit(true);
 
-        DataContext child1 = parent.createChildDataContext();
+        ObjectContext child1 = parent.createChildObjectContext();
 
         assertNotNull(child1);
         assertSame(parent, child1.getChannel());
-        assertTrue(child1.isValidatingObjectsOnCommit());
+        assertTrue(((DataContext) child1).isValidatingObjectsOnCommit());
 
         parent.setValidatingObjectsOnCommit(false);
 
-        DataContext child2 = parent.createChildDataContext();
+        ObjectContext child2 = parent.createChildObjectContext();
 
         assertNotNull(child2);
         assertSame(parent, child2.getChannel());
-        assertFalse(child2.isValidatingObjectsOnCommit());
+        assertFalse(((DataContext) child2).isValidatingObjectsOnCommit());
 
         // second level of nesting
-        DataContext child21 = child2.createChildDataContext();
+        ObjectContext child21 = child2.createChildObjectContext();
 
         assertNotNull(child21);
         assertSame(child2, child21.getChannel());
-        assertFalse(child2.isValidatingObjectsOnCommit());
+        assertFalse(((DataContext) child2).isValidatingObjectsOnCommit());
     }
 
     public void testLocalObjectSynchronize() throws Exception {
@@ -66,7 +67,7 @@
         createTestData("testArtists");
 
         DataContext context = createDataContext();
-        DataContext childContext = context.createChildDataContext();
+        ObjectContext childContext = context.createChildObjectContext();
 
         Persistent _new = context.newObject(Artist.class);
 
@@ -158,7 +159,7 @@
         createTestData("testArtists");
 
         DataContext context = createDataContext();
-        DataContext childContext = context.createChildDataContext();
+        ObjectContext childContext = context.createChildObjectContext();
 
         int modifiedId = 33003;
         Artist modified = (Artist) DataObjectUtils.objectForQuery(
@@ -201,7 +202,7 @@
         deleteTestData();
 
         DataContext context = createDataContext();
-        DataContext childContext = context.createChildDataContext();
+        ObjectContext childContext = context.createChildObjectContext();
 
         Artist _new = context.newObject(Artist.class);
         Painting _newP = context.newObject(Painting.class);
@@ -226,7 +227,7 @@
         createTestData("testArtists");
 
         DataContext parent = createDataContext();
-        DataContext child = parent.createChildDataContext();
+        ObjectContext child = parent.createChildObjectContext();
 
         // test how different object states appear in the child on select
 
@@ -285,7 +286,7 @@
         createTestData("testReadRelationship");
 
         DataContext parent = createDataContext();
-        DataContext child = parent.createChildDataContext();
+        ObjectContext child = parent.createChildObjectContext();
 
         // test how different object states appear in the child on select
 
@@ -396,7 +397,7 @@
         createTestData("testPrefetching");
 
         DataContext parent = createDataContext();
-        DataContext child = parent.createChildDataContext();
+        ObjectContext child = parent.createChildObjectContext();
 
         ObjectId prefetchedId = new ObjectId(
                 "Artist",
@@ -435,7 +436,7 @@
         createTestData("testPrefetching");
 
         DataContext parent = createDataContext();
-        DataContext child = parent.createChildDataContext();
+        ObjectContext child = parent.createChildObjectContext();
 
         SelectQuery q = new SelectQuery(Artist.class);
         q.addOrdering(Artist.ARTIST_NAME_PROPERTY, true);

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/NestedDataContextRollbackTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/NestedDataContextRollbackTest.java?rev=724777&r1=724776&r2=724777&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/NestedDataContextRollbackTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/NestedDataContextRollbackTest.java
Tue Dec  9 08:52:25 2008
@@ -19,41 +19,42 @@
 package org.apache.cayenne.access;
 
 import org.apache.art.Artist;
+import org.apache.cayenne.ObjectContext;
 import org.apache.cayenne.unit.CayenneCase;
 
 public class NestedDataContextRollbackTest extends CayenneCase {
 
     public void testRollbackChanges() {
         DataContext context = createDataContext();
-        DataContext child1 = context.createChildDataContext();
-        
+        ObjectContext child1 = context.createChildObjectContext();
+
         assertFalse(context.hasChanges());
         assertFalse(child1.hasChanges());
-        
+
         context.newObject(Artist.class);
         child1.newObject(Artist.class);
-        
+
         assertTrue(context.hasChanges());
         assertTrue(child1.hasChanges());
-        
+
         child1.rollbackChanges();
         assertFalse(context.hasChanges());
         assertFalse(child1.hasChanges());
     }
-    
+
     public void testRollbackChangesLocally() {
         DataContext context = createDataContext();
-        DataContext child1 = context.createChildDataContext();
-        
+        ObjectContext child1 = context.createChildObjectContext();
+
         assertFalse(context.hasChanges());
         assertFalse(child1.hasChanges());
-        
+
         context.newObject(Artist.class);
         child1.newObject(Artist.class);
-        
+
         assertTrue(context.hasChanges());
         assertTrue(child1.hasChanges());
-        
+
         child1.rollbackChangesLocally();
         assertTrue(context.hasChanges());
         assertFalse(child1.hasChanges());

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/NestedDataContextValidationTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/NestedDataContextValidationTest.java?rev=724777&r1=724776&r2=724777&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/NestedDataContextValidationTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/NestedDataContextValidationTest.java
Tue Dec  9 08:52:25 2008
@@ -20,6 +20,7 @@
 package org.apache.cayenne.access;
 
 import org.apache.art.Artist;
+import org.apache.cayenne.ObjectContext;
 import org.apache.cayenne.unit.CayenneCase;
 import org.apache.cayenne.validation.ValidationException;
 
@@ -29,10 +30,10 @@
         DataContext context = createDataContext();
         context.setValidatingObjectsOnCommit(true);
 
-        DataContext childContext = context.createChildDataContext();
+        ObjectContext childContext = context.createChildObjectContext();
         assertTrue(
                 "Child context must have inherited the validation flag from parent",
-                childContext.isValidatingObjectsOnCommit());
+                ((DataContext) childContext).isValidatingObjectsOnCommit());
 
         Artist a1 = childContext.newObject(Artist.class);
         try {

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/NestedDataContextWriteTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/NestedDataContextWriteTest.java?rev=724777&r1=724776&r2=724777&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/NestedDataContextWriteTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/NestedDataContextWriteTest.java
Tue Dec  9 08:52:25 2008
@@ -28,6 +28,7 @@
 import org.apache.art.Painting;
 import org.apache.art.PaintingInfo;
 import org.apache.cayenne.DataObjectUtils;
+import org.apache.cayenne.ObjectContext;
 import org.apache.cayenne.PersistenceState;
 import org.apache.cayenne.query.SelectQuery;
 import org.apache.cayenne.unit.CayenneCase;
@@ -50,7 +51,7 @@
         createTestData("testDeleteNew");
 
         DataContext context = createDataContext();
-        DataContext childContext = context.createChildDataContext();
+        ObjectContext childContext = context.createChildObjectContext();
 
         Artist a = DataObjectUtils.objectForPK(childContext, Artist.class, 33001);
         Painting p = childContext.newObject(Painting.class);
@@ -73,8 +74,8 @@
         createTestData("testNullifyToOne");
 
         DataContext context = createDataContext();
-        DataContext childContext = context.createChildDataContext();
-        DataContext childContextPeer = context.createChildDataContext();
+        ObjectContext childContext = context.createChildObjectContext();
+        ObjectContext childContextPeer = context.createChildObjectContext();
 
         Painting childP1 = DataObjectUtils.objectForPK(
                 childContext,
@@ -108,7 +109,7 @@
         createTestData("testFlushChanges");
 
         DataContext context = createDataContext();
-        DataContext childContext = context.createChildDataContext();
+        ObjectContext childContext = context.createChildObjectContext();
 
         // make sure we fetch in predictable order
         SelectQuery query = new SelectQuery(Artist.class);
@@ -180,7 +181,7 @@
         createTestData("testFlushChanges");
 
         DataContext context = createDataContext();
-        DataContext childContext = context.createChildDataContext();
+        ObjectContext childContext = context.createChildObjectContext();
 
         // make sure we fetch in predictable order
         SelectQuery query = new SelectQuery(Artist.class);
@@ -217,7 +218,7 @@
         createTestData("testFlushChanges");
 
         DataContext context = createDataContext();
-        DataContext childContext = context.createChildDataContext();
+        ObjectContext childContext = context.createChildObjectContext();
 
         // make sure we fetch in predictable order
         SelectQuery query = new SelectQuery(Artist.class);
@@ -284,7 +285,7 @@
         createTestData("testCommitChangesToParent_MergeProperties");
 
         DataContext context = createDataContext();
-        DataContext childContext = context.createChildDataContext();
+        ObjectContext childContext = context.createChildObjectContext();
 
         // make sure we fetch in predictable order
         SelectQuery query = new SelectQuery(Painting.class);
@@ -364,7 +365,7 @@
         deleteTestData();
 
         DataContext context = createDataContext();
-        DataContext childContext = context.createChildDataContext();
+        ObjectContext childContext = context.createChildObjectContext();
 
         Painting childMaster = childContext.newObject(Painting.class);
         childMaster.setPaintingTitle("Master");
@@ -404,7 +405,7 @@
         deleteTestData();
 
         DataContext context = createDataContext();
-        DataContext childContext = context.createChildDataContext();
+        ObjectContext childContext = context.createChildObjectContext();
 
         Artist childO1 = childContext.newObject(Artist.class);
         childO1.setArtistName("Master");
@@ -448,7 +449,7 @@
         deleteTestData();
 
         DataContext context = createDataContext();
-        DataContext childContext = context.createChildDataContext();
+        ObjectContext childContext = context.createChildObjectContext();
 
         Artist childO1 = childContext.newObject(Artist.class);
         childO1.setArtistName("o1");
@@ -546,7 +547,7 @@
     public void testAddRemove() {
 
         DataContext context = createDataContext();
-        DataContext child = context.createChildDataContext();
+        ObjectContext child = context.createChildObjectContext();
 
         Artist a = child.newObject(Artist.class);
         a.setArtistName("X");



Mime
View raw message