dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #03251
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1088: Removed unused method.
------------------------------------------------------------
revno: 1088
committer: Lars Helge Oeverland larshelge@xxxxxxxxx
branch nick: trunk
timestamp: Mon 2009-11-23 16:23:56 +0100
message:
Removed unused method.
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/datamart/DataMartStore.java
dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/jdbc/JdbcDataMartStore.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/DataMartServiceTest.java
dhis-2/dhis-services/dhis-service-datamart-default/src/test/java/org/hisp/dhis/datamart/DataMartServiceTimeDimensionTest.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-api/src/main/java/org/hisp/dhis/datamart/DataMartStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/datamart/DataMartStore.java 2009-11-23 15:04:54 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/datamart/DataMartStore.java 2009-11-23 15:23:56 +0000
@@ -83,16 +83,6 @@
* Gets the aggregated value from the datamart table for the given parameters.
*
* @param dataElement The DataElement.
- * @param period The Period.
- * @param organisationUnit The OrganisationUnit.
- * @return the aggregated value, or -1 if no value exists.
- */
- double getAggregatedValue( DataElement dataElement, Period period, OrganisationUnit organisationUnit );
-
- /**
- * Gets the aggregated value from the datamart table for the given parameters.
- *
- * @param dataElement The DataElement.
* @param categoryOptionCombo The DataElementCategoryOptionCombo.
* @param period The Period.
* @param organisationUnit The OrganisationUnit.
=== modified file 'dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/jdbc/JdbcDataMartStore.java'
--- dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/jdbc/JdbcDataMartStore.java 2009-11-23 15:04:54 +0000
+++ dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/jdbc/JdbcDataMartStore.java 2009-11-23 15:23:56 +0000
@@ -99,7 +99,7 @@
// AggregatedDataValue
// -------------------------------------------------------------------------
- public Double getTotalAggregatedValue( final DataElement dataElement, final Period period, final OrganisationUnit organisationUnit )
+ public Double getTotalAggregatedValue( DataElement dataElement, Period period, OrganisationUnit organisationUnit )
{
final String sql =
"SELECT " + functionMap.get( dataElement.getAggregationOperator() ) + "(value) " +
@@ -111,8 +111,8 @@
return statementManager.getHolder().queryForDouble( sql );
}
- public Double getTotalAggregatedValue( final DataElement dataElement,
- final DataElementCategoryOption categoryOption, final Period period, final OrganisationUnit organisationUnit )
+ public Double getTotalAggregatedValue( DataElement dataElement,
+ DataElementCategoryOption categoryOption, Period period, OrganisationUnit organisationUnit )
{
String ids = getCommaDelimitedString( getIdentifiers( DataElementCategoryOptionCombo.class, categoryOption.getCategoryOptionCombos() ) );
@@ -127,35 +127,8 @@
return statementManager.getHolder().queryForDouble( sql );
}
- public double getAggregatedValue( final DataElement dataElement, final Period period, final OrganisationUnit organisationUnit )
- {
- final StatementHolder holder = statementManager.getHolder();
-
- try
- {
- final String sql =
- "SELECT value " +
- "FROM aggregateddatavalue " +
- "WHERE dataelementid = " + dataElement.getId() + " " +
- "AND periodid = " + period.getId() + " " +
- "AND organisationunitid = " + organisationUnit.getId();
-
- final ResultSet resultSet = holder.getStatement().executeQuery( sql );
-
- return resultSet.next() ? resultSet.getDouble( 1 ) : -1;
- }
- catch ( SQLException ex )
- {
- throw new RuntimeException( "Failed to get aggregated data value", ex );
- }
- finally
- {
- holder.close();
- }
- }
-
- public double getAggregatedValue( final DataElement dataElement,
- final DataElementCategoryOptionCombo categoryOptionCombo, final Period period, final OrganisationUnit organisationUnit )
+ public double getAggregatedValue( DataElement dataElement,
+ DataElementCategoryOptionCombo categoryOptionCombo, Period period, OrganisationUnit organisationUnit )
{
final StatementHolder holder = statementManager.getHolder();
@@ -183,8 +156,8 @@
}
}
- public Collection<AggregatedDataValue> getAggregatedDataValues( final int dataElementId,
- final Collection<Integer> periodIds, final Collection<Integer> organisationUnitIds )
+ public Collection<AggregatedDataValue> getAggregatedDataValues( int dataElementId,
+ Collection<Integer> periodIds, Collection<Integer> organisationUnitIds )
{
final StatementHolder holder = statementManager.getHolder();
@@ -213,8 +186,7 @@
}
}
- public int deleteAggregatedDataValues( final Collection<Integer> dataElementIds,
- final Collection<Integer> periodIds, final Collection<Integer> organisationUnitIds )
+ public int deleteAggregatedDataValues( Collection<Integer> dataElementIds, Collection<Integer> periodIds, Collection<Integer> organisationUnitIds )
{
final String sql =
"DELETE FROM aggregateddatavalue " +
@@ -234,7 +206,7 @@
// AggregatedIndicatorValue
// -------------------------------------------------------------------------
- public double getAggregatedValue( final Indicator indicator, final Period period, final OrganisationUnit organisationUnit )
+ public double getAggregatedValue( Indicator indicator, Period period, OrganisationUnit organisationUnit )
{
final StatementHolder holder = statementManager.getHolder();
@@ -261,8 +233,7 @@
}
}
- public Collection<AggregatedIndicatorValue> getAggregatedIndicatorValues( final Collection<Integer> periodIds,
- final Collection<Integer> organisationUnitIds )
+ public Collection<AggregatedIndicatorValue> getAggregatedIndicatorValues( Collection<Integer> periodIds, Collection<Integer> organisationUnitIds )
{
final StatementHolder holder = statementManager.getHolder();
@@ -290,8 +261,8 @@
}
}
- public Collection<AggregatedIndicatorValue> getAggregatedIndicatorValues( final Collection<Integer> indicatorIds,
- final Collection<Integer> periodIds, final Collection<Integer> organisationUnitIds )
+ public Collection<AggregatedIndicatorValue> getAggregatedIndicatorValues( Collection<Integer> indicatorIds,
+ Collection<Integer> periodIds, Collection<Integer> organisationUnitIds )
{
final StatementHolder holder = statementManager.getHolder();
@@ -320,8 +291,8 @@
}
}
- public int deleteAggregatedIndicatorValues( final Collection<Integer> indicatorIds, final Collection<Integer> periodIds,
- final Collection<Integer> organisationUnitIds )
+ public int deleteAggregatedIndicatorValues( Collection<Integer> indicatorIds, Collection<Integer> periodIds,
+ Collection<Integer> organisationUnitIds )
{
final String sql =
"DELETE FROM aggregatedindicatorvalue " +
@@ -341,7 +312,7 @@
// AggregatedMapValue
// -------------------------------------------------------------------------
- public Collection<AggregatedMapValue> getAggregatedMapValues( final int indicatorId, final int periodId, final int level )
+ public Collection<AggregatedMapValue> getAggregatedMapValues( int indicatorId, int periodId, int level )
{
final StatementHolder holder = statementManager.getHolder();
@@ -375,7 +346,7 @@
// DataValue
// -------------------------------------------------------------------------
- public Collection<DeflatedDataValue> getDeflatedDataValues( final int dataElementId, final int periodId, final Collection<Integer> sourceIds )
+ public Collection<DeflatedDataValue> getDeflatedDataValues( int dataElementId, int periodId, Collection<Integer> sourceIds )
{
final StatementHolder holder = statementManager.getHolder();
@@ -403,7 +374,7 @@
}
}
- public DataValue getDataValue( final int dataElementId, final int categoryOptionComboId, final int periodId, final int sourceId )
+ public DataValue getDataValue( int dataElementId, int categoryOptionComboId, int periodId, int sourceId )
{
final StatementHolder holder = statementManager.getHolder();
@@ -432,7 +403,7 @@
}
}
- public Map<Operand, String> getDataValueMap( final int periodId, final int sourceId )
+ public Map<Operand, String> getDataValueMap( int periodId, int sourceId )
{
final StatementHolder holder = statementManager.getHolder();
@@ -471,8 +442,8 @@
// CrossTabDataValue
// -------------------------------------------------------------------------
- public Collection<CrossTabDataValue> getCrossTabDataValues( final Map<Operand, Integer> operandIndexMap,
- final Collection<Integer> periodIds, final Collection<Integer> sourceIds )
+ public Collection<CrossTabDataValue> getCrossTabDataValues( Map<Operand, Integer> operandIndexMap,
+ Collection<Integer> periodIds, Collection<Integer> sourceIds )
{
final StatementHolder holder = statementManager.getHolder();
@@ -498,8 +469,7 @@
}
}
- public Collection<CrossTabDataValue> getCrossTabDataValues( final Map<Operand, Integer> operandIndexMap,
- final Collection<Integer> periodIds, final int sourceId )
+ public Collection<CrossTabDataValue> getCrossTabDataValues( Map<Operand, Integer> operandIndexMap, Collection<Integer> periodIds, int sourceId )
{
final StatementHolder holder = statementManager.getHolder();
@@ -538,7 +508,7 @@
// Supportive methods
// -------------------------------------------------------------------------
- private Collection<CrossTabDataValue> getCrossTabDataValues( final ResultSet resultSet, final Map<Operand, Integer> operandIndexMap )
+ private Collection<CrossTabDataValue> getCrossTabDataValues( ResultSet resultSet, Map<Operand, Integer> operandIndexMap )
throws SQLException
{
final Collection<CrossTabDataValue> values = new ArrayList<CrossTabDataValue>();
=== 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 2009-11-07 14:09:00 +0000
+++ dhis-2/dhis-services/dhis-service-datamart-default/src/test/java/org/hisp/dhis/datamart/DataMartServiceAggregationLevelsTest.java 2009-11-23 15:23:56 +0000
@@ -208,19 +208,19 @@
dataMartService.export( dataElementIds, new ArrayList<Integer>(), periodIds, organisationUnitIds );
- assertEquals( 280.0, dataMartStore.getAggregatedValue( dataElement, period, unitA ) );
- assertEquals( 240.0, dataMartStore.getAggregatedValue( dataElement, period, unitB ) );
- assertEquals( 40.0, dataMartStore.getAggregatedValue( dataElement, period, unitC ) );
- assertEquals( 60.0, dataMartStore.getAggregatedValue( dataElement, period, unitD ) );
- assertEquals( 70.0, dataMartStore.getAggregatedValue( dataElement, period, unitE ) );
- assertEquals( 90.0, dataMartStore.getAggregatedValue( dataElement, period, unitF ) );
- assertEquals( 315.0, dataMartStore.getAggregatedValue( dataElement, period, unitG ) );
- assertEquals( 75.0, dataMartStore.getAggregatedValue( dataElement, period, unitH ) );
- assertEquals( 100.0, dataMartStore.getAggregatedValue( dataElement, period, unitI ) );
- assertEquals( 200.0, dataMartStore.getAggregatedValue( dataElement, period, unitJ ) );
- assertEquals( 55.0, dataMartStore.getAggregatedValue( dataElement, period, unitK ) );
- assertEquals( 75.0, dataMartStore.getAggregatedValue( dataElement, period, unitL ) );
- assertEquals( 60.0, dataMartStore.getAggregatedValue( dataElement, period, unitM ) );
+ assertEquals( 280.0, dataMartStore.getAggregatedValue( dataElement, categoryOptionCombo, period, unitA ) );
+ assertEquals( 240.0, dataMartStore.getAggregatedValue( dataElement, categoryOptionCombo, period, unitB ) );
+ assertEquals( 40.0, dataMartStore.getAggregatedValue( dataElement, categoryOptionCombo, period, unitC ) );
+ assertEquals( 60.0, dataMartStore.getAggregatedValue( dataElement, categoryOptionCombo, period, unitD ) );
+ assertEquals( 70.0, dataMartStore.getAggregatedValue( dataElement, categoryOptionCombo, period, unitE ) );
+ assertEquals( 90.0, dataMartStore.getAggregatedValue( dataElement, categoryOptionCombo, period, unitF ) );
+ assertEquals( 315.0, dataMartStore.getAggregatedValue( dataElement, categoryOptionCombo, period, unitG ) );
+ assertEquals( 75.0, dataMartStore.getAggregatedValue( dataElement, categoryOptionCombo, period, unitH ) );
+ assertEquals( 100.0, dataMartStore.getAggregatedValue( dataElement, categoryOptionCombo, period, unitI ) );
+ assertEquals( 200.0, dataMartStore.getAggregatedValue( dataElement, categoryOptionCombo, period, unitJ ) );
+ assertEquals( 55.0, dataMartStore.getAggregatedValue( dataElement, categoryOptionCombo, period, unitK ) );
+ assertEquals( 75.0, dataMartStore.getAggregatedValue( dataElement, categoryOptionCombo, period, unitL ) );
+ assertEquals( 60.0, dataMartStore.getAggregatedValue( dataElement, categoryOptionCombo, period, unitM ) );
}
@Test
@@ -234,18 +234,18 @@
dataMartService.export( dataElementIds, new ArrayList<Integer>(), periodIds, organisationUnitIds );
- assertEquals( 280.0, dataMartStore.getAggregatedValue( dataElement, period, unitA ) );
- assertEquals( 240.0, dataMartStore.getAggregatedValue( dataElement, period, unitB ) );
- assertEquals( 40.0, dataMartStore.getAggregatedValue( dataElement, period, unitC ) );
- assertEquals( 60.0, dataMartStore.getAggregatedValue( dataElement, period, unitD ) );
- assertEquals( 70.0, dataMartStore.getAggregatedValue( dataElement, period, unitE ) );
- assertEquals( 90.0, dataMartStore.getAggregatedValue( dataElement, period, unitF ) );
- assertEquals( 315.0, dataMartStore.getAggregatedValue( dataElement, period, unitG ) );
- assertEquals( 75.0, dataMartStore.getAggregatedValue( dataElement, period, unitH ) );
- assertEquals( 100.0, dataMartStore.getAggregatedValue( dataElement, period, unitI ) );
- assertEquals( 200.0, dataMartStore.getAggregatedValue( dataElement, period, unitJ ) );
- assertEquals( 55.0, dataMartStore.getAggregatedValue( dataElement, period, unitK ) );
- assertEquals( 75.0, dataMartStore.getAggregatedValue( dataElement, period, unitL ) );
- assertEquals( 60.0, dataMartStore.getAggregatedValue( dataElement, period, unitM ) );
+ assertEquals( 280.0, dataMartStore.getAggregatedValue( dataElement, categoryOptionCombo, period, unitA ) );
+ assertEquals( 240.0, dataMartStore.getAggregatedValue( dataElement, categoryOptionCombo, period, unitB ) );
+ assertEquals( 40.0, dataMartStore.getAggregatedValue( dataElement, categoryOptionCombo, period, unitC ) );
+ assertEquals( 60.0, dataMartStore.getAggregatedValue( dataElement, categoryOptionCombo, period, unitD ) );
+ assertEquals( 70.0, dataMartStore.getAggregatedValue( dataElement, categoryOptionCombo, period, unitE ) );
+ assertEquals( 90.0, dataMartStore.getAggregatedValue( dataElement, categoryOptionCombo, period, unitF ) );
+ assertEquals( 315.0, dataMartStore.getAggregatedValue( dataElement, categoryOptionCombo, period, unitG ) );
+ assertEquals( 75.0, dataMartStore.getAggregatedValue( dataElement, categoryOptionCombo, period, unitH ) );
+ assertEquals( 100.0, dataMartStore.getAggregatedValue( dataElement, categoryOptionCombo, period, unitI ) );
+ assertEquals( 200.0, dataMartStore.getAggregatedValue( dataElement, categoryOptionCombo, period, unitJ ) );
+ assertEquals( 55.0, dataMartStore.getAggregatedValue( dataElement, categoryOptionCombo, period, unitK ) );
+ assertEquals( 75.0, dataMartStore.getAggregatedValue( dataElement, categoryOptionCombo, period, unitL ) );
+ assertEquals( 60.0, dataMartStore.getAggregatedValue( dataElement, categoryOptionCombo, period, unitM ) );
}
}
=== 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 2009-11-06 10:50:01 +0000
+++ dhis-2/dhis-services/dhis-service-datamart-default/src/test/java/org/hisp/dhis/datamart/DataMartServiceTest.java 2009-11-23 15:23:56 +0000
@@ -249,23 +249,23 @@
dataMartService.export( dataElementIds, indicatorIds, periodIds, organisationUnitIds );
- assertEquals( dataMartStore.getAggregatedValue( dataElementA, periodA, unitA ), 240.0 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementA, periodA, unitB ), 150.0 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementA, periodA, unitC ), 90.0 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementA, periodA, unitD ), 10.0 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementA, periodA, unitE ), 35.0 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementA, periodA, unitF ), 105.0 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementA, periodA, unitG ), 20.0 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementA, periodA, unitH ), 60.0 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitA ), 240.0 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitB ), 150.0 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitC ), 90.0 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitD ), 10.0 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitE ), 35.0 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitF ), 105.0 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitG ), 20.0 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitH ), 60.0 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementA, periodD, unitA ), 835.0 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementA, periodD, unitB ), 580.0 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementA, periodD, unitC ), 255.0 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementA, periodD, unitD ), 90.0 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementA, periodD, unitE ), 145.0 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementA, periodD, unitF ), 345.0 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementA, periodD, unitG ), 90.0 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementA, periodD, unitH ), 145.0 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitA ), 835.0 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitB ), 580.0 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitC ), 255.0 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitD ), 90.0 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitE ), 145.0 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitF ), 345.0 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitG ), 90.0 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitH ), 145.0 );
}
@Test
@@ -277,23 +277,23 @@
dataMartService.export( dataElementIds, indicatorIds, periodIds, organisationUnitIds );
- assertEquals( dataMartStore.getAggregatedValue( dataElementA, periodA, unitA ), 240.0 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementA, periodA, unitB ), 150.0 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementA, periodA, unitC ), 90.0 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementA, periodA, unitD ), 10.0 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementA, periodA, unitE ), 35.0 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementA, periodA, unitF ), 105.0 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementA, periodA, unitG ), 20.0 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementA, periodA, unitH ), 60.0 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitA ), 240.0 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitB ), 150.0 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitC ), 90.0 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitD ), 10.0 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitE ), 35.0 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitF ), 105.0 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitG ), 20.0 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementA, categoryOptionCombo, periodA, unitH ), 60.0 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementA, periodD, unitA ), 278.9 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementA, periodD, unitB ), 193.8 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementA, periodD, unitC ), 85.1 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementA, periodD, unitD ), 30.1 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementA, periodD, unitE ), 48.3 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementA, periodD, unitF ), 115.4 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementA, periodD, unitG ), 30.2 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementA, periodD, unitH ), 48.6 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitA ), 278.9 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitB ), 193.8 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitC ), 85.1 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitD ), 30.1 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitE ), 48.3 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitF ), 115.4 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitG ), 30.2 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementA, categoryOptionCombo, periodD, unitH ), 48.6 );
}
@Test
@@ -305,23 +305,23 @@
dataMartService.export( dataElementIds, indicatorIds, periodIds, organisationUnitIds );
- assertEquals( dataMartStore.getAggregatedValue( dataElementB, periodA, unitA ), 4.0 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementB, periodA, unitB ), 3.0 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementB, periodA, unitC ), 1.0 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementB, periodA, unitD ), 1.0 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementB, periodA, unitE ), 0.0 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementB, periodA, unitF ), 2.0 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementB, periodA, unitG ), 0.0 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementB, periodA, unitH ), 1.0 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitA ), 4.0 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitB ), 3.0 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitC ), 1.0 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitD ), 1.0 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitE ), 0.0 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitF ), 2.0 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitG ), 0.0 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitH ), 1.0 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementB, periodD, unitA ), 12.0 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementB, periodD, unitB ), 10.0 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementB, periodD, unitC ), 2.0 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementB, periodD, unitD ), 2.0 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementB, periodD, unitE ), 1.0 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementB, periodD, unitF ), 7.0 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementB, periodD, unitG ), 1.0 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementB, periodD, unitH ), 3.0 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitA ), 12.0 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitB ), 10.0 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitC ), 2.0 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitD ), 2.0 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitE ), 1.0 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitF ), 7.0 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitG ), 1.0 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitH ), 3.0 );
}
@Test
@@ -333,23 +333,23 @@
dataMartService.export( dataElementIds, indicatorIds, periodIds, organisationUnitIds );
- assertEquals( dataMartStore.getAggregatedValue( dataElementB, periodA, unitA ), 66.7 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementB, periodA, unitB ), 60.0 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementB, periodA, unitC ), 100.0 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementB, periodA, unitD ), 100.0 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementB, periodA, unitE ), 0.0 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementB, periodA, unitF ), 66.7 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementB, periodA, unitG ), 0.0 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementB, periodA, unitH ), 100.0 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitA ), 66.7 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitB ), 60.0 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitC ), 100.0 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitD ), 100.0 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitE ), 0.0 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitF ), 66.7 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitG ), 0.0 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementB, categoryOptionCombo, periodA, unitH ), 100.0 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementB, periodD, unitA ), 66.7 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementB, periodD, unitB ), 66.8 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementB, periodD, unitC ), 65.9 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementB, periodD, unitD ), 67.0 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementB, periodD, unitE ), 33.0 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementB, periodD, unitF ), 78.0 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementB, periodD, unitG ), 34.1 );
- assertEquals( dataMartStore.getAggregatedValue( dataElementB, periodD, unitH ), 100.0 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitA ), 66.7 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitB ), 66.8 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitC ), 65.9 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitD ), 67.0 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitE ), 33.0 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitF ), 78.0 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitG ), 34.1 );
+ assertEquals( dataMartStore.getAggregatedValue( dataElementB, categoryOptionCombo, periodD, unitH ), 100.0 );
}
@Test
=== 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 2009-11-07 14:09:00 +0000
+++ dhis-2/dhis-services/dhis-service-datamart-default/src/test/java/org/hisp/dhis/datamart/DataMartServiceTimeDimensionTest.java 2009-11-23 15:23:56 +0000
@@ -129,9 +129,9 @@
dataMartService.export( dataElementIds, indicatorIds, periodIds, organisationUnitIds );
- assertEquals( 100.0, dataMartStore.getAggregatedValue( dataElement, periodA, unit ) );
- assertEquals( 100.0, dataMartStore.getAggregatedValue( dataElement, periodB, unit ) );
- assertEquals( 100.0, dataMartStore.getAggregatedValue( dataElement, periodC, unit ) );
+ assertEquals( 100.0, dataMartStore.getAggregatedValue( dataElement, categoryOptionCombo, periodA, unit ) );
+ assertEquals( 100.0, dataMartStore.getAggregatedValue( dataElement, categoryOptionCombo, periodB, unit ) );
+ assertEquals( 100.0, dataMartStore.getAggregatedValue( dataElement, categoryOptionCombo, periodC, unit ) );
}
@Test
@@ -162,6 +162,6 @@
dataMartService.export( dataElementIds, indicatorIds, periodIds, organisationUnitIds );
- assertEquals( 60.0, dataMartStore.getAggregatedValue( dataElement, periodA, unit ) );
+ assertEquals( 60.0, dataMartStore.getAggregatedValue( dataElement, categoryOptionCombo, periodA, unit ) );
}
}