← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 22003: minor test fix

 

------------------------------------------------------------
revno: 22003
committer: Morten Olav Hansen <morten@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2016-02-19 10:45:37 +0700
message:
  minor test fix
modified:
  dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/metadata2/objectbundle/ObjectBundleServiceTest.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-dxf2/src/test/java/org/hisp/dhis/dxf2/metadata2/objectbundle/ObjectBundleServiceTest.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/metadata2/objectbundle/ObjectBundleServiceTest.java	2016-02-18 11:15:51 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/metadata2/objectbundle/ObjectBundleServiceTest.java	2016-02-19 03:45:37 +0000
@@ -39,6 +39,7 @@
 import org.hisp.dhis.importexport.ImportStrategy;
 import org.hisp.dhis.option.OptionSet;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.period.PeriodType;
 import org.hisp.dhis.preheat.InvalidReference;
 import org.hisp.dhis.preheat.PreheatIdentifier;
 import org.hisp.dhis.preheat.PreheatMode;
@@ -441,6 +442,8 @@
         List<OrganisationUnit> organisationUnits = manager.getAll( OrganisationUnit.class );
         List<DataElement> dataElements = manager.getAll( DataElement.class );
         List<DataSet> dataSets = manager.getAll( DataSet.class );
+        DataSet dataSet = dataSets.get( 0 );
+
         Map<Class<? extends IdentifiableObject>, IdentifiableObject> defaults = manager.getDefaults();
 
         assertFalse( organisationUnits.isEmpty() );
@@ -453,10 +456,11 @@
             assertEquals( defaults.get( DataElementCategoryCombo.class ), dataElement.getCategoryCombo() );
         }
 
-        assertFalse( dataSets.get( 0 ).getSources().isEmpty() );
-        assertFalse( dataSets.get( 0 ).getDataElements().isEmpty() );
-        assertEquals( 1, dataSets.get( 0 ).getSources().size() );
-        assertEquals( 2, dataSets.get( 0 ).getDataElements().size() );
+        assertFalse( dataSet.getSources().isEmpty() );
+        assertFalse( dataSet.getDataElements().isEmpty() );
+        assertEquals( 1, dataSet.getSources().size() );
+        assertEquals( 2, dataSet.getDataElements().size() );
+        assertEquals( PeriodType.getPeriodTypeByName( "Monthly" ), dataSet.getPeriodType() );
     }
 
     private void defaultSetup()