dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #36974
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18912: Removed obsolete test
------------------------------------------------------------
revno: 18912
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2015-04-15 20:20:17 +0200
message:
Removed obsolete test
modified:
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalServiceTest.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-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalServiceTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalServiceTest.java 2015-04-15 17:38:01 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalServiceTest.java 2015-04-15 18:20:17 +0000
@@ -1369,75 +1369,6 @@
}
// ---------------------------------------------------------------------
- // Test multi-period approval
- // ---------------------------------------------------------------------
-
- @Ignore // Multi-period approval is no longer supported.
- @Test
- public void testMultiPeriodApproval() throws Exception
- {
- dataApprovalLevelService.addDataApprovalLevel( level1 );
- dataApprovalLevelService.addDataApprovalLevel( level2 );
-
- dataSetA.setApproveData( true );
-
- organisationUnitB.addDataSet( dataSetA );
-
- Date date = new Date();
-
- Set<OrganisationUnit> units = asSet( organisationUnitA );
-
- CurrentUserService currentUserService = new MockCurrentUserService( units, null, AUTH_APPR_LEVEL, DataApproval.AUTH_APPROVE, DataApproval.AUTH_APPROVE_LOWER_LEVELS, DataApproval.AUTH_ACCEPT_LOWER_LEVELS );
- setDependency( dataApprovalService, "currentUserService", currentUserService, CurrentUserService.class );
- setDependency( dataApprovalLevelService, "currentUserService", currentUserService, CurrentUserService.class );
-
- DataApproval dataApprovalJan = new DataApproval( level2, dataSetA, periodA, organisationUnitB, defaultCombo, NOT_ACCEPTED, date, userA );
- new DataApproval( level2, dataSetA, periodB, organisationUnitB, defaultCombo, NOT_ACCEPTED, date, userA );
- new DataApproval( level2, dataSetA, periodC, organisationUnitB, defaultCombo, NOT_ACCEPTED, date, userA );
-
- dataApprovalService.approveData( asList( dataApprovalJan ) );
- dataApprovalService.acceptData( asList( dataApprovalJan ) );
-
- assertEquals( DataApprovalState.ACCEPTED_HERE, dataApprovalService.getDataApprovalStatus( dataSetA, periodA, organisationUnitB, defaultCombo ).getState() );
- assertEquals( DataApprovalState.UNAPPROVED_READY, dataApprovalService.getDataApprovalStatus( dataSetA, periodB, organisationUnitB, defaultCombo ).getState() );
- assertEquals( DataApprovalState.UNAPPROVED_READY, dataApprovalService.getDataApprovalStatus( dataSetA, periodC, organisationUnitB, defaultCombo ).getState() );
- assertEquals( DataApprovalState.UNAPPROVED_READY, dataApprovalService.getDataApprovalStatus( dataSetA, periodQ, organisationUnitB, defaultCombo ).getState() );
-
- DataApproval dataApprovalQ1 = new DataApproval( level2, dataSetA, periodQ, organisationUnitB, defaultCombo, NOT_ACCEPTED, date, userA );
-
- dataApprovalService.approveData( asList( dataApprovalQ1 ) );
-
- assertEquals( DataApprovalState.ACCEPTED_HERE, dataApprovalService.getDataApprovalStatus( dataSetA, periodA, organisationUnitB, defaultCombo ).getState() );
- assertEquals( DataApprovalState.APPROVED_HERE, dataApprovalService.getDataApprovalStatus( dataSetA, periodB, organisationUnitB, defaultCombo ).getState() );
- assertEquals( DataApprovalState.APPROVED_HERE, dataApprovalService.getDataApprovalStatus( dataSetA, periodC, organisationUnitB, defaultCombo ).getState() );
- assertEquals( DataApprovalState.APPROVED_HERE, dataApprovalService.getDataApprovalStatus( dataSetA, periodQ, organisationUnitB, defaultCombo ).getState() );
-
- // Repeat to make sure we get the same answer (this was a bug.)
- assertEquals( DataApprovalState.APPROVED_HERE, dataApprovalService.getDataApprovalStatus( dataSetA, periodQ, organisationUnitB, defaultCombo ).getState() );
-
- dataApprovalService.acceptData( asList( dataApprovalQ1 ) );
-
- assertEquals( DataApprovalState.ACCEPTED_HERE, dataApprovalService.getDataApprovalStatus( dataSetA, periodA, organisationUnitB, defaultCombo ).getState() );
- assertEquals( DataApprovalState.ACCEPTED_HERE, dataApprovalService.getDataApprovalStatus( dataSetA, periodB, organisationUnitB, defaultCombo ).getState() );
- assertEquals( DataApprovalState.ACCEPTED_HERE, dataApprovalService.getDataApprovalStatus( dataSetA, periodC, organisationUnitB, defaultCombo ).getState() );
- assertEquals( DataApprovalState.ACCEPTED_HERE, dataApprovalService.getDataApprovalStatus( dataSetA, periodQ, organisationUnitB, defaultCombo ).getState() );
-
- dataApprovalService.unacceptData( asList( dataApprovalQ1 ) );
-
- assertEquals( DataApprovalState.APPROVED_HERE, dataApprovalService.getDataApprovalStatus( dataSetA, periodA, organisationUnitB, defaultCombo ).getState() );
- assertEquals( DataApprovalState.APPROVED_HERE, dataApprovalService.getDataApprovalStatus( dataSetA, periodB, organisationUnitB, defaultCombo ).getState() );
- assertEquals( DataApprovalState.APPROVED_HERE, dataApprovalService.getDataApprovalStatus( dataSetA, periodC, organisationUnitB, defaultCombo ).getState() );
- assertEquals( DataApprovalState.APPROVED_HERE, dataApprovalService.getDataApprovalStatus( dataSetA, periodQ, organisationUnitB, defaultCombo ).getState() );
-
- dataApprovalService.unapproveData( asList( dataApprovalQ1 ) );
-
- assertEquals( DataApprovalState.UNAPPROVED_READY, dataApprovalService.getDataApprovalStatus( dataSetA, periodA, organisationUnitB, defaultCombo ).getState() );
- assertEquals( DataApprovalState.UNAPPROVED_READY, dataApprovalService.getDataApprovalStatus( dataSetA, periodB, organisationUnitB, defaultCombo ).getState() );
- assertEquals( DataApprovalState.UNAPPROVED_READY, dataApprovalService.getDataApprovalStatus( dataSetA, periodC, organisationUnitB, defaultCombo ).getState() );
- assertEquals( DataApprovalState.UNAPPROVED_READY, dataApprovalService.getDataApprovalStatus( dataSetA, periodQ, organisationUnitB, defaultCombo ).getState() );
- }
-
- // ---------------------------------------------------------------------
// Test with Categories
// ---------------------------------------------------------------------