← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1328: Added unit test for getDataElementsByZeroIsSignificant.

 

------------------------------------------------------------
revno: 1328
committer: Lars Helge Oeverland <larshelge@xxxxxxxxx>
branch nick: trunk
timestamp: Fri 2010-01-22 11:15:02 +0100
message:
  Added unit test for getDataElementsByZeroIsSignificant.
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java
  dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataelement/DataElementStoreTest.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/index.vm


--
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-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java	2010-01-22 09:23:03 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java	2010-01-22 10:15:02 +0000
@@ -259,7 +259,7 @@
     // Logic
     // -------------------------------------------------------------------------
 
-    public boolean isZeroIsSignificantNullSafe()
+    public boolean isZeroIsSignificant()
     {
         return zeroIsSignificant != null && zeroIsSignificant;
     }
@@ -546,7 +546,7 @@
         this.aggregationLevels = aggregationLevels;
     }
 
-    public Boolean isZeroIsSignificant()
+    public Boolean getZeroIsSignificant()
     {
         return zeroIsSignificant;
     }

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataelement/DataElementStoreTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataelement/DataElementStoreTest.java	2009-11-07 14:09:00 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataelement/DataElementStoreTest.java	2010-01-22 10:15:02 +0000
@@ -505,6 +505,27 @@
         assertTrue( dataElements.contains( dataElementB ) );
         assertTrue( dataElements.contains( dataElementD ) );        
     }
+    
+    @Test
+    public void testGetDataElementsZeroIsSignificant()
+    {
+        DataElement dataElementA = createDataElement( 'A' );
+        DataElement dataElementB = createDataElement( 'B' );
+        DataElement dataElementC = createDataElement( 'C' );
+        DataElement dataElementD = createDataElement( 'D' );
+
+        dataElementA.setZeroIsSignificant( true );
+        dataElementB.setZeroIsSignificant( true );
+        
+        dataElementStore.addDataElement( dataElementA );
+        dataElementStore.addDataElement( dataElementB );
+        dataElementStore.addDataElement( dataElementC );
+        dataElementStore.addDataElement( dataElementD );
+        
+        Collection<DataElement> dataElements = dataElementStore.getDataElementsByZeroIsSignificant( true );
+        
+        assertTrue( equals( dataElements, dataElementA, dataElementB ) );
+    }
 
     // -------------------------------------------------------------------------
     // CalculatedDataElements

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/index.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/index.vm	2010-01-22 03:15:07 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/index.vm	2010-01-22 10:15:02 +0000
@@ -7,8 +7,8 @@
     #introListItem( "displayMaintenanceForm.action" "maintenance" )
     #introListItem( "displayResourceTableForm.action" "resource_table" )
     #introListItem( "viewStatistics.action" "data_statistics" )
+    #introListItem( "displayLockingForm.action" "data_locking" )
+    #introListItem( "zeroValueStorageManagement.action" "dataelement_zero_storage_management" ) 
     #introListItem( "showCache.action" "cache_statistics" )
-    #introListItem( "displayLockingForm.action" "data_locking" )
-	#introListItem( "zeroValueStorageManagement.action" "dataelement_zero_storage_management" )	
 </ul>
     
\ No newline at end of file