← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16676: Fixed failing test in IdentifiableObjectManagerTest

 

------------------------------------------------------------
revno: 16676
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2014-09-09 18:38:23 -0400
message:
  Fixed failing test in IdentifiableObjectManagerTest
modified:
  dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/common/IdentifiableObjectManagerTest.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/common/IdentifiableObjectManagerTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/common/IdentifiableObjectManagerTest.java	2014-09-09 07:32:11 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/common/IdentifiableObjectManagerTest.java	2014-09-09 22:38:23 +0000
@@ -232,13 +232,23 @@
         assertEquals( "DataElementD", dataElements.get( 3 ).getName() );
     }
 
+    /**
+     * Fetch all in between creating data elements to avoid equal last updated date.
+     */
     @Test
     public void getAllOrderedLastUpdated()
     {
         identifiableObjectManager.save( createDataElement( 'A' ) );
+        assertNotNull( identifiableObjectManager.getAllSortedByLastUpdated( DataElement.class ) );
+        
         identifiableObjectManager.save( createDataElement( 'B' ) );
+        assertNotNull( identifiableObjectManager.getAllSortedByLastUpdated( DataElement.class ) );
+        
         identifiableObjectManager.save( createDataElement( 'C' ) );
+        assertNotNull( identifiableObjectManager.getAllSortedByLastUpdated( DataElement.class ) );
+        
         identifiableObjectManager.save( createDataElement( 'D' ) );
+        assertNotNull( identifiableObjectManager.getAllSortedByLastUpdated( DataElement.class ) );
 
         List<DataElement> dataElements = new ArrayList<>( identifiableObjectManager.getAllSortedByLastUpdated( DataElement.class ) );