← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9384: Upgraded to current junit package for Assert class imports

 

------------------------------------------------------------
revno: 9384
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2012-12-21 13:59:39 +0100
message:
  Upgraded to current junit package for Assert class imports
modified:
  dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/DataQueryParams.java
  dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultQueryPlanner.java
  dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/JdbcAnalyticsManager.java
  dhis-2/dhis-services/dhis-service-datamart-default/src/test/java/org/hisp/dhis/datamart/DataMartServiceAggregationLevelsTest.java
  dhis-2/dhis-services/dhis-service-datamart-default/src/test/java/org/hisp/dhis/datamart/DataMartServiceMultiDimensionTest.java
  dhis-2/dhis-services/dhis-service-datamart-default/src/test/java/org/hisp/dhis/datamart/DataMartServiceOrgUnitTest.java
  dhis-2/dhis-services/dhis-service-datamart-default/src/test/java/org/hisp/dhis/datamart/DataMartServiceTest.java
  dhis-2/dhis-services/dhis-service-datamart-default/src/test/java/org/hisp/dhis/datamart/DataMartServiceTimeDimensionTest.java
  dhis-2/dhis-services/dhis-service-datamart-default/src/test/java/org/hisp/dhis/datamart/crosstab/CrossTabServiceTest.java
  dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/external/configuration/ConfigurationManagerTest.java
  dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/external/location/LocationManagerTest.java
  dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/CompleteDataSetRegistrationBatchHandlerTest.java
  dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/DataDictionaryBatchHandlerTest.java
  dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/DataElementBatchHandlerTest.java
  dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/DataElementCategoryBatchHandlerTest.java
  dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/DataElementCategoryComboBatchHandlerTest.java
  dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/DataElementCategoryOptionBatchHandlerTest.java
  dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/DataElementGroupBatchHandlerTest.java
  dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/DataElementGroupSetBatchHandlerTest.java
  dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/DataSetBatchHandlerTest.java
  dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/DataValueBatchHandlerTest.java
  dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/GroupSetBatchHandlerTest.java
  dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/ImportDataValueBatchHandlerTest.java
  dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/IndicatorBatchHandlerTest.java
  dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/IndicatorGroupBatchHandlerTest.java
  dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/IndicatorGroupSetBatchHandlerTest.java
  dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/IndicatorTypeBatchHandlerTest.java
  dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/OrganisationUnitGroupBatchHandlerTest.java
  dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/PeriodBatchHandlerTest.java
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/CollectionUtils.java
  dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/database/DatabaseInfoProviderTest.java
  dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/filter/AggregatableDataElementFilterTest.java
  dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/filter/DataElementWithAggregationFilterTest.java
  dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/grid/GridTest.java
  dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/grid/GridUtilsTest.java
  dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/notification/NotifierTest.java
  dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/util/ConversionUtilsTest.java
  dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/util/DateUtilsTest.java
  dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/util/MathUtilsTest.java
  dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/util/PaginatedListTest.java
  dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/util/ReflectionUtilsTest.java
  dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/util/StreamUtilsTest.java
  dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/util/TextUtilsTest.java
  dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/util/ValidationUtilsTest.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/AnalyticsController.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-analytics/src/main/java/org/hisp/dhis/analytics/DataQueryParams.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/DataQueryParams.java	2012-12-19 15:51:21 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/DataQueryParams.java	2012-12-21 12:59:39 +0000
@@ -28,11 +28,13 @@
  */
 
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
 import org.hisp.dhis.common.Dxf2Namespace;
+import org.hisp.dhis.system.util.CollectionUtils;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
@@ -142,7 +144,12 @@
     {
         dimensions.put( dimension, values );
     }
