cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r1151985 - /cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/
Date Thu, 28 Jul 2011 19:49:36 GMT
Author: aadamchik
Date: Thu Jul 28 19:49:33 2011
New Revision: 1151985

URL: http://svn.apache.org/viewvc?rev=1151985&view=rev
Log:
clearing up JDBC use to address Oracle shortcomings

Oracle failures are down: Tests run: 2087, Failures: 13, Errors: 71, Skipped: 0

Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextEJBQLArrayResultTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextEJBQLConditionsTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextEJBQLFetchJoinTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextEJBQLOrderByTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextEJBQLQueryTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextEJBQLSubqueryTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextEJBQLUpdateTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextExtrasTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextFlattenedAttributesTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextObjectTrackingTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextPerformQueryAPITest.java

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextEJBQLArrayResultTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextEJBQLArrayResultTest.java?rev=1151985&r1=1151984&r2=1151985&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextEJBQLArrayResultTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextEJBQLArrayResultTest.java
Thu Jul 28 19:49:33 2011
@@ -19,6 +19,7 @@
 package org.apache.cayenne.access;
 
 import java.math.BigDecimal;
+import java.sql.Types;
 import java.util.List;
 
 import org.apache.cayenne.ObjectContext;
@@ -59,7 +60,11 @@ public class DataContextEJBQLArrayResult
                 "PAINTING_ID",
                 "ARTIST_ID",
                 "PAINTING_TITLE",
-                "ESTIMATED_PRICE");
+                "ESTIMATED_PRICE").setColumnTypes(
+                Types.INTEGER,
+                Types.BIGINT,
+                Types.VARCHAR,
+                Types.DECIMAL);
         tPainting.insert(33001, 33001, "P1", 3000);
         tPainting.insert(33002, 33002, "P2", 5000);
         tPainting.insert(33003, null, "P3", 5000);

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextEJBQLConditionsTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextEJBQLConditionsTest.java?rev=1151985&r1=1151984&r2=1151985&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextEJBQLConditionsTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextEJBQLConditionsTest.java
Thu Jul 28 19:49:33 2011
@@ -19,6 +19,7 @@
 package org.apache.cayenne.access;
 
 import java.math.BigDecimal;
+import java.sql.Types;
 import java.util.Date;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -66,7 +67,11 @@ public class DataContextEJBQLConditionsT
                 "PAINTING_ID",
                 "ARTIST_ID",
                 "PAINTING_TITLE",
-                "ESTIMATED_PRICE");
+                "ESTIMATED_PRICE").setColumnTypes(
+                Types.INTEGER,
+                Types.BIGINT,
+                Types.VARCHAR,
+                Types.DECIMAL);
     }
 
     protected void createCollectionDataSet() throws Exception {
@@ -246,18 +251,20 @@ public class DataContextEJBQLConditionsT
 
         assertTrue(ids.contains(new Integer(33005)));
     }
-    
+
     public void testLikeNullParameter() {
         Artist a1 = context.newObject(Artist.class);
         a1.setArtistName("a1");
         a1.setDateOfBirth(null);
         context.commitChanges();
-        
-        EJBQLQuery eq1 = new EJBQLQuery("select a from Artist a where a.dateOfBirth like
:param");
+
+        EJBQLQuery eq1 = new EJBQLQuery(
+                "select a from Artist a where a.dateOfBirth like :param");
         eq1.setParameter("param", null);
         assertNotNull(Cayenne.objectForQuery(context, eq1));
-        
-        EJBQLQuery eq2 = new EJBQLQuery("select a from Artist a where a.dateOfBirth like
?1");
+
+        EJBQLQuery eq2 = new EJBQLQuery(
+                "select a from Artist a where a.dateOfBirth like ?1");
         eq2.setParameter(1, null);
         assertNotNull(Cayenne.objectForQuery(context, eq2));
     }
@@ -465,5 +472,5 @@ public class DataContextEJBQLConditionsT
         assertTrue(ids.contains(new Integer(33009)));
         assertTrue(ids.contains(new Integer(33010)));
     }
-    
+
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextEJBQLFetchJoinTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextEJBQLFetchJoinTest.java?rev=1151985&r1=1151984&r2=1151985&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextEJBQLFetchJoinTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextEJBQLFetchJoinTest.java
Thu Jul 28 19:49:33 2011
@@ -19,6 +19,7 @@
 package org.apache.cayenne.access;
 
 import java.sql.Date;
+import java.sql.Types;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
@@ -76,7 +77,11 @@ public class DataContextEJBQLFetchJoinTe
                 "PAINTING_ID",
                 "ARTIST_ID",
                 "PAINTING_TITLE",
-                "ESTIMATED_PRICE");
+                "ESTIMATED_PRICE").setColumnTypes(
+                Types.INTEGER,
+                Types.BIGINT,
+                Types.VARCHAR,
+                Types.DECIMAL);
 
         tGallery = new TableHelper(dbHelper, "GALLERY");
         tGallery.setColumns("GALLERY_ID", "GALLERY_NAME");

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextEJBQLOrderByTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextEJBQLOrderByTest.java?rev=1151985&r1=1151984&r2=1151985&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextEJBQLOrderByTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextEJBQLOrderByTest.java
Thu Jul 28 19:49:33 2011
@@ -18,6 +18,7 @@
  ****************************************************************/
 package org.apache.cayenne.access;
 
