← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15819: Removed deprecated methods

 

------------------------------------------------------------
revno: 15819
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2014-06-23 21:53:16 +0200
message:
  Removed deprecated methods
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/CompleteDataSetRegistrationService.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/DefaultCompleteDataSetRegistrationService.java
  dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataset/CompleteDataSetRegistrationServiceTest.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-api/src/main/java/org/hisp/dhis/dataset/CompleteDataSetRegistrationService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/CompleteDataSetRegistrationService.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/CompleteDataSetRegistrationService.java	2014-06-23 19:53:16 +0000
@@ -29,7 +29,6 @@
  */
 
 import java.util.Collection;
-import java.util.Date;
 
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.period.Period;
@@ -102,31 +101,6 @@
         Collection<DataSet> dataSets, Collection<OrganisationUnit> sources, Collection<Period> periods );
     
     /**
-     * Retrieves the number of existing CompleteDataSetRegistration for the given 
-     * DataSet, Collection of Sources and Period.
-     * 
-     * @param dataSet the DataSet.
-     * @param sources the Collection of Sources.
-     * @param period the Period.
-     * @return the number of existing CompleteDataSetRegistrations.
-     */
-    int getCompleteDataSetRegistrationsForDataSet( DataSet dataSet, Collection<OrganisationUnit> sources, Period period );
-
-    /**
-     * Retrieves the number of existing CompleteDataSetRegistration for the given 
-     * DataSet, Collection of Sources, Period and Date. The Date deadline is the
-     * date that the registration must be made before in order to be defined as
-     * "on time".
-     * 
-     * @param dataSet the DataSet.
-     * @param sources the Collection of Sources.
-     * @param period the Period.
-     * @param deadline the dead line.
-     * @return the number of existing CompleteDataSetRegistrations.
-     */
-    int getCompleteDataSetRegistrationsForDataSet( DataSet dataSet, Collection<OrganisationUnit> sources, Period period, Date deadline );
-    
-    /**
      * Deletes the CompleteDataSetRegistrations associated with the given DataSet.
      * 
      * @param dataSet the DataSet.

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/DefaultCompleteDataSetRegistrationService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/DefaultCompleteDataSetRegistrationService.java	2014-06-23 19:13:26 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/DefaultCompleteDataSetRegistrationService.java	2014-06-23 19:53:16 +0000
@@ -29,9 +29,7 @@
  */
 
 import java.util.Collection;
-import java.util.Date;
 
-import org.apache.commons.collections.CollectionUtils;
 import org.hisp.dhis.dataelement.DataElementCategoryService;
 import org.hisp.dhis.message.MessageService;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
@@ -120,34 +118,6 @@
     {
         return completeDataSetRegistrationStore.getCompleteDataSetRegistrations( dataSets, sources, periods );
     }    
-
-    @SuppressWarnings( "unchecked" )
-    @Deprecated
-    public int getCompleteDataSetRegistrationsForDataSet( DataSet dataSet, Collection<OrganisationUnit> sources, Period period )
-    {
-        final Collection<OrganisationUnit> intersectingSources = CollectionUtils.intersection( sources, dataSet.getSources() );
-        
-        if ( intersectingSources == null || intersectingSources.size() == 0 )
-        {
-            return 0;
-        }        
-        
-        return completeDataSetRegistrationStore.getCompleteDataSetRegistrations( dataSet, intersectingSources, period ).size();
-    }
-    
-    @SuppressWarnings( "unchecked" )
-    @Deprecated
-    public int getCompleteDataSetRegistrationsForDataSet( DataSet dataSet, Collection<OrganisationUnit> sources, Period period, Date deadline )
-    {
-        final Collection<OrganisationUnit> intersectingSources = CollectionUtils.intersection( sources, dataSet.getSources() );
-        
-        if ( intersectingSources == null || intersectingSources.size() == 0 )
-        {
-            return 0;
-        }
-        
-        return completeDataSetRegistrationStore.getCompleteDataSetRegistrations( dataSet, intersectingSources, period, deadline ).size();
-    }
     
     public void deleteCompleteDataSetRegistrations( DataSet dataSet )
     {

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataset/CompleteDataSetRegistrationServiceTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataset/CompleteDataSetRegistrationServiceTest.java	2014-06-23 19:13:26 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataset/CompleteDataSetRegistrationServiceTest.java	2014-06-23 19:53:16 +0000
@@ -62,10 +62,6 @@
     private CompleteDataSetRegistration registrationF;
     private CompleteDataSetRegistration registrationG;
     private CompleteDataSetRegistration registrationH;
-    private CompleteDataSetRegistration registrationI;
-    private CompleteDataSetRegistration registrationJ;
-    private CompleteDataSetRegistration registrationK;
-    private CompleteDataSetRegistration registrationL;
     
     private DataSet dataSetA;
     private DataSet dataSetB;
@@ -79,11 +75,6 @@
     private OrganisationUnit sourceC;
 
     private Date onTimeA;
-    private Date onTimeB;
-    private Date deadlineA;
-    private Date deadlineB;
-    private Date tooLateA;
-    private Date tooLateB;
     
     private DataElementCategoryOptionCombo optionCombo;
 
@@ -136,11 +127,6 @@
         optionCombo = categoryService.getDefaultDataElementCategoryOptionCombo();
 
         onTimeA = getDate( 2000, 1, 10 );
-        onTimeB = getDate( 2000, 2, 10 );
-        deadlineA = getDate( 2000, 1, 15 );
-        deadlineB = getDate( 2000, 2, 15 );
-        tooLateA = getDate( 2000, 1, 25 );
-        tooLateB = getDate( 2000, 2, 25 );
     }
 
     // -------------------------------------------------------------------------