-        
+    
+    public Collection<String> dimensionsAsFilters()
+    {
+        return CollectionUtils.intersection( dimensions.keySet(), filters.keySet() );
+    }
+    
     @Override
     public int hashCode()
     {

=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultQueryPlanner.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultQueryPlanner.java	2012-12-19 15:51:21 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultQueryPlanner.java	2012-12-21 12:59:39 +0000
@@ -40,6 +40,7 @@
 import org.hisp.dhis.system.util.MathUtils;
 import org.hisp.dhis.system.util.PaginatedList;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.util.Assert;
 
 public class DefaultQueryPlanner
     implements QueryPlanner
@@ -53,12 +54,15 @@
     
     public List<DataQueryParams> planQuery( DataQueryParams params, int optimalQueries )
     {
+        Assert.isTrue( params.getDimensions().size() > 0 );
+        Assert.isTrue( params.dimensionsAsFilters().isEmpty() );
+
         // ---------------------------------------------------------------------
         // Group queries by partition, period type and organisation unit level
         // ---------------------------------------------------------------------
         
         params = new DataQueryParams( params );
-        
+
         List<DataQueryParams> queries = new ArrayList<DataQueryParams>();
         
         List<DataQueryParams> groupedByPartition = groupByPartition( params );

=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/JdbcAnalyticsManager.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/JdbcAnalyticsManager.java	2012-12-19 14:35:23 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/JdbcAnalyticsManager.java	2012-12-21 12:59:39 +0000
@@ -46,7 +46,6 @@
 import org.springframework.jdbc.support.rowset.SqlRowSet;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.AsyncResult;
-import org.springframework.util.Assert;
 
 /**
  * This class is responsible for producing aggregated data values. It reads data
@@ -75,8 +74,6 @@
         List<String> dimensions = params.getDimensionNames();
         Map<String, List<String>> dimensionMap = params.getDimensionMap();
         
-        Assert.isTrue( dimensions.size() > 0, "Must be at least one dimension" );
-
         SqlHelper sqlHelper = new SqlHelper();
         
         String sql = 

=== modified file 'dhis-2/dhis-services/dhis-service-datamart-default/src/test/java/org/hisp/dhis/datamart/DataMartServiceAggregationLevelsTest.java'
--- dhis-2/dhis-services/dhis-service-datamart-default/src/test/java/org/hisp/dhis/datamart/DataMartServiceAggregationLevelsTest.java	2012-02-12 20:32:14 +0000
+++ dhis-2/dhis-services/dhis-service-datamart-default/src/test/java/org/hisp/dhis/datamart/DataMartServiceAggregationLevelsTest.java	2012-12-21 12:59:39 +0000
@@ -27,7 +27,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static junit.framework.Assert.assertEquals;
+import static org.junit.Assert.*;
 
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -220,19 +220,19 @@
         
         dataMartEngine.export( dataElementIds, new ArrayList<Integer>(), periodIds, organisationUnitIds );
         
-        assertEquals( 280.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, period, unitA ) );
-        assertEquals( 240.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, period, unitB ) );
-        assertEquals( 40.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, period, unitC ) );
-        assertEquals( 60.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, period, unitD ) );
-        assertEquals( 70.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, period, unitE ) );
-        assertEquals( 90.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, period, unitF ) );
-        assertEquals( 315.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, period, unitG ) );
-        assertEquals( 75.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, period, unitH ) );
-        assertEquals( 100.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, period, unitI ) );
-        assertEquals( 200.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, period, unitJ ) );
-        assertEquals( 55.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, period, unitK ) );
-        assertEquals( 75.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, period, unitL ) );
-        assertEquals( 60.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, period, unitM ) );
+        assertEquals( 280.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, period, unitA ), DELTA );
+        assertEquals( 240.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, period, unitB ), DELTA );
+        assertEquals( 40.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, period, unitC ), DELTA );
+        assertEquals( 60.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, period, unitD ), DELTA );
+        assertEquals( 70.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, period, unitE ), DELTA );
+        assertEquals( 90.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, period, unitF ), DELTA );
+        assertEquals( 315.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, period, unitG ), DELTA );
+        assertEquals( 75.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, period, unitH ), DELTA );
+        assertEquals( 100.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, period, unitI ), DELTA );
+        assertEquals( 200.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, period, unitJ ), DELTA );
+        assertEquals( 55.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, period, unitK ), DELTA );
+        assertEquals( 75.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, period, unitL ), DELTA );
+        assertEquals( 60.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, period, unitM ), DELTA );
     }
 
     @Test
@@ -246,18 +246,18 @@
         
         dataMartEngine.export( dataElementIds, new ArrayList<Integer>(), periodIds, organisationUnitIds );
         
-        assertEquals( 280.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, period, unitA ) );
-        assertEquals( 240.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, period, unitB ) );
-        assertEquals( 40.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, period, unitC ) );
-        assertEquals( 60.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, period, unitD ) );
-        assertEquals( 70.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, period, unitE ) );
-        assertEquals( 90.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, period, unitF ) );
-        assertEquals( 315.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, period, unitG ) );
-        assertEquals( 75.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, period, unitH ) );
-        assertEquals( 100.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, period, unitI ) );
-        assertEquals( 200.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, period, unitJ ) );
-        assertEquals( 55.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, period, unitK ) );
-        assertEquals( 75.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, period, unitL ) );
-        assertEquals( 60.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, period, unitM ) );
+        assertEquals( 280.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, period, unitA ), DELTA );
+        assertEquals( 240.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, period, unitB ), DELTA );
+        assertEquals( 40.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, period, unitC ), DELTA );
+        assertEquals( 60.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, period, unitD ), DELTA );
+        assertEquals( 70.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, period, unitE ), DELTA );
+        assertEquals( 90.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, period, unitF ), DELTA );
+        assertEquals( 315.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, period, unitG ), DELTA );
+        assertEquals( 75.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, period, unitH ), DELTA );
+        assertEquals( 100.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, period, unitI ), DELTA );
+        assertEquals( 200.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, period, unitJ ), DELTA );
+        assertEquals( 55.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, period, unitK ), DELTA );
+        assertEquals( 75.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, period, unitL ), DELTA );
+        assertEquals( 60.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, period, unitM ), DELTA );
     }    
 }

=== modified file 'dhis-2/dhis-services/dhis-service-datamart-default/src/test/java/org/hisp/dhis/datamart/DataMartServiceMultiDimensionTest.java'
--- dhis-2/dhis-services/dhis-service-datamart-default/src/test/java/org/hisp/dhis/datamart/DataMartServiceMultiDimensionTest.java	2012-04-12 12:39:47 +0000
+++ dhis-2/dhis-services/dhis-service-datamart-default/src/test/java/org/hisp/dhis/datamart/DataMartServiceMultiDimensionTest.java	2012-12-21 12:59:39 +0000
@@ -27,7 +27,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static junit.framework.Assert.assertEquals;
+import static org.junit.Assert.*;
 
 import java.util.Collection;
 import java.util.Date;
@@ -264,26 +264,26 @@
 
         dataMartEngine.export( dataElementIds, indicatorIds, periodIds, organisationUnitIds );
         
-        assertEquals( 90.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodA, unitB ) );
-        assertEquals( 70.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodB, unitB ) );
-        assertEquals( 160.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodC, unitB ) );
-        assertEquals( 10.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodA, unitB ) );
-        assertEquals( 30.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodB, unitB ) );
-        assertEquals( 40.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodC, unitB ) );
-
-        assertEquals( 25.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodA, unitC ) );
-        assertEquals( 65.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodB, unitC ) );
-        assertEquals( 90.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodC, unitC ) );
-        assertEquals( 20.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodA, unitC ) );
-        assertEquals( 40.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodB, unitC ) );
-        assertEquals( 60.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodC, unitC ) );
-
-        assertEquals( 155.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodA, unitA ) );
-        assertEquals( 175.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodB, unitA ) );
-        assertEquals( 330.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodC, unitA ) );
-        assertEquals( 50.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodA, unitA ) );
-        assertEquals( 150.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodB, unitA ) );
-        assertEquals( 200.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodC, unitA ) );
+        assertEquals( 90.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodA, unitB ), DELTA );
+        assertEquals( 70.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodB, unitB ), DELTA );
+        assertEquals( 160.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodC, unitB ), DELTA );
+        assertEquals( 10.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodA, unitB ), DELTA );
+        assertEquals( 30.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodB, unitB ), DELTA );
+        assertEquals( 40.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodC, unitB ), DELTA );
+
+        assertEquals( 25.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodA, unitC ), DELTA );
+        assertEquals( 65.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodB, unitC ), DELTA );
+        assertEquals( 90.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodC, unitC ), DELTA );
+        assertEquals( 20.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodA, unitC ), DELTA );
+        assertEquals( 40.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodB, unitC ), DELTA );
+        assertEquals( 60.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodC, unitC ), DELTA );
+
+        assertEquals( 155.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodA, unitA ), DELTA );
+        assertEquals( 175.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodB, unitA ), DELTA );
+        assertEquals( 330.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodC, unitA ), DELTA );
+        assertEquals( 50.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodA, unitA ), DELTA );
+        assertEquals( 150.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodB, unitA ), DELTA );
+        assertEquals( 200.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodC, unitA ), DELTA );
     }
 
     @Ignore
@@ -318,26 +318,26 @@
 
         dataMartEngine.export( dataElementIds, indicatorIds, periodIds, organisationUnitIds );
 
-        assertEquals( 90.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodA, unitB ) );
-        assertEquals( 70.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodB, unitB ) );
-        assertEquals( 80.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodC, unitB ) );
-        assertEquals( 10.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodA, unitB ) );
-        assertEquals( 30.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodB, unitB ) );
-        assertEquals( 20.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodC, unitB ) );
-
-        assertEquals( 25.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodA, unitC ) );
-        assertEquals( 65.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodB, unitC ) );
-        assertEquals( 45.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodC, unitC ) );
-        assertEquals( 20.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodA, unitC ) );
-        assertEquals( 40.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodB, unitC ) );
-        assertEquals( 30.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodC, unitC ) );
-
-        assertEquals( 155.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodA, unitA ) );
-        assertEquals( 175.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodB, unitA ) );
-        assertEquals( 165.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodC, unitA ) );
-        assertEquals( 50.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodA, unitA ) );
-        assertEquals( 150.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodB, unitA ) );
-        assertEquals( 100.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodC, unitA ) );
+        assertEquals( 90.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodA, unitB ), DELTA );
+        assertEquals( 70.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodB, unitB ), DELTA );
+        assertEquals( 80.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodC, unitB ), DELTA );
+        assertEquals( 10.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodA, unitB ), DELTA );
+        assertEquals( 30.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodB, unitB ), DELTA );
+        assertEquals( 20.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodC, unitB ), DELTA );
+
+        assertEquals( 25.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodA, unitC ), DELTA );
+        assertEquals( 65.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodB, unitC ), DELTA );
+        assertEquals( 45.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodC, unitC ), DELTA );
+        assertEquals( 20.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodA, unitC ), DELTA );
+        assertEquals( 40.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodB, unitC ), DELTA );
+        assertEquals( 30.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodC, unitC ), DELTA );
+
+        assertEquals( 155.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodA, unitA ), DELTA );
+        assertEquals( 175.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodB, unitA ), DELTA );
+        assertEquals( 165.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodC, unitA ), DELTA );
+        assertEquals( 50.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodA, unitA ), DELTA );
+        assertEquals( 150.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodB, unitA ), DELTA );
+        assertEquals( 100.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodC, unitA ), DELTA );
     }
 
     @Ignore
@@ -372,26 +372,26 @@
 
         dataMartEngine.export( dataElementIds, indicatorIds, periodIds, organisationUnitIds );
 
-        assertEquals( 1.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodA, unitB ) );
-        assertEquals( 0.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodB, unitB ) );
-        assertEquals( 1.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodC, unitB ) );
-        assertEquals( 0.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodA, unitB ) );
-        assertEquals( 1.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodB, unitB ) );
-        assertEquals( 1.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodC, unitB ) );
-
-        assertEquals( 0.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodA, unitC ) );
-        assertEquals( 0.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodB, unitC ) );
-        assertEquals( 0.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodC, unitC ) );
-        assertEquals( 1.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodA, unitC ) );
-        assertEquals( 0.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodB, unitC ) );
-        assertEquals( 1.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodC, unitC ) );
-
-        assertEquals( 2.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodA, unitA ) );
-        assertEquals( 1.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodB, unitA ) );
-        assertEquals( 3.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodC, unitA ) );
-        assertEquals( 1.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodA, unitA ) );
-        assertEquals( 2.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodB, unitA ) );
-        assertEquals( 3.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodC, unitA ) );
+        assertEquals( 1.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodA, unitB ), DELTA );
+        assertEquals( 0.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodB, unitB ), DELTA );
+        assertEquals( 1.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodC, unitB ), DELTA );
+        assertEquals( 0.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodA, unitB ), DELTA );
+        assertEquals( 1.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodB, unitB ), DELTA );
+        assertEquals( 1.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodC, unitB ), DELTA );
+
+        assertEquals( 0.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodA, unitC ), DELTA );
+        assertEquals( 0.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodB, unitC ), DELTA );
+        assertEquals( 0.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodC, unitC ), DELTA );
+        assertEquals( 1.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodA, unitC ), DELTA );
+        assertEquals( 0.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodB, unitC ), DELTA );
+        assertEquals( 1.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodC, unitC ), DELTA );
+
+        assertEquals( 2.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodA, unitA ), DELTA );
+        assertEquals( 1.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodB, unitA ), DELTA );
+        assertEquals( 3.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodC, unitA ), DELTA );
+        assertEquals( 1.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodA, unitA ), DELTA );
+        assertEquals( 2.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodB, unitA ), DELTA );
+        assertEquals( 3.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodC, unitA ), DELTA );
     }
 
     @Ignore
@@ -426,26 +426,26 @@
 
         dataMartEngine.export( dataElementIds, indicatorIds, periodIds, organisationUnitIds );
 
-        assertEquals( 100.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodA, unitB ) );
-        assertEquals( 0.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodB, unitB ) );
-        assertEquals( 50.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodC, unitB ) );
-        assertEquals( 0.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodA, unitB ) );
-        assertEquals( 100.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodB, unitB ) );
-        assertEquals( 50.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodC, unitB ) );
-
-        assertEquals( 0.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodA, unitC ) );
-        assertEquals( 0.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodB, unitC ) );
-        assertEquals( 0.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodC, unitC ) );
-        assertEquals( 100.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodA, unitC ) );
-        assertEquals( 0.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodB, unitC ) );
-        assertEquals( 50.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodC, unitC ) );
-
-        assertEquals( 66.7, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodA, unitA ) );
-        assertEquals( 33.3, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodB, unitA ) );
-        assertEquals( 50.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodC, unitA ) );
-        assertEquals( 33.3, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodA, unitA ) );
-        assertEquals( 66.7, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodB, unitA ) );
-        assertEquals( 50.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodC, unitA ) );
+        assertEquals( 100.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodA, unitB ), DELTA );
+        assertEquals( 0.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodB, unitB ), DELTA );
+        assertEquals( 50.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodC, unitB ), DELTA );
+        assertEquals( 0.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodA, unitB ), DELTA );
+        assertEquals( 100.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodB, unitB ), DELTA );
+        assertEquals( 50.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodC, unitB ), DELTA );
+
+        assertEquals( 0.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodA, unitC ), DELTA );
+        assertEquals( 0.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodB, unitC ), DELTA );
+        assertEquals( 0.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodC, unitC ), DELTA );
+        assertEquals( 100.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodA, unitC ), DELTA );
+        assertEquals( 0.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodB, unitC ), DELTA );
+        assertEquals( 50.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodC, unitC ), DELTA );
+
+        assertEquals( 66.7, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodA, unitA ), DELTA );
+        assertEquals( 33.3, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodB, unitA ), DELTA );
+        assertEquals( 50.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboA, periodC, unitA ), DELTA );
+        assertEquals( 33.3, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodA, unitA ), DELTA );
+        assertEquals( 66.7, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodB, unitA ), DELTA );
+        assertEquals( 50.0, aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionComboB, periodC, unitA ), DELTA );
     }
 
     @Ignore
@@ -495,17 +495,17 @@
 
         dataMartEngine.export( dataElementIds, indicatorIds, periodIds, organisationUnitIds );
         
-        assertEquals( 2700.0, aggregatedDataValueService.getAggregatedValue( indicatorA, periodA, unitB ) );
-        assertEquals( 600.0, aggregatedDataValueService.getAggregatedValue( indicatorA, periodB, unitB ) );
-        assertEquals( 6000.0, aggregatedDataValueService.getAggregatedValue( indicatorA, periodC, unitB ) );
-        
-        assertEquals( 500.0, aggregatedDataValueService.getAggregatedValue( indicatorA, periodA, unitC ) );
-        assertEquals( 6300.0, aggregatedDataValueService.getAggregatedValue( indicatorA, periodB, unitC ) );
-        assertEquals( 11200.0, aggregatedDataValueService.getAggregatedValue( indicatorA, periodC, unitC ) );
-        
-        assertEquals( 8000.0, aggregatedDataValueService.getAggregatedValue( indicatorA, periodA, unitA ) );
-        assertEquals( 11000.0, aggregatedDataValueService.getAggregatedValue( indicatorA, periodB, unitA ) );
-        assertEquals( 38000.0, aggregatedDataValueService.getAggregatedValue( indicatorA, periodC, unitA ) );   
+        assertEquals( 2700.0, aggregatedDataValueService.getAggregatedValue( indicatorA, periodA, unitB ), DELTA );
+        assertEquals( 600.0, aggregatedDataValueService.getAggregatedValue( indicatorA, periodB, unitB ), DELTA );
+        assertEquals( 6000.0, aggregatedDataValueService.getAggregatedValue( indicatorA, periodC, unitB ), DELTA );
+        
+        assertEquals( 500.0, aggregatedDataValueService.getAggregatedValue( indicatorA, periodA, unitC ), DELTA );
+        assertEquals( 6300.0, aggregatedDataValueService.getAggregatedValue( indicatorA, periodB, unitC ), DELTA );
+        assertEquals( 11200.0, aggregatedDataValueService.getAggregatedValue( indicatorA, periodC, unitC ), DELTA );
+        
+        assertEquals( 8000.0, aggregatedDataValueService.getAggregatedValue( indicatorA, periodA, unitA ), DELTA );
+        assertEquals( 11000.0, aggregatedDataValueService.getAggregatedValue( indicatorA, periodB, unitA ), DELTA );
+        assertEquals( 38000.0, aggregatedDataValueService.getAggregatedValue( indicatorA, periodC, unitA ), DELTA );   
     }
 
     @Ignore
@@ -562,17 +562,17 @@
 
         dataMartEngine.export( dataElementIds, indicatorIds, periodIds, organisationUnitIds );
 
-        assertEquals( 12.0, aggregatedDataValueService.getAggregatedValue( indicatorB, periodA, unitB ) );
-        assertEquals( 5.0, aggregatedDataValueService.getAggregatedValue( indicatorB, periodB, unitB ) );
-        assertEquals( 17.0, aggregatedDataValueService.getAggregatedValue( indicatorB, periodC, unitB ) );
-        
-        assertEquals( 6.0, aggregatedDataValueService.getAggregatedValue( indicatorB, periodA, unitC ) );
-        assertEquals( 16.0, aggregatedDataValueService.getAggregatedValue( indicatorB, periodB, unitC ) );
-        assertEquals( 22.0, aggregatedDataValueService.getAggregatedValue( indicatorB, periodC, unitC ) );
-        
-        assertEquals( 18.0, aggregatedDataValueService.getAggregatedValue( indicatorB, periodA, unitA ) );
-        assertEquals( 21.0, aggregatedDataValueService.getAggregatedValue( indicatorB, periodB, unitA ) );
-        assertEquals( 39.0, aggregatedDataValueService.getAggregatedValue( indicatorB, periodC, unitA ) );
+        assertEquals( 12.0, aggregatedDataValueService.getAggregatedValue( indicatorB, periodA, unitB ), DELTA );
+        assertEquals( 5.0, aggregatedDataValueService.getAggregatedValue( indicatorB, periodB, unitB ), DELTA );
+        assertEquals( 17.0, aggregatedDataValueService.getAggregatedValue( indicatorB, periodC, unitB ), DELTA );
+        
+        assertEquals( 6.0, aggregatedDataValueService.getAggregatedValue( indicatorB, periodA, unitC ), DELTA );
+        assertEquals( 16.0, aggregatedDataValueService.getAggregatedValue( indicatorB, periodB, unitC ), DELTA );
+        assertEquals( 22.0, aggregatedDataValueService.getAggregatedValue( indicatorB, periodC, unitC ), DELTA );
+        
+        assertEquals( 18.0, aggregatedDataValueService.getAggregatedValue( indicatorB, periodA, unitA ), DELTA );
+        assertEquals( 21.0, aggregatedDataValueService.getAggregatedValue( indicatorB, periodB, unitA ), DELTA );
+        assertEquals( 39.0, aggregatedDataValueService.getAggregatedValue( indicatorB, periodC, unitA ), DELTA );
         
         assertEquals( aggregatedDataValueService.getAggregatedValue( indicatorB, periodA, unitB ), aggregatedDataValueService.getAggregatedValue( indicatorA, periodA, unitB ) );
         assertEquals( aggregatedDataValueService.getAggregatedValue( indicatorB, periodB, unitB ), aggregatedDataValueService.getAggregatedValue( indicatorA, periodB, unitB ) );
@@ -636,16 +636,16 @@
 
         dataMartEngine.export( dataElementIds, indicatorIds, periodIds, organisationUnitIds );
         
-        assertEquals( 31790.3, aggregatedDataValueService.getAggregatedValue( indicatorA, periodA, unitB ) );
-        assertEquals( 7064.5, aggregatedDataValueService.getAggregatedValue( indicatorA, periodB, unitB ) );
-        assertEquals( 35322.6, aggregatedDataValueService.getAggregatedValue( indicatorA, periodC, unitB ) );
-        
-        assertEquals( 5887.1, aggregatedDataValueService.getAggregatedValue( indicatorA, periodA, unitC ) );
-        assertEquals( 74177.4, aggregatedDataValueService.getAggregatedValue( indicatorA, periodB, unitC ) );
-        assertEquals( 65935.5, aggregatedDataValueService.getAggregatedValue( indicatorA, periodC, unitC ) );
-        
-        assertEquals( 94193.5, aggregatedDataValueService.getAggregatedValue( indicatorA, periodA, unitA ) );
-        assertEquals( 129516.1, aggregatedDataValueService.getAggregatedValue( indicatorA, periodB, unitA ) );
-        assertEquals( 223709.7, aggregatedDataValueService.getAggregatedValue( indicatorA, periodC, unitA ) );        
+        assertEquals( 31790.3, aggregatedDataValueService.getAggregatedValue( indicatorA, periodA, unitB ), DELTA );
+        assertEquals( 7064.5, aggregatedDataValueService.getAggregatedValue( indicatorA, periodB, unitB ), DELTA );
+        assertEquals( 35322.6, aggregatedDataValueService.getAggregatedValue( indicatorA, periodC, unitB ), DELTA );
+        
+        assertEquals( 5887.1, aggregatedDataValueService.getAggregatedValue( indicatorA, periodA, unitC ), DELTA );
+        assertEquals( 74177.4, aggregatedDataValueService.getAggregatedValue( indicatorA, periodB, unitC ), DELTA );
+        assertEquals( 65935.5, aggregatedDataValueService.getAggregatedValue( indicatorA, periodC, unitC ), DELTA );
+        
+        assertEquals( 94193.5, aggregatedDataValueService.getAggregatedValue( indicatorA, periodA, unitA ), DELTA );
+        assertEquals( 129516.1, aggregatedDataValueService.getAggregatedValue( indicatorA, periodB, unitA ), DELTA );
+        assertEquals( 223709.7, aggregatedDataValueService.getAggregatedValue( indicatorA, periodC, unitA ), DELTA );        
     }
 }

=== modified file 'dhis-2/dhis-services/dhis-service-datamart-default/src/test/java/org/hisp/dhis/datamart/DataMartServiceOrgUnitTest.java'
--- dhis-2/dhis-services/dhis-service-datamart-default/src/test/java/org/hisp/dhis/datamart/DataMartServiceOrgUnitTest.java	2012-11-08 08:33:41 +0000
+++ dhis-2/dhis-services/dhis-service-datamart-default/src/test/java/org/hisp/dhis/datamart/DataMartServiceOrgUnitTest.java	2012-12-21 12:59:39 +0000
@@ -27,7 +27,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static junit.framework.Assert.assertEquals;
+import static org.junit.Assert.assertEquals;
 
 import java.util.Collection;
 import java.util.Date;
@@ -304,29 +304,29 @@
         
         dataMartEngine.export( dataElementIds, indicatorIds, periodIds, organisationUnitIds, organisationUnitGroupIds, null );
         
-        assertEquals( 145.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitA, groupA ) );
-        assertEquals( 145.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitB, groupA ) );
-        assertEquals( 90.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitD, groupA ) );
-        assertEquals( 35.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitE, groupA ) );
-        assertEquals( 20.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitF, groupA ) );
-        
-        assertEquals( 95.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitA, groupB ) );
-        assertEquals( 95.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitB, groupB ) );
-        assertEquals( 10.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitD, groupB ) );
-        assertEquals( 25.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitE, groupB ) );
-        assertEquals( 60.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitF, groupB ) );
-        
-        assertEquals( 490.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitA, groupA ) );
-        assertEquals( 490.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitB, groupA ) );
-        assertEquals( 255.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitD, groupA ) );
-        assertEquals( 145.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitE, groupA ) );
-        assertEquals( 90.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitF, groupA ) );
-        
-        assertEquals( 345.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitA, groupB ) );
-        assertEquals( 345.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitB, groupB ) );
-        assertEquals( 90.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitD, groupB ) );
-        assertEquals( 110.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitE, groupB ) );
-        assertEquals( 145.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitF, groupB ) );
+        assertEquals( 145.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitA, groupA ), DELTA );
+        assertEquals( 145.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitB, groupA ), DELTA );
+        assertEquals( 90.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitD, groupA ), DELTA );
+        assertEquals( 35.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitE, groupA ), DELTA );
+        assertEquals( 20.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitF, groupA ), DELTA );
+        
+        assertEquals( 95.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitA, groupB ), DELTA );
+        assertEquals( 95.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitB, groupB ), DELTA );
+        assertEquals( 10.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitD, groupB ), DELTA );
+        assertEquals( 25.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitE, groupB ), DELTA );
+        assertEquals( 60.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitF, groupB ), DELTA );
+        
+        assertEquals( 490.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitA, groupA ), DELTA );
+        assertEquals( 490.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitB, groupA ), DELTA );
+        assertEquals( 255.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitD, groupA ), DELTA );
+        assertEquals( 145.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitE, groupA ), DELTA );
+        assertEquals( 90.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitF, groupA ), DELTA );
+        
+        assertEquals( 345.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitA, groupB ), DELTA );
+        assertEquals( 345.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitB, groupB ), DELTA );
+        assertEquals( 90.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitD, groupB ), DELTA );
+        assertEquals( 110.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitE, groupB ), DELTA );
+        assertEquals( 145.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitF, groupB ), DELTA );
     }
 
     @Test
@@ -338,17 +338,17 @@
 
         dataMartEngine.export( dataElementIds, indicatorIds, periodIds, organisationUnitIds, organisationUnitGroupIds, null );
         
-        assertEquals( 145.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitA, groupA ) );
-        assertEquals( 145.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitB, groupA ) );
-        assertEquals( 90.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitD, groupA ) );
-        assertEquals( 35.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitE, groupA ) );
-        assertEquals( 20.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitF, groupA ) );
+        assertEquals( 145.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitA, groupA ), DELTA );
+        assertEquals( 145.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitB, groupA ), DELTA );
+        assertEquals( 90.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitD, groupA ), DELTA );
+        assertEquals( 35.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitE, groupA ), DELTA );
+        assertEquals( 20.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitF, groupA ), DELTA );
         
-        assertEquals( 95.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitA, groupB ) );
-        assertEquals( 95.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitB, groupB ) );
-        assertEquals( 10.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitD, groupB ) );
-        assertEquals( 25.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitE, groupB ) );
-        assertEquals( 60.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitF, groupB ) );
+        assertEquals( 95.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitA, groupB ), DELTA );
+        assertEquals( 95.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitB, groupB ), DELTA );
+        assertEquals( 10.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitD, groupB ), DELTA );
+        assertEquals( 25.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitE, groupB ), DELTA );
+        assertEquals( 60.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitF, groupB ), DELTA );
         
         assertEquals( 163.6, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitA, groupA ), 1.0 );
         assertEquals( 163.6, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitB, groupA ), 1.0 );
@@ -372,29 +372,29 @@
 
         dataMartEngine.export( dataElementIds, indicatorIds, periodIds, organisationUnitIds, organisationUnitGroupIds, null );
         
-        assertEquals( 1.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitA, groupA ) );
-        assertEquals( 1.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitB, groupA ) );
-        assertEquals( 1.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitD, groupA ) );
-        assertEquals( 0.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitE, groupA ) );
-        assertEquals( 0.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitF, groupA ) );
-        
-        assertEquals( 3.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitA, groupB ) );
-        assertEquals( 3.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitB, groupB ) );
-        assertEquals( 1.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitD, groupB ) );
-        assertEquals( 1.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitE, groupB ) );
-        assertEquals( 1.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitF, groupB ) );
-        
-        assertEquals( 4.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitA, groupA ) );
-        assertEquals( 4.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitB, groupA ) );
-        assertEquals( 2.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitD, groupA ) );
-        assertEquals( 1.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitE, groupA ) );
-        assertEquals( 1.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitF, groupA ) );
-        
-        assertEquals( 8.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitA, groupB ) );
-        assertEquals( 8.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitB, groupB ) );
-        assertEquals( 2.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitD, groupB ) );
-        assertEquals( 3.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitE, groupB ) );
-        assertEquals( 3.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitF, groupB ) );
+        assertEquals( 1.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitA, groupA ), DELTA );
+        assertEquals( 1.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitB, groupA ), DELTA );
+        assertEquals( 1.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitD, groupA ), DELTA );
+        assertEquals( 0.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitE, groupA ), DELTA );
+        assertEquals( 0.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitF, groupA ), DELTA );
+        
+        assertEquals( 3.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitA, groupB ), DELTA );
+        assertEquals( 3.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitB, groupB ), DELTA );
+        assertEquals( 1.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitD, groupB ), DELTA );
+        assertEquals( 1.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitE, groupB ), DELTA );
+        assertEquals( 1.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitF, groupB ), DELTA );
+        
+        assertEquals( 4.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitA, groupA ), DELTA );
+        assertEquals( 4.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitB, groupA ), DELTA );
+        assertEquals( 2.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitD, groupA ), DELTA );
+        assertEquals( 1.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitE, groupA ), DELTA );
+        assertEquals( 1.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitF, groupA ), DELTA );
+        
+        assertEquals( 8.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitA, groupB ), DELTA );
+        assertEquals( 8.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitB, groupB ), DELTA );
+        assertEquals( 2.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitD, groupB ), DELTA );
+        assertEquals( 3.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitE, groupB ), DELTA );
+        assertEquals( 3.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitF, groupB ), DELTA );
     }
 
     @Test
@@ -406,17 +406,17 @@
         
         dataMartEngine.export( dataElementIds, indicatorIds, periodIds, organisationUnitIds, organisationUnitGroupIds, null );
         
-        assertEquals( 33.3, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitA, groupA ) );
-        assertEquals( 33.3, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitB, groupA ) );
-        assertEquals( 100.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitD, groupA ) );
-        assertEquals( 0.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitE, groupA ) );
-        assertEquals( 0.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitF, groupA ) );
+        assertEquals( 33.3, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitA, groupA ), DELTA );
+        assertEquals( 33.3, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitB, groupA ), DELTA );
+        assertEquals( 100.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitD, groupA ), DELTA );
+        assertEquals( 0.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitE, groupA ), DELTA );
+        assertEquals( 0.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitF, groupA ), DELTA );
         
-        assertEquals( 100.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitA, groupB ) );
-        assertEquals( 100.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitB, groupB ) );
-        assertEquals( 100.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitD, groupB ) );
-        assertEquals( 100.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitE, groupB ) );
-        assertEquals( 100.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitF, groupB ) );
+        assertEquals( 100.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitA, groupB ), DELTA );
+        assertEquals( 100.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitB, groupB ), DELTA );
+        assertEquals( 100.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitD, groupB ), DELTA );
+        assertEquals( 100.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitE, groupB ), DELTA );
+        assertEquals( 100.0, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitF, groupB ), DELTA );
         
         assertEquals( 44.3, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitA, groupA ), 1.0 );
         assertEquals( 44.3, aggregatedOrgUnitDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitB, groupA ), 1.0 );
@@ -518,9 +518,9 @@
         // Assert
         // ---------------------------------------------------------------------
                 
-        assertEquals( 10.0, aggregatedOrgUnitDataValueService.getAggregatedIndicatorValue( indicatorA, periodA, unitD, groupA ) );
-        assertEquals( 22.1, aggregatedOrgUnitDataValueService.getAggregatedIndicatorValue( indicatorA, periodA, unitD, groupB ) );        
-        assertEquals( 51.3, aggregatedOrgUnitDataValueService.getAggregatedIndicatorValue( indicatorA, periodD, unitD, groupA ) );        
+        assertEquals( 10.0, aggregatedOrgUnitDataValueService.getAggregatedIndicatorValue( indicatorA, periodA, unitD, groupA ), DELTA );
+        assertEquals( 22.1, aggregatedOrgUnitDataValueService.getAggregatedIndicatorValue( indicatorA, periodA, unitD, groupB ), DELTA );        
+        assertEquals( 51.3, aggregatedOrgUnitDataValueService.getAggregatedIndicatorValue( indicatorA, periodD, unitD, groupA ), DELTA );        
         assertEquals( 480.6, aggregatedOrgUnitDataValueService.getAggregatedIndicatorValue( indicatorA, periodD, unitD, groupB ), 3.0 );
     }
 }

=== modified file 'dhis-2/dhis-services/dhis-service-datamart-default/src/test/java/org/hisp/dhis/datamart/DataMartServiceTest.java'
--- dhis-2/dhis-services/dhis-service-datamart-default/src/test/java/org/hisp/dhis/datamart/DataMartServiceTest.java	2012-11-08 08:33:41 +0000
+++ dhis-2/dhis-services/dhis-service-datamart-default/src/test/java/org/hisp/dhis/datamart/DataMartServiceTest.java	2012-12-21 12:59:39 +0000
@@ -27,7 +27,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static junit.framework.Assert.assertEquals;
+import static org.junit.Assert.assertEquals;
 
 import java.util.Collection;
 import java.util.Date;
@@ -269,23 +269,23 @@
         
         dataMartEngine.export( dataElementIds, indicatorIds, periodIds, organisationUnitIds );
         
-        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitA ), 240.0 );
-        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitB ), 150.0 );
-        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitC ), 90.0 );
-        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitD ), 10.0 );
-        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitE ), 35.0 );
-        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitF ), 105.0 );
-        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitG ), 20.0 );
-        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitH ), 60.0 );
+        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitA ), 240.0, DELTA );
+        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitB ), 150.0, DELTA );
+        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitC ), 90.0, DELTA );
+        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitD ), 10.0, DELTA );
+        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitE ), 35.0, DELTA );
+        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitF ), 105.0, DELTA );
+        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitG ), 20.0, DELTA );
+        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitH ), 60.0, DELTA );
         
-        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitA ), 835.0 );
-        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitB ), 580.0 );
-        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitC ), 255.0 );
-        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitD ), 90.0 );
-        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitE ), 145.0 );
-        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitF ), 345.0 );
-        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitG ), 90.0 );
-        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitH ), 145.0 );
+        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitA ), 835.0, DELTA );
+        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitB ), 580.0, DELTA );
+        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitC ), 255.0, DELTA );
+        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitD ), 90.0, DELTA );
+        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitE ), 145.0, DELTA );
+        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitF ), 345.0, DELTA );
+        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitG ), 90.0, DELTA );
+        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitH ), 145.0, DELTA );
     }
 
     @Test
@@ -297,14 +297,14 @@
         
         dataMartEngine.export( dataElementIds, indicatorIds, periodIds, organisationUnitIds );
         
-        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitA ), 240.0 );
-        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitB ), 150.0 );
-        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitC ), 90.0 );
-        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitD ), 10.0 );
-        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitE ), 35.0 );
-        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitF ), 105.0 );
-        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitG ), 20.0 );
-        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitH ), 60.0 );
+        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitA ), 240.0, DELTA );
+        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitB ), 150.0, DELTA );
+        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitC ), 90.0, DELTA );
+        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitD ), 10.0, DELTA );
+        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitE ), 35.0, DELTA );
+        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitF ), 105.0, DELTA );
+        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitG ), 20.0, DELTA );
+        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitH ), 60.0, DELTA );
         
         assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitA ), 278.5, 0.5 ); 
         assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitB ), 193.8, 0.5 );
@@ -325,23 +325,23 @@
         
         dataMartEngine.export( dataElementIds, indicatorIds, periodIds, organisationUnitIds );
 
-        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitA ), 4.0 );
-        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitB ), 3.0 );
-        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitC ), 1.0 );
-        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitD ), 1.0 );
-        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitE ), 0.0 );
-        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitF ), 2.0 );
-        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitG ), 0.0 );
-        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitH ), 1.0 );
+        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitA ), 4.0, DELTA );
+        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitB ), 3.0, DELTA );
+        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitC ), 1.0, DELTA );
+        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitD ), 1.0, DELTA );
+        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitE ), 0.0, DELTA );
+        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitF ), 2.0, DELTA );
+        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitG ), 0.0, DELTA );
+        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitH ), 1.0, DELTA );
         
-        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitA ), 12.0 );
-        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitB ), 10.0 );
-        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitC ), 2.0 );
-        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitD ), 2.0 );
-        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitE ), 1.0 );
-        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitF ), 7.0 );
-        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitG ), 1.0 );
-        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitH ), 3.0 );
+        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitA ), 12.0, DELTA );
+        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitB ), 10.0, DELTA );
+        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitC ), 2.0, DELTA );
+        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitD ), 2.0, DELTA );
+        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitE ), 1.0, DELTA );
+        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitF ), 7.0, DELTA );
+        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitG ), 1.0, DELTA );
+        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitH ), 3.0, DELTA );
     }
 
     @Test
@@ -353,14 +353,14 @@
         
         dataMartEngine.export( dataElementIds, indicatorIds, periodIds, organisationUnitIds );
 
-        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitA ), 66.7 );
-        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitB ), 60.0 );
-        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitC ), 100.0 );
-        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitD ), 100.0 );
-        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitE ), 0.0 );
-        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitF ), 66.7 );
-        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitG ), 0.0 );
-        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitH ), 100.0 );
+        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitA ), 66.7, DELTA );
+        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitB ), 60.0, DELTA );
+        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitC ), 100.0, DELTA );
+        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitD ), 100.0, DELTA );
+        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitE ), 0.0, DELTA );
+        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitF ), 66.7, DELTA );
+        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitG ), 0.0, DELTA );
+        assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitH ), 100.0, DELTA );
         
         assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitA ), 66.8, 0.5 );
         assertEquals( aggregatedDataValueService.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitB ), 66.8, 0.5 );

=== modified file 'dhis-2/dhis-services/dhis-service-datamart-default/src/test/java/org/hisp/dhis/datamart/DataMartServiceTimeDimensionTest.java'
--- dhis-2/dhis-services/dhis-service-datamart-default/src/test/java/org/hisp/dhis/datamart/DataMartServiceTimeDimensionTest.java	2012-02-12 20:32:14 +0000
+++ dhis-2/dhis-services/dhis-service-datamart-default/src/test/java/org/hisp/dhis/datamart/DataMartServiceTimeDimensionTest.java	2012-12-21 12:59:39 +0000
@@ -27,7 +27,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static junit.framework.Assert.assertEquals;
+import static org.junit.Assert.assertEquals;
 
 import java.util.Collection;
 import java.util.HashSet;
@@ -140,9 +140,9 @@
         
         dataMartEngine.export( dataElementIds, indicatorIds, periodIds, organisationUnitIds );
         
-        assertEquals( 100.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, periodA, unit ) );
-        assertEquals( 100.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, periodB, unit ) );
-        assertEquals( 100.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, periodC, unit ) );
+        assertEquals( 100.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, periodA, unit ), DELTA );
+        assertEquals( 100.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, periodB, unit ), DELTA );
+        assertEquals( 100.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, periodC, unit ), DELTA );
     }
 
     @Test
@@ -179,6 +179,6 @@
 
         dataMartEngine.export( dataElementIds, indicatorIds, periodIds, organisationUnitIds );
         
-        assertEquals( 60.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, periodA, unit ) );
+        assertEquals( 60.0, aggregatedDataValueService.getAggregatedValue( dataElement, categoryOptionCombo, periodA, unit ), DELTA );
     }
 }

=== modified file 'dhis-2/dhis-services/dhis-service-datamart-default/src/test/java/org/hisp/dhis/datamart/crosstab/CrossTabServiceTest.java'
--- dhis-2/dhis-services/dhis-service-datamart-default/src/test/java/org/hisp/dhis/datamart/crosstab/CrossTabServiceTest.java	2012-11-08 08:33:41 +0000
+++ dhis-2/dhis-services/dhis-service-datamart-default/src/test/java/org/hisp/dhis/datamart/crosstab/CrossTabServiceTest.java	2012-12-21 12:59:39 +0000
@@ -27,9 +27,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
+import static org.junit.Assert.*;
 
 import java.util.ArrayList;
 import java.util.Calendar;
@@ -251,7 +249,7 @@
         for ( DataElementOperand operand : valueMap.keySet() )
         {
             assertNotNull( valueMap.get( operand ) );
-            assertEquals( 10.0, valueMap.get( operand ) );
+            assertEquals( 10.0, valueMap.get( operand ), DELTA );
         }
     }
 }

=== modified file 'dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/external/configuration/ConfigurationManagerTest.java'
--- dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/external/configuration/ConfigurationManagerTest.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/external/configuration/ConfigurationManagerTest.java	2012-12-21 12:59:39 +0000
@@ -27,8 +27,8 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
 
 import java.io.InputStream;
 import java.io.OutputStream;

=== modified file 'dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/external/location/LocationManagerTest.java'
--- dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/external/location/LocationManagerTest.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/external/location/LocationManagerTest.java	2012-12-21 12:59:39 +0000
@@ -27,10 +27,10 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
-import static junit.framework.Assert.fail;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 import java.io.File;
 import java.io.InputStream;

=== modified file 'dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/CompleteDataSetRegistrationBatchHandlerTest.java'
--- dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/CompleteDataSetRegistrationBatchHandlerTest.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/CompleteDataSetRegistrationBatchHandlerTest.java	2012-12-21 12:59:39 +0000
@@ -27,10 +27,10 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
 
 import java.util.Collection;
 import java.util.Date;

=== modified file 'dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/DataDictionaryBatchHandlerTest.java'
--- dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/DataDictionaryBatchHandlerTest.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/DataDictionaryBatchHandlerTest.java	2012-12-21 12:59:39 +0000
@@ -27,10 +27,10 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
 
 import java.util.Collection;
 

=== modified file 'dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/DataElementBatchHandlerTest.java'
--- dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/DataElementBatchHandlerTest.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/DataElementBatchHandlerTest.java	2012-12-21 12:59:39 +0000
@@ -27,10 +27,10 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
 
 import java.util.Collection;
 

=== modified file 'dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/DataElementCategoryBatchHandlerTest.java'
--- dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/DataElementCategoryBatchHandlerTest.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/DataElementCategoryBatchHandlerTest.java	2012-12-21 12:59:39 +0000
@@ -27,10 +27,10 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
 
 import java.util.Collection;
 

=== modified file 'dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/DataElementCategoryComboBatchHandlerTest.java'
--- dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/DataElementCategoryComboBatchHandlerTest.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/DataElementCategoryComboBatchHandlerTest.java	2012-12-21 12:59:39 +0000
@@ -27,10 +27,10 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
 
 import java.util.Collection;
 

=== modified file 'dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/DataElementCategoryOptionBatchHandlerTest.java'
--- dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/DataElementCategoryOptionBatchHandlerTest.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/DataElementCategoryOptionBatchHandlerTest.java	2012-12-21 12:59:39 +0000
@@ -27,10 +27,10 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
 
 import java.util.Collection;
 

=== modified file 'dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/DataElementGroupBatchHandlerTest.java'
--- dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/DataElementGroupBatchHandlerTest.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/DataElementGroupBatchHandlerTest.java	2012-12-21 12:59:39 +0000
@@ -27,10 +27,10 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
 
 import java.util.Collection;
 

=== modified file 'dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/DataElementGroupSetBatchHandlerTest.java'
--- dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/DataElementGroupSetBatchHandlerTest.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/DataElementGroupSetBatchHandlerTest.java	2012-12-21 12:59:39 +0000
@@ -27,10 +27,10 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
 
 import java.util.Collection;
 

=== modified file 'dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/DataSetBatchHandlerTest.java'
--- dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/DataSetBatchHandlerTest.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/DataSetBatchHandlerTest.java	2012-12-21 12:59:39 +0000
@@ -27,10 +27,10 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
 
 import java.util.Collection;
 

=== modified file 'dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/DataValueBatchHandlerTest.java'
--- dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/DataValueBatchHandlerTest.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/DataValueBatchHandlerTest.java	2012-12-21 12:59:39 +0000
@@ -27,10 +27,10 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
 
 import java.util.Collection;
 

=== modified file 'dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/GroupSetBatchHandlerTest.java'
--- dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/GroupSetBatchHandlerTest.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/GroupSetBatchHandlerTest.java	2012-12-21 12:59:39 +0000
@@ -27,10 +27,10 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
 
 import java.util.Collection;
 

=== modified file 'dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/ImportDataValueBatchHandlerTest.java'
--- dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/ImportDataValueBatchHandlerTest.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/ImportDataValueBatchHandlerTest.java	2012-12-21 12:59:39 +0000
@@ -27,7 +27,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static junit.framework.Assert.*;
+import static org.junit.Assert.*;
 
 import java.util.Collection;
 

=== modified file 'dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/IndicatorBatchHandlerTest.java'
--- dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/IndicatorBatchHandlerTest.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/IndicatorBatchHandlerTest.java	2012-12-21 12:59:39 +0000
@@ -27,10 +27,10 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
 
 import java.util.Collection;
 

=== modified file 'dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/IndicatorGroupBatchHandlerTest.java'
--- dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/IndicatorGroupBatchHandlerTest.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/IndicatorGroupBatchHandlerTest.java	2012-12-21 12:59:39 +0000
@@ -27,10 +27,10 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
 
 import java.util.Collection;
 

=== modified file 'dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/IndicatorGroupSetBatchHandlerTest.java'
--- dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/IndicatorGroupSetBatchHandlerTest.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/IndicatorGroupSetBatchHandlerTest.java	2012-12-21 12:59:39 +0000
@@ -27,10 +27,10 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
 
 import java.util.Collection;
 

=== modified file 'dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/IndicatorTypeBatchHandlerTest.java'
--- dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/IndicatorTypeBatchHandlerTest.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/IndicatorTypeBatchHandlerTest.java	2012-12-21 12:59:39 +0000
@@ -27,10 +27,10 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
 
 import java.util.Collection;
 

=== modified file 'dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/OrganisationUnitGroupBatchHandlerTest.java'
--- dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/OrganisationUnitGroupBatchHandlerTest.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/OrganisationUnitGroupBatchHandlerTest.java	2012-12-21 12:59:39 +0000
@@ -27,10 +27,10 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
 
 import java.util.Collection;
 

=== modified file 'dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/PeriodBatchHandlerTest.java'
--- dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/PeriodBatchHandlerTest.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/PeriodBatchHandlerTest.java	2012-12-21 12:59:39 +0000
@@ -27,10 +27,10 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
 
 import java.util.Calendar;
 import java.util.Collection;

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/CollectionUtils.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/CollectionUtils.java	2012-06-28 09:21:53 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/CollectionUtils.java	2012-12-21 12:59:39 +0000
@@ -27,12 +27,14 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
 import org.hisp.dhis.system.util.functional.Function1;
 import org.hisp.dhis.system.util.functional.Predicate;
 
-import java.util.Collection;
-import java.util.Iterator;
-
 /**
  * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
  */
@@ -65,4 +67,11 @@
             }
         }
     }
