cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r454624 [2/3] - in /incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src: main/java/org/apache/cayenne/access/ test/java/org/apache/cayenne/ test/java/org/apache/cayenne/access/ test/java/org/apache/cayenne/exp/parser/ test/java/org/apache/...
Date Tue, 10 Oct 2006 05:46:59 GMT
Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextDeleteRulesTst.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextDeleteRulesTst.java?view=diff&rev=454624&r1=454623&r2=454624
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextDeleteRulesTst.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextDeleteRulesTst.java Mon Oct  9 22:46:56 2006
@@ -48,10 +48,10 @@
 
     public void testNullifyToOne() {
         // ArtGroup toParentGroup
-        ArtGroup parentGroup = (ArtGroup) context.createAndRegisterNewObject("ArtGroup");
+        ArtGroup parentGroup = (ArtGroup) context.newObject("ArtGroup");
         parentGroup.setName("Parent");
 
-        ArtGroup childGroup = (ArtGroup) context.createAndRegisterNewObject("ArtGroup");
+        ArtGroup childGroup = (ArtGroup) context.newObject("ArtGroup");
         childGroup.setName("Child");
         parentGroup.addToChildGroupsArray(childGroup);
 
@@ -81,9 +81,9 @@
      */
     public void testCascadeToManyFlattened() {
         // testing Artist.groupArray relationship
-        ArtGroup aGroup = (ArtGroup) context.createAndRegisterNewObject(ArtGroup.class);
+        ArtGroup aGroup = (ArtGroup) context.newObject(ArtGroup.class);
         aGroup.setName("Group Name");
-        Artist anArtist = (Artist) context.createAndRegisterNewObject(Artist.class);
+        Artist anArtist = (Artist) context.newObject(Artist.class);
         anArtist.setArtistName("A Name");
         anArtist.addToGroupArray(aGroup);
         assertTrue(anArtist.getGroupArray().contains(aGroup));
@@ -113,9 +113,9 @@
      */
     public void testNullifyToManyFlattened() {
         // testing ArtGroup.artistArray relationship
-        ArtGroup aGroup = (ArtGroup) context.createAndRegisterNewObject(ArtGroup.class);
+        ArtGroup aGroup = (ArtGroup) context.newObject(ArtGroup.class);
         aGroup.setName("Group Name");
-        Artist anArtist = (Artist) context.createAndRegisterNewObject(Artist.class);
+        Artist anArtist = (Artist) context.newObject(Artist.class);
         anArtist.setArtistName("A Name");
         aGroup.addToArtistArray(anArtist);
 
@@ -142,10 +142,10 @@
 
     public void testNullifyToMany() {
         // ArtGroup childGroupsArray
-        ArtGroup parentGroup = (ArtGroup) context.createAndRegisterNewObject("ArtGroup");
+        ArtGroup parentGroup = (ArtGroup) context.newObject("ArtGroup");
         parentGroup.setName("Parent");
 
-        ArtGroup childGroup = (ArtGroup) context.createAndRegisterNewObject("ArtGroup");
+        ArtGroup childGroup = (ArtGroup) context.newObject("ArtGroup");
         childGroup.setName("Child");
         parentGroup.addToChildGroupsArray(childGroup);
 
@@ -167,11 +167,10 @@
 
     public void testCascadeToOne() {
         // Painting toPaintingInfo
-        Painting painting = (Painting) context.createAndRegisterNewObject("Painting");
+        Painting painting = (Painting) context.newObject("Painting");
         painting.setPaintingTitle("A Title");
 
-        PaintingInfo info = (PaintingInfo) context
-                .createAndRegisterNewObject("PaintingInfo");
+        PaintingInfo info = (PaintingInfo) context.newObject("PaintingInfo");
         painting.setToPaintingInfo(info);
 
         // Must commit before deleting.. this relationship is dependent,
@@ -189,20 +188,19 @@
 
     public void testCascadeToMany() {
         // Artist artistExhibitArray
-        Artist anArtist = (Artist) context.createAndRegisterNewObject("Artist");
+        Artist anArtist = (Artist) context.newObject("Artist");
         anArtist.setArtistName("A Name");
-        Exhibit anExhibit = (Exhibit) context.createAndRegisterNewObject("Exhibit");
+        Exhibit anExhibit = (Exhibit) context.newObject("Exhibit");
         anExhibit.setClosingDate(new java.sql.Timestamp(System.currentTimeMillis()));
         anExhibit.setOpeningDate(new java.sql.Timestamp(System.currentTimeMillis()));
 
         // Needs a gallery... required for data integrity
-        Gallery gallery = (Gallery) context.createAndRegisterNewObject("Gallery");
+        Gallery gallery = (Gallery) context.newObject("Gallery");
         gallery.setGalleryName("A Name");
 
         anExhibit.setToGallery(gallery);
 
-        ArtistExhibit artistExhibit = (ArtistExhibit) context
-                .createAndRegisterNewObject("ArtistExhibit");
+        ArtistExhibit artistExhibit = (ArtistExhibit) context.newObject("ArtistExhibit");
 
         artistExhibit.setToArtist(anArtist);
         artistExhibit.setToExhibit(anExhibit);
@@ -218,9 +216,9 @@
 
     public void testDenyToMany() {
         // Gallery paintingArray
-        Gallery gallery = (Gallery) context.createAndRegisterNewObject("Gallery");
+        Gallery gallery = (Gallery) context.newObject("Gallery");
         gallery.setGalleryName("A Name");
-        Painting painting = (Painting) context.createAndRegisterNewObject("Painting");
+        Painting painting = (Painting) context.newObject("Painting");
         painting.setPaintingTitle("A Title");
         gallery.addToPaintingArray(painting);
         context.commitChanges();

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextEntityWithMeaningfulPKTst.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextEntityWithMeaningfulPKTst.java?view=diff&rev=454624&r1=454623&r2=454624
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextEntityWithMeaningfulPKTst.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextEntityWithMeaningfulPKTst.java Mon Oct  9 22:46:56 2006
@@ -31,26 +31,25 @@
  * @author Andrus Adamchik
  */
 public class DataContextEntityWithMeaningfulPKTst extends CayenneTestCase {
+
     protected DataContext ctxt;
 
     protected void setUp() throws Exception {
         super.setUp();
-        
+
         deleteTestData();
         ctxt = getDomain().createDataContext();
     }
 
     public void testInsertWithMeaningfulPK() throws Exception {
-        MeaningfulPKTest1 obj =
-            (MeaningfulPKTest1) ctxt.createAndRegisterNewObject("MeaningfulPKTest1");
+        MeaningfulPKTest1 obj = (MeaningfulPKTest1) ctxt.newObject("MeaningfulPKTest1");
         obj.setPkAttribute(new Integer(1000));
         obj.setDescr("aaa-aaa");
         ctxt.commitChanges();
     }
 
     public void testChangeKey() throws Exception {
-        MeaningfulPKTest1 obj =
-            (MeaningfulPKTest1) ctxt.createAndRegisterNewObject("MeaningfulPKTest1");
+        MeaningfulPKTest1 obj = (MeaningfulPKTest1) ctxt.newObject("MeaningfulPKTest1");
         obj.setPkAttribute(new Integer(1000));
         obj.setDescr("aaa-aaa");
         ctxt.commitChanges();
@@ -64,8 +63,7 @@
     }
 
     public void testToManyRelationshipWithMeaningfulPK1() throws Exception {
-        MeaningfulPKTest1 obj =
-            (MeaningfulPKTest1) ctxt.createAndRegisterNewObject("MeaningfulPKTest1");
+        MeaningfulPKTest1 obj = (MeaningfulPKTest1) ctxt.newObject("MeaningfulPKTest1");
         obj.setPkAttribute(new Integer(1000));
         obj.setDescr("aaa-aaa");
         ctxt.commitChanges();
@@ -79,15 +77,13 @@
     }
 
     public void testToManyRelationshipWithMeaningfulPK2() throws Exception {
-        MeaningfulPKTest1 obj =
-            (MeaningfulPKTest1) ctxt.createAndRegisterNewObject("MeaningfulPKTest1");
+        MeaningfulPKTest1 obj = (MeaningfulPKTest1) ctxt.newObject("MeaningfulPKTest1");
         obj.setPkAttribute(new Integer(1000));
         obj.setDescr("aaa-aaa");
         ctxt.commitChanges();
 
         // must be able to set reverse relationship
-        MeaningfulPKDep dep =
-            (MeaningfulPKDep) ctxt.createAndRegisterNewObject("MeaningfulPKDep");
+        MeaningfulPKDep dep = (MeaningfulPKDep) ctxt.newObject("MeaningfulPKDep");
         dep.setToMeaningfulPK(obj);
         ctxt.commitChanges();
     }

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextEventsTst.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextEventsTst.java?view=diff&rev=454624&r1=454623&r2=454624
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextEventsTst.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextEventsTst.java Mon Oct  9 22:46:56 2006
@@ -31,17 +31,18 @@
  * @author Andrus Adamchik
  */
 public class DataContextEventsTst extends OneWayMappingTestCase {
+
     protected DataContext context;
     protected Artist artist;
 
     protected void setUp() throws Exception {
         super.setUp();
-        
+
         deleteTestData();
         context = getDomain().createDataContext();
-        
+
         context.setTransactionEventsEnabled(true);
-        artist = (Artist) context.createAndRegisterNewObject("Artist");
+        artist = (Artist) context.newObject("Artist");
         artist.setArtistName("artist1");
         context.commitChanges();
         artist.resetEvents();
@@ -69,9 +70,8 @@
         // is either non-existent or dubious (depending on your view).
         // See: http://www.mysql.com/doc/en/Design_Limitations.html
         if (((DataNode) getDomain().getDataNodes().iterator().next())
-            .getAdapter()
-            .getClass()
-            == MySQLAdapter.class) {
+                .getAdapter()
+                .getClass() == MySQLAdapter.class) {
             return;
         }
 
@@ -98,7 +98,8 @@
         assertFalse(artist.receivedDidCommit());
     }
 
-    // tests that no notifications are sent to objects that won't be updated/inserted into database
+    // tests that no notifications are sent to objects that won't be updated/inserted into
+    // database
     public void testDataContextNoModifications() {
         assertFalse(context.hasChanges());
         assertFalse(artist.receivedWillCommit());

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextExtrasTst.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextExtrasTst.java?view=diff&rev=454624&r1=454623&r2=454624
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextExtrasTst.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextExtrasTst.java Mon Oct  9 22:46:56 2006
@@ -53,7 +53,7 @@
         deleteTestData();
         DataContext context = createDataContext();
 
-        Artist object = (Artist) context.createAndRegisterNewObject(Artist.class);
+        Artist object = (Artist) context.newObject(Artist.class);
         object.setArtistName("ABC");
         assertEquals(PersistenceState.NEW, object.getPersistenceState());
 
@@ -71,7 +71,7 @@
     public void testResolveFault() {
         DataContext context = createDataContext();
 
-        Artist o1 = (Artist) context.createAndRegisterNewObject(Artist.class);
+        Artist o1 = (Artist) context.newObject(Artist.class);
         o1.setArtistName("a");
         context.commitChanges();
 
@@ -131,21 +131,21 @@
     public void testHasChangesNew() {
         DataContext context = createDataContext();
         assertTrue("No changes expected in context", !context.hasChanges());
-        context.createAndRegisterNewObject("Artist");
+        context.newObject("Artist");
         assertTrue("Object added to context, expected to report changes", context
                 .hasChanges());
     }
 
-    public void testCreateAndRegisterNewObject() {
+    public void testNewObject() {
         DataContext context = createDataContext();
-        Artist a1 = (Artist) context.createAndRegisterNewObject("Artist");
+        Artist a1 = (Artist) context.newObject("Artist");
         assertTrue(context.getGraphManager().registeredNodes().contains(a1));
         assertTrue(context.newObjects().contains(a1));
     }
 
-    public void testCreateAndRegisterNewObjectWithClass() {
+    public void testNewObjectWithClass() {
         DataContext context = createDataContext();
-        Artist a1 = (Artist) context.createAndRegisterNewObject(Artist.class);
+        Artist a1 = (Artist) context.newObject(Artist.class);
         assertTrue(context.getGraphManager().registeredNodes().contains(a1));
         assertTrue(context.newObjects().contains(a1));
     }
@@ -206,7 +206,7 @@
 
         adapter.setPkGenerator(newGenerator);
         try {
-            Artist newArtist = (Artist) context.createAndRegisterNewObject(Artist.class);
+            Artist newArtist = (Artist) context.newObject(Artist.class);
             newArtist.setArtistName("aaa");
             context.commitChanges();
             fail("Exception expected but not thrown due to missing PK generation routine.");

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextObjectTrackingTst.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextObjectTrackingTst.java?view=diff&rev=454624&r1=454623&r2=454624
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextObjectTrackingTst.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextObjectTrackingTst.java Mon Oct  9 22:46:56 2006
@@ -96,7 +96,7 @@
         DataContext context = createDataContext();
         DataContext peerContext = createDataContext();
 
-        DataObject _new = context.createAndRegisterNewObject(Artist.class);
+        Persistent _new = context.newObject(Artist.class);
 
         Persistent hollow = context.localObject(new ObjectId(
                 "Artist",

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextPerformQueryAPITst.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextPerformQueryAPITst.java?view=diff&rev=454624&r1=454623&r2=454624
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextPerformQueryAPITst.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextPerformQueryAPITst.java Mon Oct  9 22:46:56 2006
@@ -149,7 +149,7 @@
 
     public void testPerfomQueryNonSelecting() throws Exception {
         DataContext context = createDataContext();
-        Artist a = (Artist) context.createAndRegisterNewObject(Artist.class);
+        Artist a = (Artist) context.newObject(Artist.class);
         a.setArtistName("aa");
         context.commitChanges();
 

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextPrefetchTst.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextPrefetchTst.java?view=diff&rev=454624&r1=454623&r2=454624
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextPrefetchTst.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextPrefetchTst.java Mon Oct  9 22:46:56 2006
@@ -304,9 +304,9 @@
      * Test prefetching with the prefetch on a reflexive relationship
      */
     public void testPrefetch7() throws Exception {
-        ArtGroup parent = (ArtGroup) context.createAndRegisterNewObject("ArtGroup");
+        ArtGroup parent = (ArtGroup) context.newObject("ArtGroup");
         parent.setName("parent");
-        ArtGroup child = (ArtGroup) context.createAndRegisterNewObject("ArtGroup");
+        ArtGroup child = (ArtGroup) context.newObject("ArtGroup");
         child.setName("child");
         child.setToParentGroup(parent);
         context.commitChanges();
@@ -445,7 +445,7 @@
 
     public void testPrefetchingToOneNull() throws Exception {
 
-        Painting p1 = (Painting) context.createAndRegisterNewObject(Painting.class);
+        Painting p1 = (Painting) context.newObject(Painting.class);
         p1.setPaintingTitle("aaaa");
 
         context.commitChanges();

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextProcedureQueryTst.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextProcedureQueryTst.java?view=diff&rev=454624&r1=454623&r2=454624
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextProcedureQueryTst.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextProcedureQueryTst.java Mon Oct  9 22:46:56 2006
@@ -305,10 +305,10 @@
     }
 
     protected void createArtist(double paintingPrice) {
-        Artist a = (Artist) ctxt.createAndRegisterNewObject(Artist.class);
+        Artist a = (Artist) ctxt.newObject(Artist.class);
         a.setArtistName("An Artist");
 
-        Painting p = (Painting) ctxt.createAndRegisterNewObject(Painting.class);
+        Painting p = (Painting) ctxt.newObject(Painting.class);
         p.setPaintingTitle("A Painting");
         // converting double to stringn prevents rounding weirdness...
         p.setEstimatedPrice(new BigDecimal("" + paintingPrice));

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextRollbackTst.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextRollbackTst.java?view=diff&rev=454624&r1=454623&r2=454624
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextRollbackTst.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextRollbackTst.java Mon Oct  9 22:46:56 2006
@@ -34,18 +34,18 @@
 public class DataContextRollbackTst extends DataContextTestBase {
 
     public void testRollbackNew() {
-        Artist artist = (Artist) context.createAndRegisterNewObject("Artist");
+        Artist artist = (Artist) context.newObject("Artist");
         artist.setArtistName("a");
 
-        Painting p1 = (Painting) context.createAndRegisterNewObject("Painting");
+        Painting p1 = (Painting) context.newObject("Painting");
         p1.setPaintingTitle("p1");
         p1.setToArtist(artist);
 
-        Painting p2 = (Painting) context.createAndRegisterNewObject("Painting");
+        Painting p2 = (Painting) context.newObject("Painting");
         p2.setPaintingTitle("p2");
         p2.setToArtist(artist);
 
-        Painting p3 = (Painting) context.createAndRegisterNewObject("Painting");
+        Painting p3 = (Painting) context.newObject("Painting");
         p3.setPaintingTitle("p3");
         p3.setToArtist(artist);
 
@@ -55,7 +55,7 @@
 
         context.rollbackChanges();
 
-        // after: 
+        // after:
         assertEquals(PersistenceState.TRANSIENT, artist.getPersistenceState());
 
         // TODO: should we expect relationships to be unset?
@@ -65,15 +65,15 @@
 
     public void testRollbackNewObject() {
         String artistName = "revertTestArtist";
-        Artist artist = (Artist) context.createAndRegisterNewObject("Artist");
+        Artist artist = (Artist) context.newObject("Artist");
         artist.setArtistName(artistName);
 
         context.rollbackChanges();
 
         assertEquals(PersistenceState.TRANSIENT, artist.getPersistenceState());
         context.commitChanges();
-        //The commit should have made no changes, so
-        //perform a fetch to ensure that this artist hasn't been persisted to the db
+        // The commit should have made no changes, so
+        // perform a fetch to ensure that this artist hasn't been persisted to the db
 
         DataContext freshContext = createDataContext();
         SelectQuery query = new SelectQuery(Artist.class);
@@ -83,15 +83,16 @@
         assertEquals(0, queryResults.size());
     }
 
-    //Catches a bug where new objects were unregistered within an object iterator, thus modifying the
+    // Catches a bug where new objects were unregistered within an object iterator, thus
+    // modifying the
     // collection the iterator was iterating over (ConcurrentModificationException)
     public void testRollbackWithMultipleNewObjects() {
         String artistName = "rollbackTestArtist";
         String paintingTitle = "rollbackTestPainting";
-        Artist artist = (Artist) context.createAndRegisterNewObject("Artist");
+        Artist artist = (Artist) context.newObject("Artist");
         artist.setArtistName(artistName);
 
-        Painting painting = (Painting) context.createAndRegisterNewObject("Painting");
+        Painting painting = (Painting) context.newObject("Painting");
         painting.setPaintingTitle(paintingTitle);
         painting.setToArtist(artist);
 
@@ -100,14 +101,13 @@
         }
         catch (Exception e) {
             e.printStackTrace();
-            fail(
-                "rollbackChanges should not have caused the exception " + e.getMessage());
+            fail("rollbackChanges should not have caused the exception " + e.getMessage());
         }
 
         assertEquals(PersistenceState.TRANSIENT, artist.getPersistenceState());
         context.commitChanges();
-        //The commit should have made no changes, so
-        //perform a fetch to ensure that this artist hasn't been persisted to the db
+        // The commit should have made no changes, so
+        // perform a fetch to ensure that this artist hasn't been persisted to the db
 
         DataContext freshContext = createDataContext();
         SelectQuery query = new SelectQuery(Artist.class);
@@ -120,9 +120,9 @@
     public void testRollbackRelationshipModification() {
         String artistName = "relationshipModArtist";
         String paintingTitle = "relationshipTestPainting";
-        Artist artist = (Artist) context.createAndRegisterNewObject("Artist");
+        Artist artist = (Artist) context.newObject("Artist");
         artist.setArtistName(artistName);
-        Painting painting = (Painting) context.createAndRegisterNewObject("Painting");
+        Painting painting = (Painting) context.newObject("Painting");
         painting.setPaintingTitle(paintingTitle);
         painting.setToArtist(artist);
         context.commitChanges();
@@ -135,7 +135,7 @@
         assertEquals(1, artist.getPaintingArray().size());
         assertEquals(artist, painting.getToArtist());
 
-        //Check that the reverse relationship was handled
+        // Check that the reverse relationship was handled
         assertEquals(1, artist.getPaintingArray().size());
         context.commitChanges();
 
@@ -147,16 +147,16 @@
         assertEquals(1, queryResults.size());
         Painting queriedPainting = (Painting) queryResults.get(0);
 
-        //NB:  This is an easier comparison than manually fetching artist
+        // NB: This is an easier comparison than manually fetching artist
         assertEquals(artistName, queriedPainting.getToArtist().getArtistName());
     }
 
     public void testRollbackDeletedObject() {
         String artistName = "deleteTestArtist";
-        Artist artist = (Artist) context.createAndRegisterNewObject("Artist");
+        Artist artist = (Artist) context.newObject("Artist");
         artist.setArtistName(artistName);
         context.commitChanges();
-        //Save... cayenne doesn't yet handle deleting objects that are uncommitted
+        // Save... cayenne doesn't yet handle deleting objects that are uncommitted
         context.deleteObject(artist);
         context.rollbackChanges();
 
@@ -164,8 +164,8 @@
         assertEquals(PersistenceState.HOLLOW, artist.getPersistenceState());
 
         context.commitChanges();
-        //The commit should have made no changes, so
-        //perform a fetch to ensure that this artist hasn't been deleted from the db
+        // The commit should have made no changes, so
+        // perform a fetch to ensure that this artist hasn't been deleted from the db
 
         DataContext freshContext = createDataContext();
         SelectQuery query = new SelectQuery(Artist.class);
@@ -177,7 +177,7 @@
 
     public void testRollbackModifiedObject() {
         String artistName = "initialTestArtist";
-        Artist artist = (Artist) context.createAndRegisterNewObject("Artist");
+        Artist artist = (Artist) context.newObject("Artist");
         artist.setArtistName(artistName);
         context.commitChanges();
 
@@ -185,13 +185,13 @@
 
         context.rollbackChanges();
 
-        //Make sure the inmemory changes have been rolled back
+        // Make sure the inmemory changes have been rolled back
         assertEquals(artistName, artist.getArtistName());
 
-        //Commit what's in memory...
+        // Commit what's in memory...
         context.commitChanges();
 
-        //.. and ensure that the correct data is in the db
+        // .. and ensure that the correct data is in the db
         DataContext freshContext = createDataContext();
         SelectQuery query = new SelectQuery(Artist.class);
         query.setQualifier(ExpressionFactory.matchExp("artistName", artistName));

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextSerializationTst.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextSerializationTst.java?view=diff&rev=454624&r1=454623&r2=454624
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextSerializationTst.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextSerializationTst.java Mon Oct  9 22:46:56 2006
@@ -120,7 +120,7 @@
 
         DataContext context = createDataContextWithSharedCache();
 
-        Artist artist = (Artist) context.createAndRegisterNewObject("Artist");
+        Artist artist = (Artist) context.newObject("Artist");
         artist.setArtistName("artist1");
         assertNotNull(artist.getObjectId());
 
@@ -146,7 +146,7 @@
 
         DataContext context = createDataContextWithSharedCache();
 
-        Artist artist = (Artist) context.createAndRegisterNewObject("Artist");
+        Artist artist = (Artist) context.newObject("Artist");
         artist.setArtistName("artist1");
         assertNotNull(artist.getObjectId());
         context.commitChanges();
@@ -181,7 +181,7 @@
 
         DataContext context = createDataContextWithSharedCache();
 
-        Artist artist = (Artist) context.createAndRegisterNewObject("Artist");
+        Artist artist = (Artist) context.newObject("Artist");
         artist.setArtistName("artist1");
         assertNotNull(artist.getObjectId());
         context.commitChanges();

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextSharedCacheTst.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextSharedCacheTst.java?view=diff&rev=454624&r1=454623&r2=454624
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextSharedCacheTst.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextSharedCacheTst.java Mon Oct  9 22:46:56 2006
@@ -57,7 +57,7 @@
         context = createDataContextWithSharedCache();
 
         // prepare a single artist record
-        artist = (Artist) context.createAndRegisterNewObject("Artist");
+        artist = (Artist) context.newObject("Artist");
         artist.setArtistName("version1");
         artist.setDateOfBirth(new Date());
         context.commitChanges();
@@ -399,11 +399,11 @@
      */
     public void testSnapshotDeletePropagationToManyRefresh() throws Exception {
 
-        Painting painting1 = (Painting) context.createAndRegisterNewObject("Painting");
+        Painting painting1 = (Painting) context.newObject("Painting");
         painting1.setPaintingTitle("p1");
         painting1.setToArtist(artist);
 
-        Painting painting2 = (Painting) context.createAndRegisterNewObject("Painting");
+        Painting painting2 = (Painting) context.newObject("Painting");
         painting2.setPaintingTitle("p2");
         painting2.setToArtist(artist);
 
@@ -470,7 +470,7 @@
      */
     public void testSnapshotInsertPropagationToManyRefresh() throws Exception {
 
-        Painting painting1 = (Painting) context.createAndRegisterNewObject("Painting");
+        Painting painting1 = (Painting) context.newObject("Painting");
         painting1.setPaintingTitle("p1");
         painting1.setToArtist(artist);
 
@@ -494,7 +494,7 @@
         assertEquals(PersistenceState.COMMITTED, altPainting1.getPersistenceState());
 
         // insert new painting and add to artist
-        Painting painting2 = (Painting) context.createAndRegisterNewObject("Painting");
+        Painting painting2 = (Painting) context.newObject("Painting");
         painting2.setPaintingTitle("p2");
         painting2.setToArtist(artist);
         context.commitChanges();

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextTestBase.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextTestBase.java?view=diff&rev=454624&r1=454623&r2=454624
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextTestBase.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextTestBase.java Mon Oct  9 22:46:56 2006
@@ -122,7 +122,7 @@
      * DataContext.
      */
     protected Painting insertPaintingInContext(String paintingName) {
-        Painting painting = (Painting) context.createAndRegisterNewObject("Painting");
+        Painting painting = (Painting) context.newObject("Painting");
         painting.setPaintingTitle(paintingName);
         painting.setToArtist(fetchArtist("artist2", false));
 

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextTst.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextTst.java?view=diff&rev=454624&r1=454623&r2=454624
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextTst.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextTst.java Mon Oct  9 22:46:56 2006
@@ -395,7 +395,7 @@
     }
 
     public void testCommitChangesRO1() throws Exception {
-        ROArtist a1 = (ROArtist) context.createAndRegisterNewObject("ROArtist");
+        ROArtist a1 = (ROArtist) context.newObject("ROArtist");
         a1.writePropertyDirectly("artistName", "abc");
         a1.setPersistenceState(PersistenceState.MODIFIED);
 
@@ -439,7 +439,7 @@
 
     public void testCommitChangesRO4() throws Exception {
         ROArtist a1 = fetchROArtist("artist1");
-        Painting painting = (Painting) context.createAndRegisterNewObject("Painting");
+        Painting painting = (Painting) context.newObject("Painting");
         painting.setPaintingTitle("paint");
         a1.addToPaintingArray(painting);
 
@@ -522,7 +522,7 @@
      */
     public void testHasChangesPhantom() {
         String artistName = "ArtistName";
-        Artist artist = (Artist) context.createAndRegisterNewObject("Artist");
+        Artist artist = (Artist) context.newObject("Artist");
         artist.setArtistName(artistName);
         context.commitChanges();
 
@@ -540,7 +540,7 @@
      * property is simply set to the same value (an unreal modification)
      */
     public void testHasChangesRealModify() {
-        Artist artist = (Artist) context.createAndRegisterNewObject("Artist");
+        Artist artist = (Artist) context.newObject("Artist");
         artist.setArtistName("ArtistName");
         context.commitChanges();
 

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextValidationTst.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextValidationTst.java?view=diff&rev=454624&r1=454623&r2=454624
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextValidationTst.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataContextValidationTst.java Mon Oct  9 22:46:56 2006
@@ -17,7 +17,6 @@
  *  under the License.
  ****************************************************************/
 
-
 package org.apache.cayenne.access;
 
 import org.apache.art.Artist;
@@ -44,13 +43,13 @@
         // test that validation is called properly
 
         context.setValidatingObjectsOnCommit(true);
-        Artist a1 = (Artist) context.createAndRegisterNewObject(Artist.class);
+        Artist a1 = (Artist) context.newObject(Artist.class);
         a1.setArtistName("a1");
         context.commitChanges();
         assertTrue(a1.isValidateForSaveCalled());
 
         context.setValidatingObjectsOnCommit(false);
-        Artist a2 = (Artist) context.createAndRegisterNewObject(Artist.class);
+        Artist a2 = (Artist) context.newObject(Artist.class);
         a2.setArtistName("a2");
         context.commitChanges();
         assertFalse(a2.isValidateForSaveCalled());

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataRowUtilsTst.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataRowUtilsTst.java?view=diff&rev=454624&r1=454623&r2=454624
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataRowUtilsTst.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DataRowUtilsTst.java Mon Oct  9 22:46:56 2006
@@ -80,7 +80,7 @@
         SelectQuery artistQ = new SelectQuery(Artist.class, Expression
                 .fromString("artistName = 'artist2'"));
         Artist anotherArtist = (Artist) context.performQuery(artistQ).get(0);
-        Painting painting = (Painting) context.createAndRegisterNewObject(Painting.class);
+        Painting painting = (Painting) context.newObject(Painting.class);
         painting.setPaintingTitle("PX");
         painting.setToArtist(anotherArtist);
 
@@ -91,7 +91,9 @@
         Artist artist = (Artist) context.performQuery(artistQ).get(0);
         assertNotSame(artist, painting.getToArtist());
 
-        ObjectDiff diff = context.getObjectStore().registerDiff(painting.getObjectId(), null);
+        ObjectDiff diff = context.getObjectStore().registerDiff(
+                painting.getObjectId(),
+                null);
 
         assertFalse(DataRowUtils.isToOneTargetModified(toArtist, painting, diff));
 
@@ -115,7 +117,7 @@
         ObjectDiff diff = context.getObjectStore().registerDiff(p1.getObjectId(), null);
         assertFalse(DataRowUtils.isToOneTargetModified(toGallery, p1, diff));
 
-        Gallery g1 = (Gallery) context.createAndRegisterNewObject("Gallery");
+        Gallery g1 = (Gallery) context.newObject("Gallery");
         g1.addToPaintingArray(p1);
         assertTrue(DataRowUtils.isToOneTargetModified(toGallery, p1, diff));
     }

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DateTimeTypesTst.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DateTimeTypesTst.java?view=diff&rev=454624&r1=454623&r2=454624
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DateTimeTypesTst.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DateTimeTypesTst.java Mon Oct  9 22:46:56 2006
@@ -64,8 +64,7 @@
     }
 
     public void testDate() throws Exception {
-        DateTestEntity test = (DateTestEntity) context
-                .createAndRegisterNewObject("DateTestEntity");
+        DateTestEntity test = (DateTestEntity) context.newObject("DateTestEntity");
 
         Calendar cal = Calendar.getInstance();
         cal.clear();
@@ -81,8 +80,7 @@
     }
 
     public void testTime() throws Exception {
-        DateTestEntity test = (DateTestEntity) context
-                .createAndRegisterNewObject("DateTestEntity");
+        DateTestEntity test = (DateTestEntity) context.newObject("DateTestEntity");
 
         Calendar cal = Calendar.getInstance();
         cal.clear();
@@ -102,8 +100,7 @@
     }
 
     public void testTimestamp() throws Exception {
-        DateTestEntity test = (DateTestEntity) context
-                .createAndRegisterNewObject("DateTestEntity");
+        DateTestEntity test = (DateTestEntity) context.newObject("DateTestEntity");
 
         Calendar cal = Calendar.getInstance();
         cal.clear();

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DeleteObjectTst.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DeleteObjectTst.java?view=diff&rev=454624&r1=454623&r2=454624
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DeleteObjectTst.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DeleteObjectTst.java Mon Oct  9 22:46:56 2006
@@ -17,7 +17,6 @@
  *  under the License.
  ****************************************************************/
 
-
 package org.apache.cayenne.access;
 
 import java.util.ArrayList;
@@ -162,7 +161,7 @@
     }
 
     public void testDeleteNew() throws Exception {
-        Artist artist = (Artist) context.createAndRegisterNewObject(Artist.class);
+        Artist artist = (Artist) context.newObject(Artist.class);
         artist.setArtistName("a");
 
         assertEquals(PersistenceState.NEW, artist.getPersistenceState());

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DeleteRulesOneWayTst.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DeleteRulesOneWayTst.java?view=diff&rev=454624&r1=454623&r2=454624
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DeleteRulesOneWayTst.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DeleteRulesOneWayTst.java Mon Oct  9 22:46:56 2006
@@ -34,10 +34,10 @@
     }
 
     public void testNullifyToOne() {
-        Painting aPainting = (Painting) context.createAndRegisterNewObject("Painting");
+        Painting aPainting = (Painting) context.newObject("Painting");
         aPainting.setPaintingTitle("A Title");
 
-        Gallery aGallery = (Gallery) context.createAndRegisterNewObject("Gallery");
+        Gallery aGallery = (Gallery) context.newObject("Gallery");
         aGallery.setGalleryName("Gallery Name");
 
         aPainting.setToGallery(aGallery);

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DeleteRulesTst.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DeleteRulesTst.java?view=diff&rev=454624&r1=454623&r2=454624
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DeleteRulesTst.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/DeleteRulesTst.java Mon Oct  9 22:46:56 2006
@@ -49,10 +49,8 @@
 
     public void testDenyToOne() {
         // DeleteRuleTest1 test2
-        DeleteRuleTest1 test1 = (DeleteRuleTest1) context
-                .createAndRegisterNewObject("DeleteRuleTest1");
-        DeleteRuleTest2 test2 = (DeleteRuleTest2) context
-                .createAndRegisterNewObject("DeleteRuleTest2");
+        DeleteRuleTest1 test1 = (DeleteRuleTest1) context.newObject("DeleteRuleTest1");
+        DeleteRuleTest2 test2 = (DeleteRuleTest2) context.newObject("DeleteRuleTest2");
         test1.setTest2(test2);
         context.commitChanges();
 
@@ -68,10 +66,8 @@
     }
 
     public void testNoActionToOne() {
-        DeleteRuleTest2 test2 = (DeleteRuleTest2) context
-                .createAndRegisterNewObject("DeleteRuleTest2");
-        DeleteRuleTest3 test3 = (DeleteRuleTest3) context
-                .createAndRegisterNewObject("DeleteRuleTest3");
+        DeleteRuleTest2 test2 = (DeleteRuleTest2) context.newObject("DeleteRuleTest2");
+        DeleteRuleTest3 test3 = (DeleteRuleTest3) context.newObject("DeleteRuleTest3");
         test3.setToDeleteRuleTest2(test2);
         context.commitChanges();
 
@@ -81,10 +77,8 @@
     }
 
     public void testNoActionToMany() {
-        DeleteRuleTest2 test2 = (DeleteRuleTest2) context
-                .createAndRegisterNewObject("DeleteRuleTest2");
-        DeleteRuleTest3 test3 = (DeleteRuleTest3) context
-                .createAndRegisterNewObject("DeleteRuleTest3");
+        DeleteRuleTest2 test2 = (DeleteRuleTest2) context.newObject("DeleteRuleTest2");
+        DeleteRuleTest3 test3 = (DeleteRuleTest3) context.newObject("DeleteRuleTest3");
         test3.setToDeleteRuleTest2(test2);
         context.commitChanges();
 
@@ -100,9 +94,9 @@
 
         try {
             DeleteRuleFlatA a = (DeleteRuleFlatA) context
-                    .createAndRegisterNewObject(DeleteRuleFlatA.class);
+                    .newObject(DeleteRuleFlatA.class);
             DeleteRuleFlatB b = (DeleteRuleFlatB) context
-                    .createAndRegisterNewObject(DeleteRuleFlatB.class);
+                    .newObject(DeleteRuleFlatB.class);
 
             a.addToFlatB(b);
             context.commitChanges();
@@ -130,9 +124,9 @@
 
         try {
             DeleteRuleFlatA a = (DeleteRuleFlatA) context
-                    .createAndRegisterNewObject(DeleteRuleFlatA.class);
+                    .newObject(DeleteRuleFlatA.class);
             DeleteRuleFlatB b = (DeleteRuleFlatB) context
-                    .createAndRegisterNewObject(DeleteRuleFlatB.class);
+                    .newObject(DeleteRuleFlatB.class);
 
             a.addToFlatB(b);
             context.commitChanges();
@@ -158,9 +152,9 @@
 
         try {
             DeleteRuleFlatA a = (DeleteRuleFlatA) context
-                    .createAndRegisterNewObject(DeleteRuleFlatA.class);
+                    .newObject(DeleteRuleFlatA.class);
             DeleteRuleFlatB b = (DeleteRuleFlatB) context
-                    .createAndRegisterNewObject(DeleteRuleFlatB.class);
+                    .newObject(DeleteRuleFlatB.class);
             a.addToFlatB(b);
             context.commitChanges();
 
@@ -186,9 +180,9 @@
 
         try {
             DeleteRuleFlatA a = (DeleteRuleFlatA) context
-                    .createAndRegisterNewObject(DeleteRuleFlatA.class);
+                    .newObject(DeleteRuleFlatA.class);
             DeleteRuleFlatB b = (DeleteRuleFlatB) context
-                    .createAndRegisterNewObject(DeleteRuleFlatB.class);
+                    .newObject(DeleteRuleFlatB.class);
             a.addToFlatB(b);
             context.commitChanges();
 
@@ -213,9 +207,9 @@
 
         try {
             DeleteRuleFlatA a = (DeleteRuleFlatA) context
-                    .createAndRegisterNewObject(DeleteRuleFlatA.class);
+                    .newObject(DeleteRuleFlatA.class);
             DeleteRuleFlatB b = (DeleteRuleFlatB) context
-                    .createAndRegisterNewObject(DeleteRuleFlatB.class);
+                    .newObject(DeleteRuleFlatB.class);
             a.addToFlatB(b);
             context.commitChanges();
 
@@ -241,9 +235,9 @@
 
         try {
             DeleteRuleFlatA a = (DeleteRuleFlatA) context
-                    .createAndRegisterNewObject(DeleteRuleFlatA.class);
+                    .newObject(DeleteRuleFlatA.class);
             DeleteRuleFlatB b = (DeleteRuleFlatB) context
-                    .createAndRegisterNewObject(DeleteRuleFlatB.class);
+                    .newObject(DeleteRuleFlatB.class);
             a.addToFlatB(b);
             context.commitChanges();
 
@@ -268,9 +262,9 @@
 
         try {
             DeleteRuleFlatA a = (DeleteRuleFlatA) context
-                    .createAndRegisterNewObject(DeleteRuleFlatA.class);
+                    .newObject(DeleteRuleFlatA.class);
             DeleteRuleFlatB b = (DeleteRuleFlatB) context
-                    .createAndRegisterNewObject(DeleteRuleFlatB.class);
+                    .newObject(DeleteRuleFlatB.class);
             a.addToFlatB(b);
             context.commitChanges();
 
@@ -295,9 +289,9 @@
 
         try {
             DeleteRuleFlatA a = (DeleteRuleFlatA) context
-                    .createAndRegisterNewObject(DeleteRuleFlatA.class);
+                    .newObject(DeleteRuleFlatA.class);
             DeleteRuleFlatB b = (DeleteRuleFlatB) context
-                    .createAndRegisterNewObject(DeleteRuleFlatB.class);
+                    .newObject(DeleteRuleFlatB.class);
             a.addToFlatB(b);
             context.commitChanges();
 

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/IdentityColumnsTst.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/IdentityColumnsTst.java?view=diff&rev=454624&r1=454623&r2=454624
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/IdentityColumnsTst.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/IdentityColumnsTst.java Mon Oct  9 22:46:56 2006
@@ -46,7 +46,7 @@
     public void testNewObject() throws Exception {
         DataContext context = createDataContext();
         GeneratedColumnTestEntity idObject = (GeneratedColumnTestEntity) context
-                .createAndRegisterNewObject(GeneratedColumnTestEntity.class);
+                .newObject(GeneratedColumnTestEntity.class);
 
         String name = "n_" + System.currentTimeMillis();
         idObject.setName(name);
@@ -71,12 +71,12 @@
     public void testUnrelatedUpdate() throws Exception {
         DataContext context = createDataContext();
         GeneratedColumnTestEntity m = (GeneratedColumnTestEntity) context
-                .createAndRegisterNewObject(GeneratedColumnTestEntity.class);
+                .newObject(GeneratedColumnTestEntity.class);
 
         m.setName("m");
 
         GeneratedColumnDep d = (GeneratedColumnDep) context
-                .createAndRegisterNewObject(GeneratedColumnDep.class);
+                .newObject(GeneratedColumnDep.class);
         d.setName("d");
         d.setToMaster(m);
         context.commitChanges();
@@ -102,11 +102,11 @@
         DataContext context = createDataContext();
 
         GeneratedColumnTestEntity idObject1 = (GeneratedColumnTestEntity) context
-                .createAndRegisterNewObject(GeneratedColumnTestEntity.class);
+                .newObject(GeneratedColumnTestEntity.class);
         idObject1.setName("o1");
 
         GeneratedColumnTest2 idObject2 = (GeneratedColumnTest2) context
-                .createAndRegisterNewObject(GeneratedColumnTest2.class);
+                .newObject(GeneratedColumnTest2.class);
         idObject2.setName("o2");
 
         context.commitChanges();
@@ -122,11 +122,11 @@
 
         GeneratedColumnTestEntity[] idObjects = new GeneratedColumnTestEntity[] {
                 (GeneratedColumnTestEntity) context
-                        .createAndRegisterNewObject(GeneratedColumnTestEntity.class),
+                        .newObject(GeneratedColumnTestEntity.class),
                 (GeneratedColumnTestEntity) context
-                        .createAndRegisterNewObject(GeneratedColumnTestEntity.class),
+                        .newObject(GeneratedColumnTestEntity.class),
                 (GeneratedColumnTestEntity) context
-                        .createAndRegisterNewObject(GeneratedColumnTestEntity.class)
+                        .newObject(GeneratedColumnTestEntity.class)
         };
 
         for (int i = 0; i < idObjects.length; i++) {
@@ -162,16 +162,16 @@
 
             DataContext context = createDataContext();
             GeneratedColumnCompMaster master = (GeneratedColumnCompMaster) context
-                    .createAndRegisterNewObject(GeneratedColumnCompMaster.class);
+                    .newObject(GeneratedColumnCompMaster.class);
             master.setName(masterName);
 
             GeneratedColumnCompKey dep1 = (GeneratedColumnCompKey) context
-                    .createAndRegisterNewObject(GeneratedColumnCompKey.class);
+                    .newObject(GeneratedColumnCompKey.class);
             dep1.setName(depName1);
             dep1.setToMaster(master);
 
             GeneratedColumnCompKey dep2 = (GeneratedColumnCompKey) context
-                    .createAndRegisterNewObject(GeneratedColumnCompKey.class);
+                    .newObject(GeneratedColumnCompKey.class);
             dep2.setName(depName2);
             dep2.setToMaster(master);
 
@@ -209,11 +209,11 @@
     public void testUpdateDependentWithNewMaster() throws Exception {
         DataContext context = createDataContext();
         GeneratedColumnTestEntity master1 = (GeneratedColumnTestEntity) context
-                .createAndRegisterNewObject(GeneratedColumnTestEntity.class);
+                .newObject(GeneratedColumnTestEntity.class);
         master1.setName("aaa");
 
         GeneratedColumnDep dependent = (GeneratedColumnDep) context
-                .createAndRegisterNewObject(GeneratedColumnDep.class);
+                .newObject(GeneratedColumnDep.class);
         dependent.setName("aaa");
         dependent.setToMaster(master1);
 
@@ -221,7 +221,7 @@
 
         // change master
         GeneratedColumnTestEntity master2 = (GeneratedColumnTestEntity) context
-                .createAndRegisterNewObject(GeneratedColumnTestEntity.class);
+                .newObject(GeneratedColumnTestEntity.class);
         master2.setName("bbb");
 
         // TESTING THIS
@@ -255,7 +255,7 @@
     public void testPropagateToDependent() throws Exception {
         DataContext context = createDataContext();
         GeneratedColumnTestEntity idObject = (GeneratedColumnTestEntity) context
-                .createAndRegisterNewObject(GeneratedColumnTestEntity.class);
+                .newObject(GeneratedColumnTestEntity.class);
         idObject.setName("aaa");
 
         GeneratedColumnDep dependent = (GeneratedColumnDep) idObject
@@ -291,7 +291,7 @@
         DataContext context = createDataContext();
 
         MeaningfulGeneratedColumnTestEntity o = (MeaningfulGeneratedColumnTestEntity) context
-                .createAndRegisterNewObject(MeaningfulGeneratedColumnTestEntity.class);
+                .newObject(MeaningfulGeneratedColumnTestEntity.class);
         o.setName("o1");
         o.setGeneratedColumn(new Integer(33333));
 

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/IncrementalFaultListTst.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/IncrementalFaultListTst.java?view=diff&rev=454624&r1=454623&r2=454624
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/IncrementalFaultListTst.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/IncrementalFaultListTst.java Mon Oct  9 22:46:56 2006
@@ -60,12 +60,12 @@
         prepareList(6);
         assertEquals(DataContextTst.artistCount, list.size());
     }
-    
+
     public void testSmallList() throws Exception {
         prepareList(49);
         assertEquals(DataContextTst.artistCount, list.size());
     }
-    
+
     public void testOnePageList() throws Exception {
         prepareList(DataContextTst.artistCount);
         assertEquals(DataContextTst.artistCount, list.size());
@@ -187,8 +187,7 @@
 
         Artist row = (Artist) artists.get(0);
         assertEquals(19, list.indexOf(row));
-        assertEquals(-1, list.indexOf(list.dataContext
-                .createAndRegisterNewObject("Artist")));
+        assertEquals(-1, list.indexOf(list.dataContext.newObject("Artist")));
     }
 
     public void testLastIndexOf() throws Exception {
@@ -201,7 +200,6 @@
 
         Artist row = (Artist) artists.get(0);
         assertEquals(19, list.lastIndexOf(row));
-        assertEquals(-1, list.lastIndexOf(list.dataContext
-                .createAndRegisterNewObject("Artist")));
+        assertEquals(-1, list.lastIndexOf(list.dataContext.newObject("Artist")));
     }
 }

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/InheritanceTst.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/InheritanceTst.java?view=diff&rev=454624&r1=454623&r2=454624
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/InheritanceTst.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/InheritanceTst.java Mon Oct  9 22:46:56 2006
@@ -34,12 +34,12 @@
 import org.apache.cayenne.unit.PeopleTestCase;
 
 /**
- * Testing Cayenne behavior with DataObject inheritance 
- * hierarchies.
+ * Testing Cayenne behavior with DataObject inheritance hierarchies.
  * 
  * @author Andrus Adamchik
  */
 public class InheritanceTst extends PeopleTestCase {
+
     protected DataContext context;
 
     protected void setUp() throws Exception {
@@ -49,18 +49,16 @@
     }
 
     public void testSave() throws Exception {
-        ClientCompany company =
-            (ClientCompany) context.createAndRegisterNewObject(ClientCompany.class);
+        ClientCompany company = (ClientCompany) context.newObject(ClientCompany.class);
         company.setName("Boeing");
 
-        CustomerRepresentative rep =
-            (CustomerRepresentative) context.createAndRegisterNewObject(
-                CustomerRepresentative.class);
+        CustomerRepresentative rep = (CustomerRepresentative) context
+                .newObject(CustomerRepresentative.class);
         rep.setName("Joe Schmoe");
         rep.setToClientCompany(company);
         rep.setPersonType("C");
 
-        Employee employee = (Employee) context.createAndRegisterNewObject(Employee.class);
+        Employee employee = (Employee) context.newObject(Employee.class);
         employee.setName("Our Joe Schmoe");
         employee.setPersonType("E");
 
@@ -96,10 +94,10 @@
         assertEquals(1, addresses.size());
         Address address = (Address) addresses.get(0);
         Employee e = address.getToEmployee();
-        
+
         assertSame(Manager.class, e.getClass());
     }
-    
+
     public void testCAY592() throws Exception {
         createTestData("testManagerAddress");
         List addresses = context.performQuery(new SelectQuery(Address.class));
@@ -108,12 +106,12 @@
         Address address = (Address) addresses.get(0);
         Employee e = address.getToEmployee();
 
-        // CAY-592 - make sure modification of the address in a parallel context 
+        // CAY-592 - make sure modification of the address in a parallel context
         // doesn't mess up the Manager
         DataContext c2 = context.getParentDataDomain().createDataContext();
         e = (Employee) DataObjectUtils.objectForPK(c2, e.getObjectId());
         address = (Address) e.getAddresses().get(0);
-  
+
         assertSame(e, address.getToEmployee());
         address.setCity("XYZ");
         assertSame(e, address.getToEmployee());
@@ -178,8 +176,7 @@
     }
 
     /**
-     * Returns a number of objects of a particular class and subclasses
-     * in the list.
+     * Returns a number of objects of a particular class and subclasses in the list.
      */
     protected int countObjectOfClass(List objects, Class aClass) {
         Iterator it = objects.iterator();

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/NestedDataContextReadTst.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/NestedDataContextReadTst.java?view=diff&rev=454624&r1=454623&r2=454624
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/NestedDataContextReadTst.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/NestedDataContextReadTst.java Mon Oct  9 22:46:56 2006
@@ -29,8 +29,8 @@
 import org.apache.cayenne.ObjectId;
 import org.apache.cayenne.PersistenceState;
 import org.apache.cayenne.Persistent;
-import org.apache.cayenne.query.SelectQuery;
 import org.apache.cayenne.query.ObjectIdQuery;
+import org.apache.cayenne.query.SelectQuery;
 import org.apache.cayenne.unit.CayenneTestCase;
 
 public class NestedDataContextReadTst extends CayenneTestCase {
@@ -68,7 +68,7 @@
         DataContext context = createDataContext();
         DataContext childContext = context.createChildDataContext();
 
-        DataObject _new = context.createAndRegisterNewObject(Artist.class);
+        Persistent _new = context.newObject(Artist.class);
 
         Persistent hollow = context.localObject(new ObjectId(
                 "Artist",
@@ -203,8 +203,8 @@
         DataContext context = createDataContext();
         DataContext childContext = context.createChildDataContext();
 
-        Artist _new = (Artist) context.createAndRegisterNewObject(Artist.class);
-        Painting _newP = (Painting) context.createAndRegisterNewObject(Painting.class);
+        Artist _new = (Artist) context.newObject(Artist.class);
+        Painting _newP = (Painting) context.newObject(Painting.class);
         _new.addToPaintingArray(_newP);
 
         blockQueries();
@@ -230,7 +230,7 @@
 
         // test how different object states appear in the child on select
 
-        DataObject _new = parent.createAndRegisterNewObject(Artist.class);
+        Persistent _new = parent.newObject(Artist.class);
 
         Persistent hollow = parent.localObject(new ObjectId(
                 "Artist",
@@ -327,7 +327,7 @@
                 parent,
                 Painting.class,
                 newTargetSrcId);
-        Artist newTarget = (Artist) parent.createAndRegisterNewObject(Artist.class);
+        Artist newTarget = (Artist) parent.newObject(Artist.class);
         newTarget.setArtistName("N1");
         newTargetSrc.setToArtist(newTarget);
 

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/NestedDataContextValidationTst.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/NestedDataContextValidationTst.java?view=diff&rev=454624&r1=454623&r2=454624
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/NestedDataContextValidationTst.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/NestedDataContextValidationTst.java Mon Oct  9 22:46:56 2006
@@ -34,7 +34,7 @@
                 "Child context must have inherited the validation flag from parent",
                 childContext.isValidatingObjectsOnCommit());
 
-        Artist a1 = (Artist) childContext.createAndRegisterNewObject(Artist.class);
+        Artist a1 = (Artist) childContext.newObject(Artist.class);
         try {
             childContext.commitChangesToParent();
             fail("No validation was performed");

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/NumericTypesTst.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/NumericTypesTst.java?view=diff&rev=454624&r1=454623&r2=454624
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/NumericTypesTst.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/NumericTypesTst.java Mon Oct  9 22:46:56 2006
@@ -130,7 +130,7 @@
 
     public void testShortInInsert() throws Exception {
         SmallintTestEntity object = (SmallintTestEntity) context
-                .createAndRegisterNewObject("SmallintTestEntity");
+                .newObject("SmallintTestEntity");
         object.setSmallintCol(new Short("1"));
         context.commitChanges();
     }
@@ -150,7 +150,7 @@
 
     public void testTinyintInInsert() throws Exception {
         TinyintTestEntity object = (TinyintTestEntity) context
-                .createAndRegisterNewObject("TinyintTestEntity");
+                .newObject("TinyintTestEntity");
         object.setTinyintCol(new Byte((byte) 1));
         context.commitChanges();
     }
@@ -158,11 +158,9 @@
     public void testBooleanBit() throws Exception {
 
         // populate (testing insert as well)
-        BitTestEntity trueObject = (BitTestEntity) context
-                .createAndRegisterNewObject("BitTestEntity");
+        BitTestEntity trueObject = (BitTestEntity) context.newObject("BitTestEntity");
         trueObject.setBitColumn(Boolean.TRUE);
-        BitTestEntity falseObject = (BitTestEntity) context
-                .createAndRegisterNewObject("BitTestEntity");
+        BitTestEntity falseObject = (BitTestEntity) context.newObject("BitTestEntity");
         falseObject.setBitColumn(Boolean.FALSE);
         context.commitChanges();
 
@@ -201,10 +199,10 @@
 
         // populate (testing insert as well)
         BooleanTestEntity trueObject = (BooleanTestEntity) context
-                .createAndRegisterNewObject("BooleanTestEntity");
+                .newObject("BooleanTestEntity");
         trueObject.setBooleanColumn(Boolean.TRUE);
         BooleanTestEntity falseObject = (BooleanTestEntity) context
-                .createAndRegisterNewObject("BooleanTestEntity");
+                .newObject("BooleanTestEntity");
         falseObject.setBooleanColumn(Boolean.FALSE);
         context.commitChanges();
 
@@ -244,7 +242,7 @@
 
         // populate (testing insert as well)
         DecimalPKTestEntity object = (DecimalPKTestEntity) context
-                .createAndRegisterNewObject(DecimalPKTestEntity.class);
+                .newObject(DecimalPKTestEntity.class);
 
         object.setName("o1");
         object.setDecimalPK(new BigDecimal("1.25"));
@@ -258,8 +256,7 @@
     public void testDecimalPK1() throws Exception {
 
         // populate (testing insert as well)
-        DecimalPKTest1 object = (DecimalPKTest1) context
-                .createAndRegisterNewObject(DecimalPKTest1.class);
+        DecimalPKTest1 object = (DecimalPKTest1) context.newObject(DecimalPKTest1.class);
 
         object.setName("o2");
         object.setDecimalPK(new Double(1.25));

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/ObjectStoreTst.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/ObjectStoreTst.java?view=diff&rev=454624&r1=454623&r2=454624
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/ObjectStoreTst.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/ObjectStoreTst.java Mon Oct  9 22:46:56 2006
@@ -125,15 +125,15 @@
         DataContext context = createDataContext();
 
         // Create a gallery.
-        Gallery g = (Gallery) context.createAndRegisterNewObject(Gallery.class);
+        Gallery g = (Gallery) context.newObject(Gallery.class);
         g.setGalleryName("Test Gallery");
 
         // Create an artist in the same context.
-        Artist a = (Artist) context.createAndRegisterNewObject(Artist.class);
+        Artist a = (Artist) context.newObject(Artist.class);
         a.setArtistName("Test Artist");
 
         // Create a painting in the same context.
-        Painting p = (Painting) context.createAndRegisterNewObject(Painting.class);
+        Painting p = (Painting) context.newObject(Painting.class);
         p.setPaintingTitle("Test Painting");
 
         // Set the painting's gallery.

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/OptimisticLockingTst.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/OptimisticLockingTst.java?view=diff&rev=454624&r1=454623&r2=454624
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/OptimisticLockingTst.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/OptimisticLockingTst.java Mon Oct  9 22:46:56 2006
@@ -43,7 +43,8 @@
     public void testSuccessSimpleLockingOnDelete() throws Exception {
         createTestData("testSimpleLocking");
 
-        List allObjects = context.performQuery(new SelectQuery(SimpleLockingTestEntity.class));
+        List allObjects = context.performQuery(new SelectQuery(
+                SimpleLockingTestEntity.class));
         assertEquals(1, allObjects.size());
 
         SimpleLockingTestEntity object = (SimpleLockingTestEntity) allObjects.get(0);
@@ -59,7 +60,8 @@
     public void testSuccessSimpleLockingOnDeleteFollowedByInvalidate() throws Exception {
         createTestData("testSimpleLocking");
 
-        List allObjects = context.performQuery(new SelectQuery(SimpleLockingTestEntity.class));
+        List allObjects = context.performQuery(new SelectQuery(
+                SimpleLockingTestEntity.class));
         assertEquals(1, allObjects.size());
 
         SimpleLockingTestEntity object = (SimpleLockingTestEntity) allObjects.get(0);
@@ -77,7 +79,8 @@
             throws Exception {
         createTestData("testSimpleLocking");
 
-        List allObjects = context.performQuery(new SelectQuery(SimpleLockingTestEntity.class));
+        List allObjects = context.performQuery(new SelectQuery(
+                SimpleLockingTestEntity.class));
         assertEquals(1, allObjects.size());
 
         SimpleLockingTestEntity object = (SimpleLockingTestEntity) allObjects.get(0);
@@ -94,7 +97,8 @@
     public void testSuccessSimpleLockingOnDeletePrecededByInvalidate() throws Exception {
         createTestData("testSimpleLocking");
 
-        List allObjects = context.performQuery(new SelectQuery(SimpleLockingTestEntity.class));
+        List allObjects = context.performQuery(new SelectQuery(
+                SimpleLockingTestEntity.class));
         assertEquals(1, allObjects.size());
 
         SimpleLockingTestEntity object = (SimpleLockingTestEntity) allObjects.get(0);
@@ -112,7 +116,8 @@
             throws Exception {
         createTestData("testSimpleLocking");
 
-        List allObjects = context.performQuery(new SelectQuery(SimpleLockingTestEntity.class));
+        List allObjects = context.performQuery(new SelectQuery(
+                SimpleLockingTestEntity.class));
         assertEquals(1, allObjects.size());
 
         SimpleLockingTestEntity object = (SimpleLockingTestEntity) allObjects.get(0);
@@ -129,7 +134,8 @@
     public void testFailSimpleLockingOnDelete() throws Exception {
         createTestData("testSimpleLocking");
 
-        List allObjects = context.performQuery(new SelectQuery(SimpleLockingTestEntity.class));
+        List allObjects = context.performQuery(new SelectQuery(
+                SimpleLockingTestEntity.class));
         assertEquals(1, allObjects.size());
 
         SimpleLockingTestEntity object = (SimpleLockingTestEntity) allObjects.get(0);
@@ -155,7 +161,8 @@
     public void testSuccessSimpleLockingOnUpdate() throws Exception {
         createTestData("testSimpleLocking");
 
-        List allObjects = context.performQuery(new SelectQuery(SimpleLockingTestEntity.class));
+        List allObjects = context.performQuery(new SelectQuery(
+                SimpleLockingTestEntity.class));
         assertEquals(1, allObjects.size());
 
         SimpleLockingTestEntity object = (SimpleLockingTestEntity) allObjects.get(0);
@@ -172,7 +179,8 @@
     public void testSuccessSimpleLockingOnUpdateFollowedByInvalidate() throws Exception {
         createTestData("testSimpleLocking");
 
-        List allObjects = context.performQuery(new SelectQuery(SimpleLockingTestEntity.class));
+        List allObjects = context.performQuery(new SelectQuery(
+                SimpleLockingTestEntity.class));
         assertEquals(1, allObjects.size());
 
         SimpleLockingTestEntity object = (SimpleLockingTestEntity) allObjects.get(0);
@@ -190,7 +198,8 @@
     public void testSuccessSimpleLockingOnUpdatePrecededByInvalidate() throws Exception {
         createTestData("testSimpleLocking");
 
-        List allObjects = context.performQuery(new SelectQuery(SimpleLockingTestEntity.class));
+        List allObjects = context.performQuery(new SelectQuery(
+                SimpleLockingTestEntity.class));
         assertEquals(1, allObjects.size());
 
         SimpleLockingTestEntity object = (SimpleLockingTestEntity) allObjects.get(0);
@@ -209,7 +218,8 @@
             throws Exception {
         createTestData("testSimpleLocking");
 
-        List allObjects = context.performQuery(new SelectQuery(SimpleLockingTestEntity.class));
+        List allObjects = context.performQuery(new SelectQuery(
+                SimpleLockingTestEntity.class));
         assertEquals(1, allObjects.size());
 
         SimpleLockingTestEntity object = (SimpleLockingTestEntity) allObjects.get(0);
@@ -228,7 +238,8 @@
             throws Exception {
         createTestData("testSimpleLocking");
 
-        List allObjects = context.performQuery(new SelectQuery(SimpleLockingTestEntity.class));
+        List allObjects = context.performQuery(new SelectQuery(
+                SimpleLockingTestEntity.class));
         assertEquals(1, allObjects.size());
 
         SimpleLockingTestEntity object = (SimpleLockingTestEntity) allObjects.get(0);
@@ -246,7 +257,8 @@
     public void testFailSimpleLocking() throws Exception {
         createTestData("testSimpleLocking");
 
-        List allObjects = context.performQuery(new SelectQuery(SimpleLockingTestEntity.class));
+        List allObjects = context.performQuery(new SelectQuery(
+                SimpleLockingTestEntity.class));
         assertEquals(1, allObjects.size());
 
         SimpleLockingTestEntity object = (SimpleLockingTestEntity) allObjects.get(0);
@@ -272,7 +284,8 @@
     public void testFailLockingOnNull() throws Exception {
         createTestData("testLockingOnNull");
 
-        List allObjects = context.performQuery(new SelectQuery(SimpleLockingTestEntity.class));
+        List allObjects = context.performQuery(new SelectQuery(
+                SimpleLockingTestEntity.class));
         assertEquals(1, allObjects.size());
 
         SimpleLockingTestEntity object = (SimpleLockingTestEntity) allObjects.get(0);
@@ -321,7 +334,8 @@
     public void testFailLockingOnToOne() throws Exception {
         createTestData("testLockingOnToOne");
 
-        List allObjects = context.performQuery(new SelectQuery(RelLockingTestEntity.class));
+        List allObjects = context
+                .performQuery(new SelectQuery(RelLockingTestEntity.class));
         assertEquals(1, allObjects.size());
 
         RelLockingTestEntity object = (RelLockingTestEntity) allObjects.get(0);
@@ -332,7 +346,7 @@
 
         // change relationship and save... no optimistic lock failure expected
         SimpleLockingTestEntity object1 = (SimpleLockingTestEntity) context
-                .createAndRegisterNewObject(SimpleLockingTestEntity.class);
+                .newObject(SimpleLockingTestEntity.class);
         object.setToSimpleLockingTest(object1);
         context.commitChanges();
 
@@ -353,7 +367,8 @@
     public void testFailRetrieveRow() throws Exception {
         createTestData("testSimpleLocking");
 
-        List allObjects = context.performQuery(new SelectQuery(SimpleLockingTestEntity.class));
+        List allObjects = context.performQuery(new SelectQuery(
+                SimpleLockingTestEntity.class));
         assertEquals(1, allObjects.size());
 
         SimpleLockingTestEntity object = (SimpleLockingTestEntity) allObjects.get(0);
@@ -377,7 +392,8 @@
     public void testFailRetrieveDeletedRow() throws Exception {
         createTestData("testSimpleLocking");
 
-        List allObjects = context.performQuery(new SelectQuery(SimpleLockingTestEntity.class));
+        List allObjects = context.performQuery(new SelectQuery(
+                SimpleLockingTestEntity.class));
         assertEquals(1, allObjects.size());
 
         SimpleLockingTestEntity object = (SimpleLockingTestEntity) allObjects.get(0);

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/ToManyListTst.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/ToManyListTst.java?view=diff&rev=454624&r1=454623&r2=454624
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/ToManyListTst.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/ToManyListTst.java Mon Oct  9 22:46:56 2006
@@ -37,12 +37,12 @@
     }
 
     private ToManyList createForNewArtist() {
-        Artist artist = (Artist) context.createAndRegisterNewObject(Artist.class);
+        Artist artist = (Artist) context.newObject(Artist.class);
         return new ToManyList(artist, Artist.PAINTING_ARRAY_PROPERTY);
     }
 
     private ToManyList createForExistingArtist() {
-        Artist artist = (Artist) context.createAndRegisterNewObject(Artist.class);
+        Artist artist = (Artist) context.newObject(Artist.class);
         artist.setArtistName("aa");
         context.commitChanges();
         return new ToManyList(artist, Artist.PAINTING_ARRAY_PROPERTY);
@@ -54,11 +54,11 @@
                 .isFault());
         assertEquals(0, list.size());
 
-        Painting p1 = (Painting) context.createAndRegisterNewObject(Painting.class);
+        Painting p1 = (Painting) context.newObject(Painting.class);
         list.add(p1);
         assertEquals(1, list.size());
 
-        Painting p2 = (Painting) context.createAndRegisterNewObject(Painting.class);
+        Painting p2 = (Painting) context.newObject(Painting.class);
         list.add(p2);
         assertEquals(2, list.size());
 
@@ -76,19 +76,18 @@
 
         assertTrue("List must be unresolved for an existing object", list.isFault());
 
-        Painting p1 = (Painting) context.createAndRegisterNewObject(Painting.class);
+        Painting p1 = (Painting) context.newObject(Painting.class);
         list.add(p1);
         assertTrue("List must be unresolved when adding an object...", list.isFault());
         assertTrue(list.addedToUnresolved.contains(p1));
 
-        Painting p2 = (Painting) context.createAndRegisterNewObject(Painting.class);
+        Painting p2 = (Painting) context.newObject(Painting.class);
         list.add(p2);
         assertTrue("List must be unresolved when adding an object...", list.isFault());
         assertTrue(list.addedToUnresolved.contains(p2));
 
         list.remove(p1);
-        assertTrue("List must be unresolved when removing an object...", list
-                .isFault());
+        assertTrue("List must be unresolved when removing an object...", list.isFault());
         assertFalse(list.addedToUnresolved.contains(p1));
 
         // now resolve
@@ -101,7 +100,7 @@
     public void testSavedUnresolvedMerge() throws Exception {
         ToManyList list = createForExistingArtist();
 
-        Painting p1 = (Painting) context.createAndRegisterNewObject(Painting.class);
+        Painting p1 = (Painting) context.newObject(Painting.class);
         p1.setPaintingTitle("p1");
 
         // list being tested is a separate copy from
@@ -120,7 +119,7 @@
         assertTrue("List must be unresolved when adding an object...", list.isFault());
         assertTrue(list.addedToUnresolved.contains(p1));
 
-        Painting p2 = (Painting) context.createAndRegisterNewObject(Painting.class);
+        Painting p2 = (Painting) context.newObject(Painting.class);
         list.add(p2);
         assertTrue("List must be unresolved when adding an object...", list.isFault());
         assertTrue(list.addedToUnresolved.contains(p2));
@@ -136,9 +135,9 @@
     public void testThrowOutDeleted() throws Exception {
         ToManyList list = createForExistingArtist();
 
-        Painting p1 = (Painting) context.createAndRegisterNewObject(Painting.class);
+        Painting p1 = (Painting) context.newObject(Painting.class);
         p1.setPaintingTitle("p1");
-        Painting p2 = (Painting) context.createAndRegisterNewObject(Painting.class);
+        Painting p2 = (Painting) context.newObject(Painting.class);
         p2.setPaintingTitle("p2");
 
         // list being tested is a separate copy from
@@ -182,10 +181,10 @@
     }
 
     public void testRealRelationship() throws Exception {
-        Artist artist = (Artist) context.createAndRegisterNewObject(Artist.class);
+        Artist artist = (Artist) context.newObject(Artist.class);
         artist.setArtistName("aaa");
 
-        Painting p1 = (Painting) context.createAndRegisterNewObject(Painting.class);
+        Painting p1 = (Painting) context.newObject(Painting.class);
         p1.setPaintingTitle("p1");
 
         context.commitChanges();
@@ -194,7 +193,7 @@
         ToManyList list = (ToManyList) artist.getPaintingArray();
         assertTrue("List must be unresolved...", list.isFault());
 
-        Painting p2 = (Painting) context.createAndRegisterNewObject(Painting.class);
+        Painting p2 = (Painting) context.newObject(Painting.class);
         p2.setPaintingTitle("p2");
 
         artist.addToPaintingArray(p1);
@@ -213,10 +212,10 @@
     }
 
     public void testRealRelationshipRollback() throws Exception {
-        Artist artist = (Artist) context.createAndRegisterNewObject(Artist.class);
+        Artist artist = (Artist) context.newObject(Artist.class);
         artist.setArtistName("aaa");
 
-        Painting p1 = (Painting) context.createAndRegisterNewObject(Painting.class);
+        Painting p1 = (Painting) context.newObject(Painting.class);
         p1.setPaintingTitle("p1");
         artist.addToPaintingArray(p1);
         context.commitChanges();
@@ -225,7 +224,7 @@
         ToManyList list = (ToManyList) artist.getPaintingArray();
         assertTrue("List must be unresolved...", list.isFault());
 
-        Painting p2 = (Painting) context.createAndRegisterNewObject(Painting.class);
+        Painting p2 = (Painting) context.newObject(Painting.class);
 
         artist.addToPaintingArray(p2);
         assertTrue("List must be unresolved...", list.isFault());

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/TransactionThreadTst.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/TransactionThreadTst.java?view=diff&rev=454624&r1=454623&r2=454624
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/TransactionThreadTst.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/TransactionThreadTst.java Mon Oct  9 22:46:56 2006
@@ -55,7 +55,7 @@
     public void testThreadConnectionReuseOnQueryFromWillCommit() throws Exception {
         deleteTestData();
 
-        Artist a = (Artist) createDataContext().createAndRegisterNewObject(Artist.class);
+        Artist a = (Artist) createDataContext().newObject(Artist.class);
         a.setArtistName("aaa");
 
         Delegate delegate = new Delegate() {

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/UserTransactionTst.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/UserTransactionTst.java?view=diff&rev=454624&r1=454623&r2=454624
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/UserTransactionTst.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/UserTransactionTst.java Mon Oct  9 22:46:56 2006
@@ -29,7 +29,7 @@
     public void testCommit() throws Exception {
         DataContext context = createDataContext();
 
-        Artist a = (Artist) context.createAndRegisterNewObject(Artist.class);
+        Artist a = (Artist) context.newObject(Artist.class);
         a.setArtistName("AAA");
 
         final boolean[] willAddConnectionCalled = new boolean[1];

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/exp/parser/ExpressionEvaluateInMemoryTst.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/exp/parser/ExpressionEvaluateInMemoryTst.java?view=diff&rev=454624&r1=454623&r2=454624
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/exp/parser/ExpressionEvaluateInMemoryTst.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/exp/parser/ExpressionEvaluateInMemoryTst.java Mon Oct  9 22:46:56 2006
@@ -144,11 +144,11 @@
 
     public void testEvaluateEQUAL_TODataObject() throws Exception {
         DataContext context = createDataContext();
-        Artist a1 = (Artist) context.createAndRegisterNewObject("Artist");
-        Artist a2 = (Artist) context.createAndRegisterNewObject("Artist");
-        Painting p1 = (Painting) context.createAndRegisterNewObject("Painting");
-        Painting p2 = (Painting) context.createAndRegisterNewObject("Painting");
-        Painting p3 = (Painting) context.createAndRegisterNewObject("Painting");
+        Artist a1 = (Artist) context.newObject("Artist");
+        Artist a2 = (Artist) context.newObject("Artist");
+        Painting p1 = (Painting) context.newObject("Painting");
+        Painting p2 = (Painting) context.newObject("Painting");
+        Painting p3 = (Painting) context.newObject("Painting");
 
         p1.setToArtist(a1);
         p2.setToArtist(a2);

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/map/EntityResolverTst.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/map/EntityResolverTst.java?view=diff&rev=454624&r1=454623&r2=454624
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/map/EntityResolverTst.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/map/EntityResolverTst.java Mon Oct  9 22:46:56 2006
@@ -17,7 +17,6 @@
  *  under the License.
  ****************************************************************/
 
-
 package org.apache.cayenne.map;
 
 import java.util.ArrayList;
@@ -113,8 +112,7 @@
 
     public void testLookupDbEntityByDataobject() throws Exception {
         EntityResolver resolver = new EntityResolver(getDomain().getDataMaps());
-        Artist artist = (Artist) this.createDataContext().createAndRegisterNewObject(
-                "Artist");
+        Artist artist = (Artist) this.createDataContext().newObject("Artist");
         assertIsArtistDbEntity(resolver.lookupDbEntity(artist));
     }
 
@@ -137,8 +135,7 @@
 
     public void testLookupObjEntityByDataobject() {
         EntityResolver resolver = new EntityResolver(getDomain().getDataMaps());
-        Artist artist = (Artist) this.createDataContext().createAndRegisterNewObject(
-                "Artist");
+        Artist artist = (Artist) this.createDataContext().newObject("Artist");
         assertIsArtistObjEntity(resolver.lookupObjEntity(artist));
     }
 

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/unit/TestDataDomainTst.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/unit/TestDataDomainTst.java?view=diff&rev=454624&r1=454623&r2=454624
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/unit/TestDataDomainTst.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/unit/TestDataDomainTst.java Mon Oct  9 22:46:56 2006
@@ -75,7 +75,7 @@
         DataContext context = createDataContext();
         assertSame(getDomain(), context.getParentDataDomain());
 
-        Artist a = (Artist) context.createAndRegisterNewObject(Artist.class);
+        Artist a = (Artist) context.newObject(Artist.class);
         a.setArtistName("aa");
         context.commitChanges();
 
@@ -100,10 +100,9 @@
         DataContext context = createDataContext();
         assertSame(getDomain(), context.getParentDataDomain());
 
-        Painting p = (Painting) context.createAndRegisterNewObject(Painting.class);
+        Painting p = (Painting) context.newObject(Painting.class);
         p.setPaintingTitle("aaaa");
-        PaintingInfo pi = (PaintingInfo) context
-                .createAndRegisterNewObject(PaintingInfo.class);
+        PaintingInfo pi = (PaintingInfo) context.newObject(PaintingInfo.class);
         pi.setPainting(p);
         context.commitChanges();
 



Mime
View raw message