dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #10278
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2829: Made the crosstabbing routine in report table a bit more readable
------------------------------------------------------------
revno: 2829
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2011-02-08 17:48:37 +0100
message:
Made the crosstabbing routine in report table a bit more readable
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java
dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/reporttable/jdbc/JDBCReportTableManager.java
dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/reporttable/ReportTableManagerTest.java
dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/reporttable/ReportTableTest.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/reporttable/ReportTable.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java 2011-02-08 13:34:57 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java 2011-02-08 16:48:37 +0000
@@ -123,7 +123,16 @@
put( MODE_DATAELEMENTS, DATAELEMENT_NAME );
put( MODE_DATASETS, DATASET_NAME );
} };
-
+
+ private static final Map<Class<?>, String> CLASS_ID_MAP = new HashMap<Class<?>, String>() { {
+ put( Indicator.class, INDICATOR_ID );
+ put( DataElement.class, DATAELEMENT_ID );
+ put( DataElementCategoryOptionCombo.class, CATEGORYCOMBO_ID );
+ put( DataSet.class, DATASET_ID );
+ put( Period.class, PERIOD_ID );
+ put( OrganisationUnit.class, ORGANISATIONUNIT_ID );
+ } };
+
// -------------------------------------------------------------------------
// Persisted properties
// -------------------------------------------------------------------------
@@ -706,6 +715,15 @@
columns.addAll( selectColumns );
return columns;
}
+
+ /**
+ * Generates an identifier based on the IdentifiableObject class and object
+ * identifier.
+ */
+ public static String getIdentifier( IdentifiableObject object )
+ {
+ return CLASS_ID_MAP.get( object.getClass() ) + object.getId();
+ }
// -------------------------------------------------------------------------
// Supportive methods
@@ -797,7 +815,7 @@
for ( IdentifiableObject object : objects )
{
- buffer.append( object != null ? ( object.getId() + SEPARATOR ) : EMPTY );
+ buffer.append( object != null ? ( getIdentifier( object ) + SEPARATOR ) : EMPTY );
}
return buffer.length() > 0 ? buffer.substring( 0, buffer.lastIndexOf( SEPARATOR ) ) : buffer.toString();
=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/reporttable/jdbc/JDBCReportTableManager.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/reporttable/jdbc/JDBCReportTableManager.java 2011-02-06 14:55:33 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/reporttable/jdbc/JDBCReportTableManager.java 2011-02-08 16:48:37 +0000
@@ -164,8 +164,8 @@
final StringBuffer identifier = new StringBuffer(); // Identifies a row in the report table
for ( String col : reportTable.getSelectColumns() )
- {
- identifier.append( resultSet.getInt( col ) + SEPARATOR );
+ {
+ identifier.append( col + resultSet.getInt( col ) + SEPARATOR );
}
final String key = identifier.substring( 0, identifier.lastIndexOf( SEPARATOR ) );
=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/reporttable/ReportTableManagerTest.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/reporttable/ReportTableManagerTest.java 2011-02-03 17:03:02 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/reporttable/ReportTableManagerTest.java 2011-02-08 16:48:37 +0000
@@ -29,7 +29,7 @@
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertNotNull;
-import static org.hisp.dhis.reporttable.ReportTable.SEPARATOR;
+import static org.hisp.dhis.reporttable.ReportTable.*;
import java.util.ArrayList;
import java.util.HashMap;
@@ -308,10 +308,10 @@
Map<String, Double> reference = new HashMap<String, Double>();
- reference.put( Integer.valueOf( 'A' ) + SEPARATOR + Integer.valueOf( 'A' ), 10.0 );
- reference.put( Integer.valueOf( 'A' ) + SEPARATOR + Integer.valueOf( 'B' ), 10.0 );
- reference.put( Integer.valueOf( 'B' ) + SEPARATOR + Integer.valueOf( 'A' ), 10.0 );
- reference.put( Integer.valueOf( 'B' ) + SEPARATOR + Integer.valueOf( 'B' ), 10.0 );
+ reference.put( INDICATOR_ID + Integer.valueOf( 'A' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'A' ), 10.0 );
+ reference.put( INDICATOR_ID + Integer.valueOf( 'A' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'B' ), 10.0 );
+ reference.put( INDICATOR_ID + Integer.valueOf( 'B' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'A' ), 10.0 );
+ reference.put( INDICATOR_ID + Integer.valueOf( 'B' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'B' ), 10.0 );
assertEquals( reference, map );
}
@@ -347,10 +347,10 @@
Map<String, Double> reference = new HashMap<String, Double>();
- reference.put( Integer.valueOf( 'A' ) + SEPARATOR + Integer.valueOf( 'A' ), 10.0 );
- reference.put( Integer.valueOf( 'A' ) + SEPARATOR + Integer.valueOf( 'B' ), 10.0 );
- reference.put( Integer.valueOf( 'B' ) + SEPARATOR + Integer.valueOf( 'A' ), 10.0 );
- reference.put( Integer.valueOf( 'B' ) + SEPARATOR + Integer.valueOf( 'B' ), 10.0 );
+ reference.put( DATAELEMENT_ID + Integer.valueOf( 'A' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'A' ), 10.0 );
+ reference.put( DATAELEMENT_ID + Integer.valueOf( 'A' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'B' ), 10.0 );
+ reference.put( DATAELEMENT_ID + Integer.valueOf( 'B' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'A' ), 10.0 );
+ reference.put( DATAELEMENT_ID + Integer.valueOf( 'B' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'B' ), 10.0 );
assertEquals( reference, map );
}
@@ -386,10 +386,10 @@
Map<String, Double> reference = new HashMap<String, Double>();
- reference.put( Integer.valueOf( 'A' ) + SEPARATOR + Integer.valueOf( 'A' ) + SEPARATOR + Integer.valueOf( 'A' ), 10.0 );
- reference.put( Integer.valueOf( 'A' ) + SEPARATOR + Integer.valueOf( 'B' ) + SEPARATOR + Integer.valueOf( 'B' ), 10.0 );
- reference.put( Integer.valueOf( 'B' ) + SEPARATOR + Integer.valueOf( 'A' ) + SEPARATOR + Integer.valueOf( 'A' ), 10.0 );
- reference.put( Integer.valueOf( 'B' ) + SEPARATOR + Integer.valueOf( 'B' ) + SEPARATOR + Integer.valueOf( 'B' ), 10.0 );
+ reference.put( DATAELEMENT_ID + Integer.valueOf( 'A' ) + SEPARATOR + CATEGORYCOMBO_ID + Integer.valueOf( 'A' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'A' ), 10.0 );
+ reference.put( DATAELEMENT_ID + Integer.valueOf( 'A' ) + SEPARATOR + CATEGORYCOMBO_ID + Integer.valueOf( 'B' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'B' ), 10.0 );
+ reference.put( DATAELEMENT_ID + Integer.valueOf( 'B' ) + SEPARATOR + CATEGORYCOMBO_ID + Integer.valueOf( 'A' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'A' ), 10.0 );
+ reference.put( DATAELEMENT_ID + Integer.valueOf( 'B' ) + SEPARATOR + CATEGORYCOMBO_ID + Integer.valueOf( 'B' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'B' ), 10.0 );
assertEquals( reference, map );
}
@@ -425,10 +425,10 @@
Map<String, Double> reference = new HashMap<String, Double>();
- reference.put( Integer.valueOf( 'A' ) + SEPARATOR + Integer.valueOf( 'A' ), 50.0 );
- reference.put( Integer.valueOf( 'A' ) + SEPARATOR + Integer.valueOf( 'B' ), 50.0 );
- reference.put( Integer.valueOf( 'B' ) + SEPARATOR + Integer.valueOf( 'A' ), 50.0 );
- reference.put( Integer.valueOf( 'B' ) + SEPARATOR + Integer.valueOf( 'B' ), 50.0 );
+ reference.put( DATASET_ID + Integer.valueOf( 'A' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'A' ), 50.0 );
+ reference.put( DATASET_ID + Integer.valueOf( 'A' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'B' ), 50.0 );
+ reference.put( DATASET_ID + Integer.valueOf( 'B' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'A' ), 50.0 );
+ reference.put( DATASET_ID + Integer.valueOf( 'B' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'B' ), 50.0 );
assertEquals( reference, map );
}
=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/reporttable/ReportTableTest.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/reporttable/ReportTableTest.java 2011-01-06 09:03:29 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/reporttable/ReportTableTest.java 2011-02-08 16:48:37 +0000
@@ -30,7 +30,7 @@
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertNotNull;
import static junit.framework.Assert.assertTrue;
-import static org.hisp.dhis.reporttable.ReportTable.SEPARATOR;
+import static org.hisp.dhis.reporttable.ReportTable.*;
import java.util.ArrayList;
import java.util.HashSet;
@@ -246,14 +246,14 @@
assertNotNull( crossTabIdentifiers );
assertEquals( 8, crossTabIdentifiers.size() );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'A' ) + SEPARATOR + Integer.valueOf( 'A' ) ) );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'A' ) + SEPARATOR + Integer.valueOf( 'B' ) ) );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'A' ) + SEPARATOR + Integer.valueOf( 'C' ) ) );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'A' ) + SEPARATOR + Integer.valueOf( 'D' ) ) );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'B' ) + SEPARATOR + Integer.valueOf( 'A' ) ) );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'B' ) + SEPARATOR + Integer.valueOf( 'B' ) ) );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'B' ) + SEPARATOR + Integer.valueOf( 'C' ) ) );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'B' ) + SEPARATOR + Integer.valueOf( 'D' ) ) );
+ assertTrue( crossTabIdentifiers.contains( INDICATOR_ID + Integer.valueOf( 'A' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'A' ) ) );
+ assertTrue( crossTabIdentifiers.contains( INDICATOR_ID + Integer.valueOf( 'A' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'B' ) ) );
+ assertTrue( crossTabIdentifiers.contains( INDICATOR_ID + Integer.valueOf( 'A' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'C' ) ) );
+ assertTrue( crossTabIdentifiers.contains( INDICATOR_ID + Integer.valueOf( 'A' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'D' ) ) );
+ assertTrue( crossTabIdentifiers.contains( INDICATOR_ID + Integer.valueOf( 'B' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'A' ) ) );
+ assertTrue( crossTabIdentifiers.contains( INDICATOR_ID + Integer.valueOf( 'B' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'B' ) ) );
+ assertTrue( crossTabIdentifiers.contains( INDICATOR_ID + Integer.valueOf( 'B' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'C' ) ) );
+ assertTrue( crossTabIdentifiers.contains( INDICATOR_ID + Integer.valueOf( 'B' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'D' ) ) );
assertTrue( reportTable.getReportIndicators().contains( null ) );
assertTrue( reportTable.getReportPeriods().contains( null ) );
@@ -305,9 +305,9 @@
assertNotNull( crossTabIdentifiers );
assertEquals( 2, crossTabIdentifiers.size() );
-
- assertTrue( crossTabIdentifiers.contains( String.valueOf( Integer.valueOf( 'A' ) ) ) );
- assertTrue( crossTabIdentifiers.contains( String.valueOf( Integer.valueOf( 'B' ) ) ) );
+
+ assertTrue( crossTabIdentifiers.contains( ORGANISATIONUNIT_ID + Integer.valueOf( 'A' ) ) );
+ assertTrue( crossTabIdentifiers.contains( ORGANISATIONUNIT_ID + Integer.valueOf( 'B' ) ) );
assertTrue( reportTable.getReportIndicators().size() == 2 );
assertTrue( reportTable.getReportPeriods().size() == 4 );
@@ -361,11 +361,11 @@
assertNotNull( crossTabIdentifiers );
assertEquals( 4, crossTabIdentifiers.size() );
-
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'A' ) + SEPARATOR + Integer.valueOf( 'A' ) ) );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'A' ) + SEPARATOR + Integer.valueOf( 'B' ) ) );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'B' ) + SEPARATOR + Integer.valueOf( 'A' ) ) );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'B' ) + SEPARATOR + Integer.valueOf( 'B' ) ) );
+
+ assertTrue( crossTabIdentifiers.contains( INDICATOR_ID + Integer.valueOf( 'A' ) + SEPARATOR + ORGANISATIONUNIT_ID + Integer.valueOf( 'A' ) ) );
+ assertTrue( crossTabIdentifiers.contains( INDICATOR_ID + Integer.valueOf( 'A' ) + SEPARATOR + ORGANISATIONUNIT_ID + Integer.valueOf( 'B' ) ) );
+ assertTrue( crossTabIdentifiers.contains( INDICATOR_ID + Integer.valueOf( 'B' ) + SEPARATOR + ORGANISATIONUNIT_ID + Integer.valueOf( 'A' ) ) );
+ assertTrue( crossTabIdentifiers.contains( INDICATOR_ID + Integer.valueOf( 'B' ) + SEPARATOR + ORGANISATIONUNIT_ID + Integer.valueOf( 'B' ) ) );
assertTrue( reportTable.getReportIndicators().contains( null ) );
assertTrue( reportTable.getReportPeriods().size() == 4 );
@@ -420,14 +420,14 @@
assertNotNull( crossTabIdentifiers );
assertEquals( 8, crossTabIdentifiers.size() );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'A' ) + SEPARATOR + Integer.valueOf( 'A' ) ) );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'A' ) + SEPARATOR + Integer.valueOf( 'B' ) ) );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'A' ) + SEPARATOR + Integer.valueOf( 'C' ) ) );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'A' ) + SEPARATOR + Integer.valueOf( 'D' ) ) );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'B' ) + SEPARATOR + Integer.valueOf( 'A' ) ) );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'B' ) + SEPARATOR + Integer.valueOf( 'B' ) ) );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'B' ) + SEPARATOR + Integer.valueOf( 'C' ) ) );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'B' ) + SEPARATOR + Integer.valueOf( 'D' ) ) );
+ assertTrue( crossTabIdentifiers.contains( DATAELEMENT_ID + Integer.valueOf( 'A' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'A' ) ) );
+ assertTrue( crossTabIdentifiers.contains( DATAELEMENT_ID + Integer.valueOf( 'A' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'B' ) ) );
+ assertTrue( crossTabIdentifiers.contains( DATAELEMENT_ID + Integer.valueOf( 'A' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'C' ) ) );
+ assertTrue( crossTabIdentifiers.contains( DATAELEMENT_ID + Integer.valueOf( 'A' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'D' ) ) );
+ assertTrue( crossTabIdentifiers.contains( DATAELEMENT_ID + Integer.valueOf( 'B' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'A' ) ) );
+ assertTrue( crossTabIdentifiers.contains( DATAELEMENT_ID + Integer.valueOf( 'B' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'B' ) ) );
+ assertTrue( crossTabIdentifiers.contains( DATAELEMENT_ID + Integer.valueOf( 'B' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'C' ) ) );
+ assertTrue( crossTabIdentifiers.contains( DATAELEMENT_ID + Integer.valueOf( 'B' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'D' ) ) );
assertTrue( reportTable.getReportIndicators().contains( null ) );
assertTrue( reportTable.getReportPeriods().contains( null ) );
@@ -481,8 +481,8 @@
assertNotNull( crossTabIdentifiers );
assertEquals( 2, crossTabIdentifiers.size() );
- assertTrue( crossTabIdentifiers.contains( String.valueOf( Integer.valueOf( 'A' ) ) ) );
- assertTrue( crossTabIdentifiers.contains( String.valueOf( Integer.valueOf( 'B' ) ) ) );
+ assertTrue( crossTabIdentifiers.contains( ORGANISATIONUNIT_ID + Integer.valueOf( 'A' ) ) );
+ assertTrue( crossTabIdentifiers.contains( ORGANISATIONUNIT_ID + Integer.valueOf( 'B' ) ) );
assertTrue( reportTable.getReportIndicators().size() == 2 );
assertTrue( reportTable.getReportPeriods().size() == 4 );
@@ -537,10 +537,10 @@
assertNotNull( crossTabIdentifiers );
assertEquals( 4, crossTabIdentifiers.size() );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'A' ) + SEPARATOR + Integer.valueOf( 'A' ) ) );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'A' ) + SEPARATOR + Integer.valueOf( 'B' ) ) );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'B' ) + SEPARATOR + Integer.valueOf( 'A' ) ) );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'B' ) + SEPARATOR + Integer.valueOf( 'B' ) ) );
+ assertTrue( crossTabIdentifiers.contains( DATAELEMENT_ID + Integer.valueOf( 'A' ) + SEPARATOR + ORGANISATIONUNIT_ID + Integer.valueOf( 'A' ) ) );
+ assertTrue( crossTabIdentifiers.contains( DATAELEMENT_ID + Integer.valueOf( 'A' ) + SEPARATOR + ORGANISATIONUNIT_ID + Integer.valueOf( 'B' ) ) );
+ assertTrue( crossTabIdentifiers.contains( DATAELEMENT_ID + Integer.valueOf( 'B' ) + SEPARATOR + ORGANISATIONUNIT_ID + Integer.valueOf( 'A' ) ) );
+ assertTrue( crossTabIdentifiers.contains( DATAELEMENT_ID + Integer.valueOf( 'B' ) + SEPARATOR + ORGANISATIONUNIT_ID + Integer.valueOf( 'B' ) ) );
assertTrue( reportTable.getReportIndicators().contains( null ) );
assertTrue( reportTable.getReportPeriods().size() == 4 );
@@ -599,24 +599,24 @@
assertNotNull( crossTabIdentifiers );
assertEquals( 16, crossTabIdentifiers.size() );
-
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'A' ) + SEPARATOR + Integer.valueOf( 'A' ) + SEPARATOR + Integer.valueOf( 'A' ) ) );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'A' ) + SEPARATOR + Integer.valueOf( 'A' ) + SEPARATOR + Integer.valueOf( 'B' ) ) );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'A' ) + SEPARATOR + Integer.valueOf( 'A' ) + SEPARATOR + Integer.valueOf( 'C' ) ) );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'A' ) + SEPARATOR + Integer.valueOf( 'A' ) + SEPARATOR + Integer.valueOf( 'D' ) ) );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'B' ) + SEPARATOR + Integer.valueOf( 'A' ) + SEPARATOR + Integer.valueOf( 'A' ) ) );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'B' ) + SEPARATOR + Integer.valueOf( 'A' ) + SEPARATOR + Integer.valueOf( 'B' ) ) );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'B' ) + SEPARATOR + Integer.valueOf( 'A' ) + SEPARATOR + Integer.valueOf( 'C' ) ) );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'B' ) + SEPARATOR + Integer.valueOf( 'A' ) + SEPARATOR + Integer.valueOf( 'D' ) ) );
-
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'A' ) + SEPARATOR + Integer.valueOf( 'B' ) + SEPARATOR + Integer.valueOf( 'A' ) ) );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'A' ) + SEPARATOR + Integer.valueOf( 'B' ) + SEPARATOR + Integer.valueOf( 'B' ) ) );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'A' ) + SEPARATOR + Integer.valueOf( 'B' ) + SEPARATOR + Integer.valueOf( 'C' ) ) );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'A' ) + SEPARATOR + Integer.valueOf( 'B' ) + SEPARATOR + Integer.valueOf( 'D' ) ) );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'B' ) + SEPARATOR + Integer.valueOf( 'B' ) + SEPARATOR + Integer.valueOf( 'A' ) ) );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'B' ) + SEPARATOR + Integer.valueOf( 'B' ) + SEPARATOR + Integer.valueOf( 'B' ) ) );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'B' ) + SEPARATOR + Integer.valueOf( 'B' ) + SEPARATOR + Integer.valueOf( 'C' ) ) );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'B' ) + SEPARATOR + Integer.valueOf( 'B' ) + SEPARATOR + Integer.valueOf( 'D' ) ) );
+
+ assertTrue( crossTabIdentifiers.contains( DATAELEMENT_ID + Integer.valueOf( 'A' ) + SEPARATOR + CATEGORYCOMBO_ID + Integer.valueOf( 'A' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'A' ) ) );
+ assertTrue( crossTabIdentifiers.contains( DATAELEMENT_ID + Integer.valueOf( 'A' ) + SEPARATOR + CATEGORYCOMBO_ID + Integer.valueOf( 'A' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'B' ) ) );
+ assertTrue( crossTabIdentifiers.contains( DATAELEMENT_ID + Integer.valueOf( 'A' ) + SEPARATOR + CATEGORYCOMBO_ID + Integer.valueOf( 'A' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'C' ) ) );
+ assertTrue( crossTabIdentifiers.contains( DATAELEMENT_ID + Integer.valueOf( 'A' ) + SEPARATOR + CATEGORYCOMBO_ID + Integer.valueOf( 'A' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'D' ) ) );
+ assertTrue( crossTabIdentifiers.contains( DATAELEMENT_ID + Integer.valueOf( 'B' ) + SEPARATOR + CATEGORYCOMBO_ID + Integer.valueOf( 'A' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'A' ) ) );
+ assertTrue( crossTabIdentifiers.contains( DATAELEMENT_ID + Integer.valueOf( 'B' ) + SEPARATOR + CATEGORYCOMBO_ID + Integer.valueOf( 'A' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'B' ) ) );
+ assertTrue( crossTabIdentifiers.contains( DATAELEMENT_ID + Integer.valueOf( 'B' ) + SEPARATOR + CATEGORYCOMBO_ID + Integer.valueOf( 'A' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'C' ) ) );
+ assertTrue( crossTabIdentifiers.contains( DATAELEMENT_ID + Integer.valueOf( 'B' ) + SEPARATOR + CATEGORYCOMBO_ID + Integer.valueOf( 'A' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'D' ) ) );
+
+ assertTrue( crossTabIdentifiers.contains( DATAELEMENT_ID + Integer.valueOf( 'A' ) + SEPARATOR + CATEGORYCOMBO_ID + Integer.valueOf( 'B' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'A' ) ) );
+ assertTrue( crossTabIdentifiers.contains( DATAELEMENT_ID + Integer.valueOf( 'A' ) + SEPARATOR + CATEGORYCOMBO_ID + Integer.valueOf( 'B' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'B' ) ) );
+ assertTrue( crossTabIdentifiers.contains( DATAELEMENT_ID + Integer.valueOf( 'A' ) + SEPARATOR + CATEGORYCOMBO_ID + Integer.valueOf( 'B' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'C' ) ) );
+ assertTrue( crossTabIdentifiers.contains( DATAELEMENT_ID + Integer.valueOf( 'A' ) + SEPARATOR + CATEGORYCOMBO_ID + Integer.valueOf( 'B' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'D' ) ) );
+ assertTrue( crossTabIdentifiers.contains( DATAELEMENT_ID + Integer.valueOf( 'B' ) + SEPARATOR + CATEGORYCOMBO_ID + Integer.valueOf( 'B' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'A' ) ) );
+ assertTrue( crossTabIdentifiers.contains( DATAELEMENT_ID + Integer.valueOf( 'B' ) + SEPARATOR + CATEGORYCOMBO_ID + Integer.valueOf( 'B' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'B' ) ) );
+ assertTrue( crossTabIdentifiers.contains( DATAELEMENT_ID + Integer.valueOf( 'B' ) + SEPARATOR + CATEGORYCOMBO_ID + Integer.valueOf( 'B' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'C' ) ) );
+ assertTrue( crossTabIdentifiers.contains( DATAELEMENT_ID + Integer.valueOf( 'B' ) + SEPARATOR + CATEGORYCOMBO_ID + Integer.valueOf( 'B' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'D' ) ) );
assertTrue( reportTable.getReportIndicators().contains( null ) );
assertTrue( reportTable.getReportPeriods().contains( null ) );
@@ -673,10 +673,10 @@
assertNotNull( crossTabIdentifiers );
assertEquals( 4, crossTabIdentifiers.size() );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'A' ) + SEPARATOR + Integer.valueOf( 'A' ) ) );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'A' ) + SEPARATOR + Integer.valueOf( 'B' ) ) );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'B' ) + SEPARATOR + Integer.valueOf( 'A' ) ) );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'B' ) + SEPARATOR + Integer.valueOf( 'B' ) ) );
+ assertTrue( crossTabIdentifiers.contains( CATEGORYCOMBO_ID + Integer.valueOf( 'A' ) + SEPARATOR + ORGANISATIONUNIT_ID + Integer.valueOf( 'A' ) ) );
+ assertTrue( crossTabIdentifiers.contains( CATEGORYCOMBO_ID + Integer.valueOf( 'A' ) + SEPARATOR + ORGANISATIONUNIT_ID + Integer.valueOf( 'B' ) ) );
+ assertTrue( crossTabIdentifiers.contains( CATEGORYCOMBO_ID + Integer.valueOf( 'B' ) + SEPARATOR + ORGANISATIONUNIT_ID + Integer.valueOf( 'A' ) ) );
+ assertTrue( crossTabIdentifiers.contains( CATEGORYCOMBO_ID + Integer.valueOf( 'B' ) + SEPARATOR + ORGANISATIONUNIT_ID + Integer.valueOf( 'B' ) ) );
assertTrue( reportTable.getReportIndicators().size() == 2 );
assertTrue( reportTable.getReportPeriods().size() == 4 );
@@ -736,14 +736,14 @@
assertNotNull( crossTabIdentifiers );
assertEquals( 8, crossTabIdentifiers.size() );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'A' ) + SEPARATOR + Integer.valueOf( 'A' ) ) );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'A' ) + SEPARATOR + Integer.valueOf( 'B' ) ) );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'A' ) + SEPARATOR + Integer.valueOf( 'C' ) ) );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'A' ) + SEPARATOR + Integer.valueOf( 'D' ) ) );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'B' ) + SEPARATOR + Integer.valueOf( 'A' ) ) );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'B' ) + SEPARATOR + Integer.valueOf( 'B' ) ) );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'B' ) + SEPARATOR + Integer.valueOf( 'C' ) ) );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'B' ) + SEPARATOR + Integer.valueOf( 'D' ) ) );
+ assertTrue( crossTabIdentifiers.contains( DATASET_ID + Integer.valueOf( 'A' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'A' ) ) );
+ assertTrue( crossTabIdentifiers.contains( DATASET_ID + Integer.valueOf( 'A' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'B' ) ) );
+ assertTrue( crossTabIdentifiers.contains( DATASET_ID + Integer.valueOf( 'A' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'C' ) ) );
+ assertTrue( crossTabIdentifiers.contains( DATASET_ID + Integer.valueOf( 'A' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'D' ) ) );
+ assertTrue( crossTabIdentifiers.contains( DATASET_ID + Integer.valueOf( 'B' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'A' ) ) );
+ assertTrue( crossTabIdentifiers.contains( DATASET_ID + Integer.valueOf( 'B' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'B' ) ) );
+ assertTrue( crossTabIdentifiers.contains( DATASET_ID + Integer.valueOf( 'B' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'C' ) ) );
+ assertTrue( crossTabIdentifiers.contains( DATASET_ID + Integer.valueOf( 'B' ) + SEPARATOR + PERIOD_ID + Integer.valueOf( 'D' ) ) );
assertTrue( reportTable.getReportIndicators().contains( null ) );
assertTrue( reportTable.getReportPeriods().contains( null ) );
@@ -796,8 +796,8 @@
assertNotNull( crossTabIdentifiers );
assertEquals( 2, crossTabIdentifiers.size() );
- assertTrue( crossTabIdentifiers.contains( String.valueOf( Integer.valueOf( 'A' ) ) ) );
- assertTrue( crossTabIdentifiers.contains( String.valueOf( Integer.valueOf( 'B' ) ) ) );
+ assertTrue( crossTabIdentifiers.contains( ORGANISATIONUNIT_ID + Integer.valueOf( 'A' ) ) );
+ assertTrue( crossTabIdentifiers.contains( ORGANISATIONUNIT_ID + Integer.valueOf( 'B' ) ) );
assertTrue( reportTable.getReportIndicators().size() == 2 );
assertTrue( reportTable.getReportPeriods().size() == 4 );
@@ -852,10 +852,10 @@
assertNotNull( crossTabIdentifiers );
assertEquals( 4, crossTabIdentifiers.size() );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'A' ) + SEPARATOR + Integer.valueOf( 'A' ) ) );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'A' ) + SEPARATOR + Integer.valueOf( 'B' ) ) );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'B' ) + SEPARATOR + Integer.valueOf( 'A' ) ) );
- assertTrue( crossTabIdentifiers.contains( Integer.valueOf( 'B' ) + SEPARATOR + Integer.valueOf( 'B' ) ) );
+ assertTrue( crossTabIdentifiers.contains( DATASET_ID + Integer.valueOf( 'A' ) + SEPARATOR + ORGANISATIONUNIT_ID + Integer.valueOf( 'A' ) ) );
+ assertTrue( crossTabIdentifiers.contains( DATASET_ID + Integer.valueOf( 'A' ) + SEPARATOR + ORGANISATIONUNIT_ID + Integer.valueOf( 'B' ) ) );
+ assertTrue( crossTabIdentifiers.contains( DATASET_ID + Integer.valueOf( 'B' ) + SEPARATOR + ORGANISATIONUNIT_ID + Integer.valueOf( 'A' ) ) );
+ assertTrue( crossTabIdentifiers.contains( DATASET_ID + Integer.valueOf( 'B' ) + SEPARATOR + ORGANISATIONUNIT_ID + Integer.valueOf( 'B' ) ) );
assertTrue( reportTable.getReportIndicators().contains( null ) );
assertTrue( reportTable.getReportPeriods().size() == 4 );