+    
+    public static <T> Collection<T> intersection( Collection<T> c1, Collection<T> c2 )
+    {
+        Set<T> set1 = new HashSet<T>( c1 );
+        set1.retainAll( new HashSet<T>( c2 ) );
+        return set1;
+    }
 }

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/database/DatabaseInfoProviderTest.java'
--- dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/database/DatabaseInfoProviderTest.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/database/DatabaseInfoProviderTest.java	2012-12-21 12:59:39 +0000
@@ -27,7 +27,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static junit.framework.Assert.assertNotNull;
+import static org.junit.Assert.assertNotNull;
 
 import org.hisp.dhis.DhisSpringTest;
 import org.junit.Test;

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/filter/AggregatableDataElementFilterTest.java'
--- dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/filter/AggregatableDataElementFilterTest.java	2010-05-10 17:50:39 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/filter/AggregatableDataElementFilterTest.java	2012-12-21 12:59:39 +0000
@@ -1,6 +1,6 @@
 package org.hisp.dhis.system.filter;
 
-import static junit.framework.Assert.assertEquals;
+import static org.junit.Assert.assertEquals;
 
 import java.util.HashSet;
 import java.util.Set;

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/filter/DataElementWithAggregationFilterTest.java'
--- dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/filter/DataElementWithAggregationFilterTest.java	2012-07-12 09:32:15 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/filter/DataElementWithAggregationFilterTest.java	2012-12-21 12:59:39 +0000
@@ -1,7 +1,7 @@
 package org.hisp.dhis.system.filter;
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertTrue;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 
 import java.util.ArrayList;
 import java.util.List;

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/grid/GridTest.java'
--- dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/grid/GridTest.java	2012-05-01 14:21:21 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/grid/GridTest.java	2012-12-21 12:59:39 +0000
@@ -27,9 +27,9 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertTrue;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 
 import java.util.ArrayList;
 import java.util.Collections;

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/grid/GridUtilsTest.java'
--- dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/grid/GridUtilsTest.java	2012-10-18 19:13:26 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/grid/GridUtilsTest.java	2012-12-21 12:59:39 +0000
@@ -34,7 +34,7 @@
 import org.junit.Test;
 import org.springframework.core.io.ClassPathResource;
 