+import java.sql.Types;
 import java.util.List;
 
 import org.apache.cayenne.Cayenne;
@@ -58,7 +59,11 @@ public class DataContextEJBQLOrderByTest
                 "PAINTING_ID",
                 "ARTIST_ID",
                 "PAINTING_TITLE",
-                "ESTIMATED_PRICE");
+                "ESTIMATED_PRICE").setColumnTypes(
+                Types.INTEGER,
+                Types.BIGINT,
+                Types.VARCHAR,
+                Types.DECIMAL);
     }
 
     private void createThreePaintings() throws Exception {
@@ -73,7 +78,7 @@ public class DataContextEJBQLOrderByTest
         tPainting.insert(33003, null, "C", 1000);
         tPainting.insert(33004, null, "C", 500);
     }
-    
+
     private void createTwoArtistsTwoPaintings() throws Exception {
         tArtist.insert(33001, "A");
         tArtist.insert(33002, "B");

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextEJBQLQueryTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextEJBQLQueryTest.java?rev=1151985&r1=1151984&r2=1151985&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextEJBQLQueryTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextEJBQLQueryTest.java
Thu Jul 28 19:49:33 2011
@@ -19,6 +19,7 @@
 package org.apache.cayenne.access;
 
 import java.math.BigDecimal;
+import java.sql.Types;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -79,7 +80,11 @@ public class DataContextEJBQLQueryTest e
                 "PAINTING_ID",
                 "ARTIST_ID",
                 "PAINTING_TITLE",
-                "ESTIMATED_PRICE");
+                "ESTIMATED_PRICE").setColumnTypes(
+                Types.INTEGER,
+                Types.BIGINT,
+                Types.VARCHAR,
+                Types.DECIMAL);
 
         tCompoundPk = new TableHelper(dbHelper, "COMPOUND_PK_TEST");
         tCompoundPk.setColumns("KEY1", "KEY2");
@@ -114,8 +119,8 @@ public class DataContextEJBQLQueryTest e
         LifecycleCallbackRegistry existingCallbacks = context
                 .getEntityResolver()
                 .getCallbackRegistry();
-        LifecycleCallbackRegistry testCallbacks = new LifecycleCallbackRegistry(context
-                .getEntityResolver());
+        LifecycleCallbackRegistry testCallbacks = new LifecycleCallbackRegistry(
+                context.getEntityResolver());
 
         DataContextEJBQLQueryCallback listener = new DataContextEJBQLQueryCallback();
         testCallbacks.addDefaultListener(LifecycleEvent.POST_LOAD, listener, "postLoad");

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextEJBQLSubqueryTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextEJBQLSubqueryTest.java?rev=1151985&r1=1151984&r2=1151985&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextEJBQLSubqueryTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextEJBQLSubqueryTest.java
Thu Jul 28 19:49:33 2011
@@ -18,6 +18,7 @@
  ****************************************************************/
 package org.apache.cayenne.access;
 
+import java.sql.Types;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
@@ -67,7 +68,11 @@ public class DataContextEJBQLSubqueryTes
                 "PAINTING_ID",
                 "ARTIST_ID",
                 "PAINTING_TITLE",