@@ -243,94 +229,6 @@
     }
 
     @Test
-    public void testGetDataSetSourcesPeriod()
-    {
-        registrationA = new CompleteDataSetRegistration( dataSetA, periodA, sourceA, optionCombo, new Date(), "" );
-        registrationB = new CompleteDataSetRegistration( dataSetB, periodA, sourceA, optionCombo, new Date(), "" );
-        registrationC = new CompleteDataSetRegistration( dataSetA, periodB, sourceA, optionCombo, new Date(), "" );
-        registrationD = new CompleteDataSetRegistration( dataSetB, periodB, sourceA, optionCombo, new Date(), "" );        
-        registrationE = new CompleteDataSetRegistration( dataSetA, periodA, sourceB, optionCombo, new Date(), "" );
-        registrationF = new CompleteDataSetRegistration( dataSetB, periodA, sourceB, optionCombo, new Date(), "" );
-        registrationG = new CompleteDataSetRegistration( dataSetA, periodB, sourceB, optionCombo, new Date(), "" );
-        registrationH = new CompleteDataSetRegistration( dataSetB, periodB, sourceB, optionCombo, new Date(), "" );
-        
-        registrationI = new CompleteDataSetRegistration( dataSetA, periodA, sourceC, optionCombo, new Date(), "" );
-        registrationJ = new CompleteDataSetRegistration( dataSetB, periodA, sourceC, optionCombo, new Date(), "" );
-        registrationK = new CompleteDataSetRegistration( dataSetA, periodB, sourceC, optionCombo, new Date(), "" );
-        registrationL = new CompleteDataSetRegistration( dataSetB, periodB, sourceC, optionCombo, new Date(), "" );
-        
-        completeDataSetRegistrationService.saveCompleteDataSetRegistration( registrationA );
-        completeDataSetRegistrationService.saveCompleteDataSetRegistration( registrationB );
-        completeDataSetRegistrationService.saveCompleteDataSetRegistration( registrationC );
-        completeDataSetRegistrationService.saveCompleteDataSetRegistration( registrationD );
-        completeDataSetRegistrationService.saveCompleteDataSetRegistration( registrationE );
-        completeDataSetRegistrationService.saveCompleteDataSetRegistration( registrationF );
-        completeDataSetRegistrationService.saveCompleteDataSetRegistration( registrationG );
-        completeDataSetRegistrationService.saveCompleteDataSetRegistration( registrationH );        
-        completeDataSetRegistrationService.saveCompleteDataSetRegistration( registrationI );
-        completeDataSetRegistrationService.saveCompleteDataSetRegistration( registrationJ );
-        completeDataSetRegistrationService.saveCompleteDataSetRegistration( registrationK );
-        completeDataSetRegistrationService.saveCompleteDataSetRegistration( registrationL );
-        
-        Collection<OrganisationUnit> sources = new ArrayList<OrganisationUnit>();
-        
-        sources.add( sourceA );
-        sources.add( sourceB );
-        sources.add( sourceC );
-                
-        assertEquals( 2, completeDataSetRegistrationService.getCompleteDataSetRegistrationsForDataSet( dataSetA, sources, periodA ) );
-        assertEquals( 2, completeDataSetRegistrationService.getCompleteDataSetRegistrationsForDataSet( dataSetB, sources, periodA ) );
-        assertEquals( 2, completeDataSetRegistrationService.getCompleteDataSetRegistrationsForDataSet( dataSetA, sources, periodB ) );
-        assertEquals( 2, completeDataSetRegistrationService.getCompleteDataSetRegistrationsForDataSet( dataSetB, sources, periodB ) );
-        assertEquals( 0, completeDataSetRegistrationService.getCompleteDataSetRegistrationsForDataSet( dataSetC, sources, periodA ) );
-        assertEquals( 0, completeDataSetRegistrationService.getCompleteDataSetRegistrationsForDataSet( dataSetC, sources, periodB ) );        
-    }
-
-    @Test
-    public void testGetDataSetSourcesPeriodDate()
-    {
-        registrationA = new CompleteDataSetRegistration( dataSetA, periodA, sourceA, optionCombo, onTimeA, "" );
-        registrationB = new CompleteDataSetRegistration( dataSetB, periodA, sourceA, optionCombo, onTimeA, "" );
-        registrationC = new CompleteDataSetRegistration( dataSetA, periodB, sourceA, optionCombo, onTimeB, "" );
-        registrationD = new CompleteDataSetRegistration( dataSetB, periodB, sourceA, optionCombo, onTimeB, "" );        
-        registrationE = new CompleteDataSetRegistration( dataSetA, periodA, sourceB, optionCombo, tooLateA, "" );
-        registrationF = new CompleteDataSetRegistration( dataSetB, periodA, sourceB, optionCombo, tooLateA, "" );
-        registrationG = new CompleteDataSetRegistration( dataSetA, periodB, sourceB, optionCombo, tooLateB, "" );
-        registrationH = new CompleteDataSetRegistration( dataSetB, periodB, sourceB, optionCombo, tooLateB, "" );
-        
-        registrationI = new CompleteDataSetRegistration( dataSetA, periodA, sourceC, optionCombo, onTimeA, "" );
-        registrationJ = new CompleteDataSetRegistration( dataSetB, periodA, sourceC, optionCombo, onTimeA, "" );
-        registrationK = new CompleteDataSetRegistration( dataSetA, periodB, sourceC, optionCombo, onTimeB, "" );
-        registrationL = new CompleteDataSetRegistration( dataSetB, periodB, sourceC, optionCombo, onTimeB, "" );
-        
-        completeDataSetRegistrationService.saveCompleteDataSetRegistration( registrationA );
-        completeDataSetRegistrationService.saveCompleteDataSetRegistration( registrationB );
-        completeDataSetRegistrationService.saveCompleteDataSetRegistration( registrationC );
-        completeDataSetRegistrationService.saveCompleteDataSetRegistration( registrationD );
-        completeDataSetRegistrationService.saveCompleteDataSetRegistration( registrationE );
-        completeDataSetRegistrationService.saveCompleteDataSetRegistration( registrationF );
-        completeDataSetRegistrationService.saveCompleteDataSetRegistration( registrationG );
-        completeDataSetRegistrationService.saveCompleteDataSetRegistration( registrationH );        
-        completeDataSetRegistrationService.saveCompleteDataSetRegistration( registrationI );
-        completeDataSetRegistrationService.saveCompleteDataSetRegistration( registrationJ );
-        completeDataSetRegistrationService.saveCompleteDataSetRegistration( registrationK );
-        completeDataSetRegistrationService.saveCompleteDataSetRegistration( registrationL );
-        
-        Collection<OrganisationUnit> sources = new ArrayList<OrganisationUnit>();
-        
-        sources.add( sourceA );
-        sources.add( sourceB );
-        sources.add( sourceC );
-                
-        assertEquals( 1, completeDataSetRegistrationService.getCompleteDataSetRegistrationsForDataSet( dataSetA, sources, periodA, deadlineA ) );
-        assertEquals( 1, completeDataSetRegistrationService.getCompleteDataSetRegistrationsForDataSet( dataSetB, sources, periodA, deadlineA ) );
-        assertEquals( 1, completeDataSetRegistrationService.getCompleteDataSetRegistrationsForDataSet( dataSetA, sources, periodB, deadlineB ) );
-        assertEquals( 1, completeDataSetRegistrationService.getCompleteDataSetRegistrationsForDataSet( dataSetB, sources, periodB, deadlineB ) );
-        assertEquals( 0, completeDataSetRegistrationService.getCompleteDataSetRegistrationsForDataSet( dataSetC, sources, periodA, deadlineA ) );
-        assertEquals( 0, completeDataSetRegistrationService.getCompleteDataSetRegistrationsForDataSet( dataSetC, sources, periodB, deadlineB ) );        
-    }
-
-    @Test
     public void testDeleteByDataSet()
     {
         registrationA = new CompleteDataSetRegistration( dataSetA, periodA, sourceA, optionCombo, onTimeA, "" );