-import static junit.framework.Assert.*;
+import static org.junit.Assert.*;
 
 /**
  * @author Lars Helge Overland

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/notification/NotifierTest.java'
--- dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/notification/NotifierTest.java	2012-04-12 20:05:29 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/notification/NotifierTest.java	2012-12-21 12:59:39 +0000
@@ -27,9 +27,9 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertNull;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
 
 import java.util.List;
 

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/util/ConversionUtilsTest.java'
--- dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/util/ConversionUtilsTest.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/util/ConversionUtilsTest.java	2012-12-21 12:59:39 +0000
@@ -27,7 +27,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static junit.framework.Assert.assertEquals;
+import static org.junit.Assert.assertEquals;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -50,8 +50,8 @@
         double[] array = ConversionUtils.getArray( list );
         
         assertEquals( 3, array.length );
-        assertEquals( 1.0, array[0] );
-        assertEquals( 2.0, array[1] );
-        assertEquals( 3.0, array[2] );
+        assertEquals( 1.0, array[0], 0.01 );
+        assertEquals( 2.0, array[1], 0.01 );
+        assertEquals( 3.0, array[2], 0.01 );
     }
 }

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/util/DateUtilsTest.java'
--- dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/util/DateUtilsTest.java	2012-03-08 14:30:26 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/util/DateUtilsTest.java	2012-12-21 12:59:39 +0000
@@ -27,9 +27,9 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertTrue;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 import static org.hisp.dhis.system.util.DateUtils.convertDate;
 import static org.hisp.dhis.system.util.DateUtils.dateIsValid;
 

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/util/MathUtilsTest.java'
--- dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/util/MathUtilsTest.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/util/MathUtilsTest.java	2012-12-21 12:59:39 +0000
@@ -27,9 +27,9 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertTrue;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 import static org.hisp.dhis.expression.Operator.equal_to;
 import static org.hisp.dhis.expression.Operator.greater_than;
 import static org.hisp.dhis.expression.Operator.greater_than_or_equal_to;
@@ -65,7 +65,7 @@
     {
         double[] array = { 5.0, 2.0, 6.0, 12.0 };
         
-        assertEquals( 2.0, MathUtils.getMin( array ) );
+        assertEquals( 2.0, MathUtils.getMin( array ), 0.01 );
     }
 
     @Test
@@ -73,7 +73,7 @@
     {
         double[] array = { 5.0, 2.0, 12.0, 6.0 };
         
-        assertEquals( 12.0, MathUtils.getMax( array ) );
+        assertEquals( 12.0, MathUtils.getMax( array ), 0.01 );
     }
 
     @Test
@@ -116,6 +116,6 @@
     @Test
     public void testGetAverage()
     {
-        assertEquals( 7.5, MathUtils.getAverage( Arrays.asList( 5.0, 5.0, 10.0, 10.0 ) ) );
+        assertEquals( 7.5, MathUtils.getAverage( Arrays.asList( 5.0, 5.0, 10.0, 10.0 ) ), 0.01 );
     }
 }

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/util/PaginatedListTest.java'
--- dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/util/PaginatedListTest.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/util/PaginatedListTest.java	2012-12-21 12:59:39 +0000
@@ -27,10 +27,10 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertNull;
-import static junit.framework.Assert.assertTrue;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
 
 import java.util.ArrayList;
 import java.util.Arrays;

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/util/ReflectionUtilsTest.java'
--- dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/util/ReflectionUtilsTest.java	2012-01-19 14:20:31 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/util/ReflectionUtilsTest.java	2012-12-21 12:59:39 +0000
@@ -27,10 +27,10 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertNull;
-import static junit.framework.Assert.assertTrue;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
 import static org.hisp.dhis.system.util.ReflectionUtils.getClassName;
 import static org.hisp.dhis.system.util.ReflectionUtils.getId;
 import static org.hisp.dhis.system.util.ReflectionUtils.getProperty;

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/util/StreamUtilsTest.java'
--- dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/util/StreamUtilsTest.java	2012-07-04 20:16:23 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/util/StreamUtilsTest.java	2012-12-21 12:59:39 +0000
@@ -27,9 +27,9 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertTrue;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 
 import java.io.BufferedInputStream;
 import java.io.InputStreamReader;

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/util/TextUtilsTest.java'
--- dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/util/TextUtilsTest.java	2012-07-19 19:20:26 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/util/TextUtilsTest.java	2012-12-21 12:59:39 +0000
@@ -27,7 +27,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static junit.framework.Assert.assertEquals;
+import static org.junit.Assert.assertEquals;
 import static org.hisp.dhis.system.util.TextUtils.subString;
 import static org.hisp.dhis.system.util.TextUtils.trimEnd;
 import static org.hisp.dhis.system.util.TextUtils.*;

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/util/ValidationUtilsTest.java'
--- dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/util/ValidationUtilsTest.java	2012-10-22 16:28:40 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/util/ValidationUtilsTest.java	2012-12-21 12:59:39 +0000
@@ -27,10 +27,10 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertNull;
-import static junit.framework.Assert.assertTrue;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
 import static org.hisp.dhis.system.util.ValidationUtils.coordinateIsValid;
 import static org.hisp.dhis.system.util.ValidationUtils.getLatitude;
 import static org.hisp.dhis.system.util.ValidationUtils.getLongitude;

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/AnalyticsController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/AnalyticsController.java	2012-12-21 09:56:32 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/AnalyticsController.java	2012-12-21 12:59:39 +0000
@@ -45,9 +45,9 @@
 import org.springframework.web.bind.annotation.RequestMethod;
 
 @Controller
-@RequestMapping( "/analytics" )
 public class AnalyticsController
 {
+    private static final String RESOURCE_PATH = "/analytics";
     @Autowired
     private AnalyticsService analyticsService;
     
@@ -55,17 +55,20 @@
     private ContextUtils contextUtils;
     
     //TODO URL only requests
-    
-    @RequestMapping( method = RequestMethod.GET, consumes = { "application/json" }, produces = { "application/json", "application/javascript" } )
+
+    // -------------------------------------------------------------------------
+    // Resources
+    // -------------------------------------------------------------------------
+  
+    @RequestMapping( value = RESOURCE_PATH, method = RequestMethod.GET, produces = { "application/json", "application/javascript" } )
     public String getJson( InputStream in, // JSON, JSONP
         Model model,
         HttpServletResponse response ) throws Exception
     {
         DataQueryParams params = JacksonUtils.fromJson( in, DataQueryParams.class );
 
-        if ( params == null || params.getDimensions().isEmpty() )
+        if ( !valid( params, response ) )
         {
-            ContextUtils.conflictResponse( response, "At least one dimension must be specified" );
             return null;
         }
         
@@ -76,16 +79,15 @@
         return "grid";
     }
 
-    @RequestMapping( method = RequestMethod.GET, consumes = { "application/json" } )
+    @RequestMapping( value = RESOURCE_PATH + ".xml", method = RequestMethod.GET )
     public void getXml( InputStream in,
         Model model,
         HttpServletResponse response ) throws Exception
     {
         DataQueryParams params = JacksonUtils.fromJson( in, DataQueryParams.class );
 
-        if ( params == null || params.getDimensions().isEmpty() )
+        if ( !valid( params, response ) )
         {
-            ContextUtils.conflictResponse( response, "At least one dimension must be specified" );
             return;
         }
         
@@ -94,16 +96,15 @@
         GridUtils.toXml( grid, response.getOutputStream() );
     }
     
-    @RequestMapping( method = RequestMethod.GET, consumes = { "application/json" } )
+    @RequestMapping( value = RESOURCE_PATH + ".csv", method = RequestMethod.GET )
     public void getCsv( InputStream in,
         Model model,
         HttpServletResponse response ) throws Exception
     {
         DataQueryParams params = JacksonUtils.fromJson( in, DataQueryParams.class );
 
-        if ( params == null || params.getDimensions().isEmpty() )
+        if ( !valid( params, response ) )
         {
-            ContextUtils.conflictResponse( response, "At least one dimension must be specified" );
             return;
         }
         
@@ -112,16 +113,15 @@
         GridUtils.toCsv( grid, response.getOutputStream() );
     }
     
-    @RequestMapping( method = RequestMethod.GET, consumes = { "application/json" } )
+    @RequestMapping( value = RESOURCE_PATH + ".html", method = RequestMethod.GET )
     public void getHtml( InputStream in,
         Model model,
         HttpServletResponse response ) throws Exception
     {
         DataQueryParams params = JacksonUtils.fromJson( in, DataQueryParams.class );
 
-        if ( params == null || params.getDimensions().isEmpty() )
+        if ( !valid( params, response ) )
         {
-            ContextUtils.conflictResponse( response, "At least one dimension must be specified" );
             return;
         }
         
@@ -129,4 +129,25 @@
         Grid grid = analyticsService.getAggregatedDataValues( params );
         GridUtils.toHtml( grid, response.getWriter() );
     }
+
+    // -------------------------------------------------------------------------
+    // Supportive methods
+    // -------------------------------------------------------------------------
+  
+    private boolean valid( DataQueryParams params, HttpServletResponse response )
+    {
+        if ( params == null || params.getDimensions().isEmpty() )
+        {
+            ContextUtils.conflictResponse( response, "At least one dimension must be specified" );
+            return false;
+        }
+        
+        if ( !params.dimensionsAsFilters().isEmpty() )
+        {
+            ContextUtils.conflictResponse( response, "Dimensions cannot also be specified as filters: " + params.dimensionsAsFilters() );
+            return false;
+        }
+        
+        return true;        
+    }
 }