=== modified file 'dhis-2/dhis-dxf2/src/test/java/org/hisp/dhis/dxf2/datavalueset/DataValueSetServiceTest.java' --- dhis-2/dhis-dxf2/src/test/java/org/hisp/dhis/dxf2/datavalueset/DataValueSetServiceTest.java 2012-05-31 13:16:24 +0000 +++ dhis-2/dhis-dxf2/src/test/java/org/hisp/dhis/dxf2/datavalueset/DataValueSetServiceTest.java 2012-06-01 12:21:51 +0000 @@ -54,6 +54,7 @@ import org.hisp.dhis.period.MonthlyPeriodType; import org.hisp.dhis.period.Period; import org.hisp.dhis.period.PeriodService; +import org.junit.Ignore; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.io.ClassPathResource; @@ -243,4 +244,19 @@ assertNotNull( dataValues ); assertEquals( 0, dataValues.size() ); } + + // Testing importing datavalues where period is not pre-existing fails + @Ignore + @Test + public void testImportDataValuesWithNewPeriod() + throws Exception + { + ImportSummary summary = dataValueSetService.saveDataValueSet( new ClassPathResource( "datavalueset/dataValueSetC.xml" ).getInputStream() ); + + Collection dataValues = dataValueService.getAllDataValues(); + + assertNotNull( dataValues ); + assertEquals( 3, dataValues.size() ); + } + } === added file 'dhis-2/dhis-dxf2/src/test/resources/datavalueset/dataValueSetC.xml' --- dhis-2/dhis-dxf2/src/test/resources/datavalueset/dataValueSetC.xml 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-dxf2/src/test/resources/datavalueset/dataValueSetC.xml 2012-06-01 12:21:51 +0000 @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file