-                "ESTIMATED_PRICE");
+                "ESTIMATED_PRICE").setColumnTypes(
+                Types.INTEGER,
+                Types.BIGINT,
+                Types.VARCHAR,
+                Types.DECIMAL);
     }
 
     private void createTwoArtistsFourPaintings() throws Exception {

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextEJBQLUpdateTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextEJBQLUpdateTest.java?rev=1151985&r1=1151984&r2=1151985&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextEJBQLUpdateTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextEJBQLUpdateTest.java
Thu Jul 28 19:49:33 2011
@@ -18,6 +18,7 @@
  ****************************************************************/
 package org.apache.cayenne.access;
 
+import java.sql.Types;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -67,7 +68,11 @@ public class DataContextEJBQLUpdateTest 
                 "PAINTING_ID",
                 "ARTIST_ID",
                 "PAINTING_TITLE",
-                "ESTIMATED_PRICE");
+                "ESTIMATED_PRICE").setColumnTypes(
+                Types.INTEGER,
+                Types.BIGINT,
+                Types.VARCHAR,
+                Types.DECIMAL);
 
         tCompoundPk = new TableHelper(dbHelper, "COMPOUND_PK_TEST");
         tCompoundPk.setColumns("KEY1", "KEY2");

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextExtrasTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextExtrasTest.java?rev=1151985&r1=1151984&r2=1151985&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextExtrasTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextExtrasTest.java
Thu Jul 28 19:49:33 2011
@@ -19,6 +19,7 @@
 
 package org.apache.cayenne.access;
 
+import java.sql.Types;
 import java.util.Collections;
 import java.util.Date;
 import java.util.List;
@@ -54,7 +55,7 @@ public class DataContextExtrasTest exten
 
     @Inject
     protected DBHelper dbHelper;
-    
+
     @Inject
     protected JdbcEventLogger logger;
 
@@ -76,9 +77,13 @@ public class DataContextExtrasTest exten
         tPainting = new TableHelper(dbHelper, "PAINTING");
         tPainting.setColumns(
                 "PAINTING_ID",
-                "PAINTING_TITLE",
                 "ARTIST_ID",
-                "ESTIMATED_PRICE");
+                "PAINTING_TITLE",
+                "ESTIMATED_PRICE").setColumnTypes(
+                Types.INTEGER,
+                Types.BIGINT,
+                Types.VARCHAR,
+                Types.DECIMAL);
     }
 
     protected void createPhantomModificationDataSet() throws Exception {
@@ -88,7 +93,7 @@ public class DataContextExtrasTest exten
 
     protected void createPhantomModificationsValidateToOneDataSet() throws Exception {
         tArtist.insert(33001, "artist1");
-        tPainting.insert(33001, "P1", 33001, 3000);
+        tPainting.insert(33001, 33001, "P1", 3000);
     }
 
     protected void createValidateOnToManyChangeDataSet() throws Exception {
@@ -98,7 +103,7 @@ public class DataContextExtrasTest exten
     protected void createPhantomRelationshipModificationCommitDataSet() throws Exception
{
         tArtist.insert(33001, "artist1");
         tArtist.insert(33002, "artist2");
-        tPainting.insert(33001, "P1", 33001, 3000);
+        tPainting.insert(33001, 33001, "P1", 3000);
     }
 
     public void testManualIdProcessingOnCommit() throws Exception {
@@ -163,8 +168,9 @@ public class DataContextExtrasTest exten
         DataContext context = (DataContext) this.context;
         assertTrue("No changes expected in context", !context.hasChanges());
         context.newObject("Artist");
-        assertTrue("Object added to context, expected to report changes", context
-                .hasChanges());
+        assertTrue(
+                "Object added to context, expected to report changes",
+                context.hasChanges());
     }
 
     public void testNewObject() {
@@ -328,8 +334,9 @@ public class DataContextExtrasTest exten
         p1.resetValidationFlags();
         context.commitChanges();
 
-        assertFalse("To-one relationship presence caused incorrect validation call.", p1
-                .isValidateForSaveCalled());
+        assertFalse(
+                "To-one relationship presence caused incorrect validation call.",
+                p1.isValidateForSaveCalled());
     }
 
     public void testValidateOnToManyChange() throws Exception {

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextFlattenedAttributesTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextFlattenedAttributesTest.java?rev=1151985&r1=1151984&r2=1151985&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextFlattenedAttributesTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextFlattenedAttributesTest.java
Thu Jul 28 19:49:33 2011
@@ -20,6 +20,7 @@
 package org.apache.cayenne.access;
 
 import java.math.BigDecimal;
+import java.sql.Types;
 import java.util.Iterator;
 import java.util.List;
 
@@ -69,7 +70,12 @@ public class DataContextFlattenedAttribu
                 "PAINTING_TITLE",
                 "ARTIST_ID",
                 "ESTIMATED_PRICE",
-                "GALLERY_ID");
+                "GALLERY_ID").setColumnTypes(
+                Types.INTEGER,
+                Types.VARCHAR,
+                Types.BIGINT,
+                Types.DECIMAL,
+                Types.INTEGER);
 
         TableHelper tPaintingInfo = new TableHelper(dbHelper, "PAINTING_INFO");
         tPaintingInfo.setColumns("PAINTING_ID", "TEXT_REVIEW");
@@ -113,8 +119,9 @@ public class DataContextFlattenedAttribu
 
         assertNotNull(objects);
         assertEquals(8, objects.size());
-        assertTrue("CompoundPainting expected, got " + objects.get(0).getClass(), objects
-                .get(0) instanceof CompoundPainting);
+        assertTrue(
+                "CompoundPainting expected, got " + objects.get(0).getClass(),
+                objects.get(0) instanceof CompoundPainting);
 
         for (Iterator<?> i = objects.iterator(); i.hasNext();) {
             CompoundPainting painting = (CompoundPainting) i.next();
@@ -122,16 +129,18 @@ public class DataContextFlattenedAttribu
                     .getObjectId()
                     .getIdSnapshot()
                     .get("PAINTING_ID");
-            assertEquals("CompoundPainting.getPaintingTitle(): "
-                    + painting.getPaintingTitle(), "painting" + id, painting
-                    .getPaintingTitle());
+            assertEquals(
+                    "CompoundPainting.getPaintingTitle(): " + painting.getPaintingTitle(),
+                    "painting" + id,
+                    painting.getPaintingTitle());
             if (painting.getToPaintingInfo() == null) {
                 assertNull(painting.getTextReview());
             }
             else {
-                assertEquals("CompoundPainting.getTextReview(): "
-                        + painting.getTextReview(), "painting review" + id, painting
-                        .getTextReview());
+                assertEquals(
+                        "CompoundPainting.getTextReview(): " + painting.getTextReview(),
+                        "painting review" + id,
+                        painting.getTextReview());
             }
             assertEquals(
                     "CompoundPainting.getArtistName(): " + painting.getArtistName(),
@@ -141,10 +150,10 @@ public class DataContextFlattenedAttribu
                 assertNull(painting.getGalleryName());
             }
             else {
-                assertEquals("CompoundPainting.getGalleryName(): "
-                        + painting.getGalleryName(), painting
-                        .getToGallery()
-                        .getGalleryName(), painting.getGalleryName());
+                assertEquals(
+                        "CompoundPainting.getGalleryName(): " + painting.getGalleryName(),
+                        painting.getToGallery().getGalleryName(),
+                        painting.getGalleryName());
             }
         }
     }
