dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #18325
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7682: Fix bug Test fail for last 3 months relative periods and remove dataMartLast3MonthsTask in beans.xml
------------------------------------------------------------
revno: 7682
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2012-07-24 14:11:35 +0700
message:
Fix bug Test fail for last 3 months relative periods and remove dataMartLast3MonthsTask in beans.xml
modified:
dhis-2/dhis-api/src/test/java/org/hisp/dhis/period/RelativePeriodTest.java
dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/scheduling/SchedulingManager.java
dhis-2/dhis-services/dhis-service-reporting/src/main/resources/META-INF/dhis/beans.xml
--
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/test/java/org/hisp/dhis/period/RelativePeriodTest.java'
--- dhis-2/dhis-api/src/test/java/org/hisp/dhis/period/RelativePeriodTest.java 2012-05-08 18:53:35 +0000
+++ dhis-2/dhis-api/src/test/java/org/hisp/dhis/period/RelativePeriodTest.java 2012-07-24 07:11:35 +0000
@@ -60,7 +60,7 @@
@Test
public void getRelativePeriods()
{
- RelativePeriods periods = new RelativePeriods( true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true );
+ RelativePeriods periods = new RelativePeriods( true, true, true, true, true, true, true, true, true, true, true, true, false, true, true, true, true, true, true, true );
List<Period> relatives = periods.getRelativePeriods( getDate( 2001, 1, 1 ), i18nFormat, false );
@@ -155,6 +155,19 @@
}
@Test
+ public void testGetLast3Months()
+ {
+ RelativePeriods relativePeriods = new RelativePeriods();
+ relativePeriods.setLast3Months( true );
+ List<Period> relatives = relativePeriods.getRelativePeriods( getDate( 2012, 3, 1 ), null, false );
+
+ assertEquals( 3, relatives.size() );
+ assertTrue( relatives.contains( new Period( new MonthlyPeriodType(), getDate( 2012, 1, 1 ), getDate( 2012, 1, 31 ) ) ) );
+ assertTrue( relatives.contains( new Period( new MonthlyPeriodType(), getDate( 2012, 2, 1 ), getDate( 2012, 2, 29 ) ) ) );
+ assertTrue( relatives.contains( new Period( new MonthlyPeriodType(), getDate( 2012, 3, 1 ), getDate( 2012, 3, 31 ) ) ) );
+ }
+
+ @Test
public void testGetLast4Quarters()
{
List<Period> relatives = new RelativePeriods().setLast4Quarters( true ).getRelativePeriods( getDate( 2001, 1, 1 ), null, false );
=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/scheduling/SchedulingManager.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/scheduling/SchedulingManager.java 2012-07-24 04:04:14 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/scheduling/SchedulingManager.java 2012-07-24 07:11:35 +0000
@@ -35,7 +35,6 @@
public interface SchedulingManager
{
final String TASK_DATAMART_LAST_12_MONTHS = "dataMartLast12MonthsTask";
- final String TASK_DATAMART_LAST_3_MONTHS = "dataMartLast3MonthsTask";
final String TASK_DATAMART_LAST_6_MONTS = "dataMartLast6MonthsTask";
final String TASK_DATAMART_FROM_6_TO_12_MONTS = "dataMartFrom6To12MonthsTask";
=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/resources/META-INF/dhis/beans.xml 2012-07-24 04:04:14 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/resources/META-INF/dhis/beans.xml 2012-07-24 07:11:35 +0000
@@ -267,7 +267,6 @@
<property name="tasks">
<map>
<entry key="dataMartLast12MonthsTask" value-ref="dataMartLast12MonthsTask" />
- <entry key="dataMartLast3MonthsTask" value-ref="dataMartLast3MonthsTask" />
<entry key="dataMartLast6MonthsTask" value-ref="dataMartLast6MonthsTask" />
<entry key="dataMartFrom6To12MonthsTask" value-ref="dataMartFrom6To12MonthsTask" />
</map>
@@ -290,10 +289,6 @@
<property name="last6Months" value="true"/>
<property name="last6To12Months" value="true"/>
</bean>
-
- <bean id="dataMartLast3MonthsTask" class="org.hisp.dhis.system.scheduling.DataMartTask" parent="abstractDataMartTask">
- <property name="last6Months" value="true"/>
- </bean>
<bean id="dataMartLast6MonthsTask" class="org.hisp.dhis.system.scheduling.DataMartTask" parent="abstractDataMartTask">
<property name="last6Months" value="true"/>