← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5562: Minor fix

 

------------------------------------------------------------
revno: 5562
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2011-12-22 22:05:20 +0100
message:
  Minor fix
modified:
  dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/reporttable/ReportTableGridTest.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-reporting/src/test/java/org/hisp/dhis/reporttable/ReportTableGridTest.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/reporttable/ReportTableGridTest.java	2011-12-22 19:59:19 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/reporttable/ReportTableGridTest.java	2011-12-22 21:05:20 +0000
@@ -63,6 +63,7 @@
 import org.hisp.dhis.mock.MockI18nFormat;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
+import org.hisp.dhis.organisationunit.OrganisationUnitGroupService;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
 import org.hisp.dhis.period.MonthlyPeriodType;
 import org.hisp.dhis.period.Period;
@@ -88,6 +89,7 @@
     private List<Period> periods;
     private List<Period> relativePeriods;
     private List<OrganisationUnit> units;
+    private List<OrganisationUnitGroup> groups;
 
     private PeriodType montlyPeriodType;
 
@@ -118,6 +120,9 @@
     private OrganisationUnit unitA;
     private OrganisationUnit unitB;
     
+    private OrganisationUnitGroup groupA;
+    private OrganisationUnitGroup groupB;
+        
     private int dataElementIdA;
     private int dataElementIdB;
     
@@ -135,6 +140,9 @@
     
     private int unitIdA;
     private int unitIdB;
+    
+    private int groupIdA;
+    private int groupIdB;
         
     private I18nFormat i18nFormat;
     
@@ -158,6 +166,7 @@
         dataSetService = (DataSetService) getBean( DataSetService.ID );
         periodService = (PeriodService) getBean( PeriodService.ID );
         organisationUnitService = (OrganisationUnitService) getBean( OrganisationUnitService.ID );
+        organisationUnitGroupService = (OrganisationUnitGroupService) getBean( OrganisationUnitGroupService.ID );
         
         batchHandlerFactory = (BatchHandlerFactory) getBean( "batchHandlerFactory" );
         
@@ -168,6 +177,7 @@
         periods = new ArrayList<Period>();
         relativePeriods = new ArrayList<Period>();
         units = new ArrayList<OrganisationUnit>();
+        groups = new ArrayList<OrganisationUnitGroup>();
         
         montlyPeriodType = PeriodType.getPeriodTypeByName( MonthlyPeriodType.NAME );       
         
@@ -275,6 +285,19 @@
         
         units.add( unitA );
         units.add( unitB );
+
+        // ---------------------------------------------------------------------
+        // Setup OrganisationUnitGroups
+        // ---------------------------------------------------------------------
+
+        groupA = createOrganisationUnitGroup( 'A' );
+        groupB = createOrganisationUnitGroup( 'B' );
+        
+        groupIdA = organisationUnitGroupService.addOrganisationUnitGroup( groupA );
+        groupIdB = organisationUnitGroupService.addOrganisationUnitGroup( groupB );
+        
+        groups.add( groupA );
+        groups.add( groupB );
         
         i18nFormat = new MockI18nFormat();