cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r594616 - in /cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src: main/java/org/apache/cayenne/access/IncrementalFaultList.java test/java/org/apache/cayenne/access/IncrementalFaultListTest.java
Date Tue, 13 Nov 2007 19:38:38 GMT
Author: aadamchik
Date: Tue Nov 13 11:38:37 2007
New Revision: 594616

URL: http://svn.apache.org/viewvc?rev=594616&view=rev
Log:
CAY-918 An exception during in-memory sorting of IncrementalFaultList

Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/IncrementalFaultList.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/test/java/org/apache/cayenne/access/IncrementalFaultListTest.java

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/IncrementalFaultList.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/IncrementalFaultList.java?rev=594616&r1=594615&r2=594616&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/IncrementalFaultList.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/IncrementalFaultList.java
Tue Nov 13 11:38:37 2007
@@ -941,7 +941,7 @@
         }
 
         public void set(Object o) {
-            throw new UnsupportedOperationException("set operation not supported");
+            IncrementalFaultList.this.set(listIndex - 1, o);
         }
     }
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/test/java/org/apache/cayenne/access/IncrementalFaultListTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/test/java/org/apache/cayenne/access/IncrementalFaultListTest.java?rev=594616&r1=594615&r2=594616&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/test/java/org/apache/cayenne/access/IncrementalFaultListTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/test/java/org/apache/cayenne/access/IncrementalFaultListTest.java
Tue Nov 13 11:38:37 2007
@@ -117,6 +117,22 @@
         }
     }
 
+    public void testSort() throws Exception {
+        prepareList(6);
+
+        new Ordering(Artist.ARTIST_NAME_PROPERTY, Ordering.DESC).orderList(list);
+
+        Iterator it = list.iterator();
+        Artist previousArtist = null;
+        while (it.hasNext()) {
+            Artist artist = (Artist) it.next();
+            if (previousArtist != null) {
+                assertTrue(previousArtist.getArtistName().compareTo(
+                        artist.getArtistName()) > 0);
+            }
+        }
+    }
+
     public void testUnfetchedObjects() throws Exception {
         prepareList(6);
         assertEquals(DataContextTest.artistCount, list.getUnfetchedObjects());
@@ -175,7 +191,7 @@
 
         assertNotNull(a0);
         assertTrue(list.elements.get(0) instanceof Artist);
-        
+
         Object a = list.get(8);
 
         assertNotNull(a);



Mime
View raw message