← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18449: Test

 

------------------------------------------------------------
revno: 18449
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2015-02-27 19:45:42 +0100
message:
  Test
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/QueryItem.java
  dhis-2/dhis-services/dhis-service-analytics/src/test/java/org/hisp/dhis/analytics/event/data/EventAnalyticsServiceTest.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/common/QueryItem.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/QueryItem.java	2015-02-27 18:08:30 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/QueryItem.java	2015-02-27 18:45:42 +0000
@@ -172,7 +172,7 @@
     @Override
     public String toString()
     {
-        return "[Item: " + item + ", filters: " + filters + ", value type: " + valueType + ", optionSet: " + optionSet + "]";
+        return "[Item: " + item + ", legend set: " + legendSet + ", filters: " + filters + ", value type: " + valueType + ", optionSet: " + optionSet + "]";
     }
     
     // -------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/test/java/org/hisp/dhis/analytics/event/data/EventAnalyticsServiceTest.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/test/java/org/hisp/dhis/analytics/event/data/EventAnalyticsServiceTest.java	2015-02-27 18:08:30 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/test/java/org/hisp/dhis/analytics/event/data/EventAnalyticsServiceTest.java	2015-02-27 18:45:42 +0000
@@ -302,15 +302,19 @@
     public void testGetFromUrlLegendSet()
     {
         Set<String> dimensionParams = new HashSet<>();
-        dimensionParams.add( "dx:" + deA.getUid() + "-" + legendSetA.getUid() + ":IN:" + legendA.getUid() + ";" + legendB.getId() );
-        dimensionParams.add( atA.getUid() );
+        dimensionParams.add( deA.getUid() + "-" + legendSetA.getUid() + ":IN:" + legendA.getUid() + ";" + legendB.getUid() );
         
         Set<String> filterParams = new HashSet<>();
         filterParams.add( "pe:201401;201402" );
+        filterParams.add( atA.getUid() + ":LE:5" );
         
         EventQueryParams params = analyticsService.getFromUrl( prA.getUid(), null, 
             null, null, dimensionParams, filterParams, null, null, false, false, false, null, null, null, null, null );
         
         assertEquals( prA, params.getProgram() );
+        assertEquals( 1, params.getItems().size() );
+        assertEquals( legendSetA, params.getItems().get( 0 ).getLegendSet() );
+        assertEquals( 1, params.getItemFilters().size() );
+        assertEquals( 2, params.getFilterPeriods().size() );
     }
 }