continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tryg...@apache.org
Subject svn commit: r209643 - in /maven/continuum/trunk/continuum-core/src: main/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStore.java test/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStoreTest.java
Date Thu, 07 Jul 2005 20:50:02 GMT
Author: trygvis
Date: Thu Jul  7 13:49:59 2005
New Revision: 209643

URL: http://svn.apache.org/viewcvs?rev=209643&view=rev
Log:
o Fixing a bug in getLatestBuildForProject(). Sorting by String fields isn't
  smart.

Modified:
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStore.java
    maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStoreTest.java

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStore.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStore.java?rev=209643&r1=209642&r2=209643&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStore.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStore.java
Thu Jul  7 13:49:59 2005
@@ -374,7 +374,7 @@
             Query q = pm.newQuery( ContinuumBuild.class );
             q.declareParameters( "String projectId" );
             q.setFilter( "this.project.id == projectId" );
-            q.setOrdering( "id asc" );
+            q.setOrdering( "startTime descending" );
             Collection builds = (Collection) q.execute( projectId );
 
             if ( builds.size() == 0 )

Modified: maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStoreTest.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStoreTest.java?rev=209643&r1=209642&r2=209643&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStoreTest.java
(original)
+++ maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStoreTest.java
Thu Jul  7 13:49:59 2005
@@ -609,7 +609,7 @@
 
         assertNotNull( build );
 
-        assertEquals( build.getId(), (String) expectedBuilds.get( 9 ) );
+        assertEquals( build.getId(), (String) expectedBuilds.get( 0 ) );
 
         Collection actualBuilds = store.getBuildsForProject( projectId, 0, 0 );
 
@@ -634,11 +634,13 @@
     {
         String projectId = addMavenTwoProject( "Association Test Project", "scm:association"
);
 
+        int size = 10;
+
         List expectedBuilds = new ArrayList();
 
-        for ( int i = 0; i < 10; i++ )
+        for ( int i = 0; i < size; i++ )
         {
-            expectedBuilds.add( 0, createBuild( store, projectId, false ) );
+            expectedBuilds.add( createBuild( store, projectId, false ) );
         }
 
         // ----------------------------------------------------------------------
@@ -649,11 +651,13 @@
 
         assertNotNull( build );
 
-        assertEquals( build.getId(), (String) expectedBuilds.get( 9 ) );
+        assertEquals( build.getId(), (String) expectedBuilds.get( size - 1 ) );
 
         Collection actualBuilds = store.getBuildsForProject( projectId, 0, 0 );
 
-        assertEquals( 10, actualBuilds.size() );
+        assertEquals( build.getId(), ( (ContinuumBuild) actualBuilds.iterator().next() ).getId()
);
+
+        assertEquals( size, actualBuilds.size() );
     }
 
     public void testBuildResult()



Mime
View raw message