@@ -155,14 +164,16 @@ public class DataContextFlattenedAttribu
     // 14/01/2010 now it uses LEFT JOIN
     public void testSelectCompound2() throws Exception {
         createTestDataSet();
-        SelectQuery query = new SelectQuery(CompoundPainting.class, ExpressionFactory
-                .matchExp("artistName", "artist2"));
+        SelectQuery query = new SelectQuery(
+                CompoundPainting.class,
+                ExpressionFactory.matchExp("artistName", "artist2"));
         List<?> objects = context.performQuery(query);
 
         assertNotNull(objects);
         assertEquals(2, objects.size());
-        assertTrue("CompoundPainting expected, got " + objects.get(0).getClass(), objects
-                .get(0) instanceof CompoundPainting);
+        assertTrue(
+                "CompoundPainting expected, got " + objects.get(0).getClass(),
+                objects.get(0) instanceof CompoundPainting);
 
         for (Iterator<?> i = objects.iterator(); i.hasNext();) {
             CompoundPainting painting = (CompoundPainting) i.next();
@@ -201,8 +212,9 @@ public class DataContextFlattenedAttribu
 
         assertNotNull(objects);
         assertEquals(2, objects.size());
-        assertTrue("CompoundPainting expected, got " + objects.get(0).getClass(), objects
-                .get(0) instanceof CompoundPainting);
+        assertTrue(
+                "CompoundPainting expected, got " + objects.get(0).getClass(),
+                objects.get(0) instanceof CompoundPainting);
         Iterator<?> i = objects.iterator();
         while (i.hasNext()) {
             CompoundPainting painting = (CompoundPainting) i.next();

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextObjectTrackingTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextObjectTrackingTest.java?rev=1151985&r1=1151984&r2=1151985&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextObjectTrackingTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextObjectTrackingTest.java
Thu Jul 28 19:49:33 2011
@@ -19,6 +19,7 @@
 
 package org.apache.cayenne.access;
 
+import java.sql.Types;
 import java.util.Collections;
 import java.util.Date;
 
@@ -76,9 +77,13 @@ public class DataContextObjectTrackingTe
         tPainting = new TableHelper(dbHelper, "PAINTING");
         tPainting.setColumns(
                 "PAINTING_ID",
-                "PAINTING_TITLE",
                 "ARTIST_ID",
-                "ESTIMATED_PRICE");
+                "PAINTING_TITLE",
+                "ESTIMATED_PRICE").setColumnTypes(
+                Types.INTEGER,
+                Types.BIGINT,
+                Types.VARCHAR,
+                Types.DECIMAL);
     }
 
     protected void createArtistsDataSet() throws Exception {
@@ -90,7 +95,7 @@ public class DataContextObjectTrackingTe
 
     protected void createMixedDataSet() throws Exception {
         tArtist.insert(33003, "artist3");
-        tPainting.insert(33003, "P_artist3", 33003, 3000);
+        tPainting.insert(33003, 33003, "P_artist3", 3000);
     }
 
     public void testUnregisterObject() {
@@ -207,8 +212,9 @@ public class DataContextObjectTrackingTe
                 assertSame(peerContext, hollowPeer.getObjectContext());
                 assertSame(context, hollow.getObjectContext());
 
-                Persistent committedPeer = peerContext.localObject(committed
-                        .getObjectId(), null);
+                Persistent committedPeer = peerContext.localObject(
+                        committed.getObjectId(),
+                        null);
                 assertEquals(PersistenceState.HOLLOW, committedPeer.getPersistenceState());
                 assertEquals(committed.getObjectId(), committedPeer.getObjectId());
                 assertSame(peerContext, committedPeer.getObjectContext());
@@ -270,8 +276,9 @@ public class DataContextObjectTrackingTe
                         null);
 
                 assertSame(peerModified, peerModified2);
-                assertEquals(PersistenceState.MODIFIED, peerModified2
-                        .getPersistenceState());
+                assertEquals(
+                        PersistenceState.MODIFIED,
+                        peerModified2.getPersistenceState());
                 assertEquals("M2", peerModified.getArtistName());
                 assertEquals("M1", modified.getArtistName());
             }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextPerformQueryAPITest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextPerformQueryAPITest.java?rev=1151985&r1=1151984&r2=1151985&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextPerformQueryAPITest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextPerformQueryAPITest.java
Thu Jul 28 19:49:33 2011
@@ -20,6 +20,7 @@
 package org.apache.cayenne.access;
 
 import java.math.BigDecimal;
+import java.sql.Types;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
@@ -75,9 +76,13 @@ public class DataContextPerformQueryAPIT
         tPainting = new TableHelper(dbHelper, "PAINTING");
         tPainting.setColumns(
                 "PAINTING_ID",
-                "PAINTING_TITLE",
                 "ARTIST_ID",
-                "ESTIMATED_PRICE");
+                "PAINTING_TITLE",
+                "ESTIMATED_PRICE").setColumnTypes(
+                Types.INTEGER,
+                Types.BIGINT,
+                Types.VARCHAR,
+                Types.DECIMAL);
     }
 
     private void createTwoArtists() throws Exception {
@@ -88,8 +93,8 @@ public class DataContextPerformQueryAPIT
     private void createTwoArtistsAndTwoPaintingsDataSet() throws Exception {
         tArtist.insert(11, "artist2");
         tArtist.insert(101, "artist3");
-        tPainting.insert(6, "p_artist3", 101, 1000);
-        tPainting.insert(7, "p_artist2", 11, 2000);
+        tPainting.insert(6, 101, "p_artist3", 1000);
+        tPainting.insert(7, 11, "p_artist2", 2000);
     }
 
     public void testObjectQueryStringBoolean() throws Exception {
@@ -148,8 +153,12 @@ public class DataContextPerformQueryAPIT
         assertEquals(1, artists.size());
 
         Artist artist = (Artist) artists.get(0);
-        assertEquals(11, ((Number) artist.getObjectId().getIdSnapshot().get(
-                Artist.ARTIST_ID_PK_COLUMN)).intValue());
+        assertEquals(
+                11,
+                ((Number) artist
+                        .getObjectId()
+                        .getIdSnapshot()
+                        .get(Artist.ARTIST_ID_PK_COLUMN)).intValue());
     }
 
     public void testNonSelectingQueryString() throws Exception {



Mime
View raw message