← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18914: Approval tests, dropping tables in HibernateDbmsManager instead of inside tests

 

------------------------------------------------------------
revno: 18914
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2015-04-15 20:39:33 +0200
message:
  Approval tests, dropping tables in HibernateDbmsManager instead of inside tests
modified:
  dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalServiceCategoryOptionGroupTest.java
  dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalServiceTest.java
  dhis-2/dhis-support/dhis-support-hibernate/src/main/java/org/hisp/dhis/dbms/HibernateDbmsManager.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/DataApprovalServiceCategoryOptionGroupTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalServiceCategoryOptionGroupTest.java	2015-04-15 18:28:28 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalServiceCategoryOptionGroupTest.java	2015-04-15 18:39:33 +0000
@@ -28,9 +28,18 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import static org.hisp.dhis.setting.SystemSettingManager.KEY_ACCEPTANCE_REQUIRED_FOR_APPROVAL;
 import static org.hisp.dhis.setting.SystemSettingManager.KEY_HIDE_UNAPPROVED_DATA_IN_ANALYTICS;
-import static org.hisp.dhis.setting.SystemSettingManager.KEY_ACCEPTANCE_REQUIRED_FOR_APPROVAL;
-import static org.junit.Assert.*;
+import static org.hisp.dhis.system.util.CollectionUtils.asSet;
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Date;
+import java.util.List;
+import java.util.Set;
 
 import org.hisp.dhis.DhisTest;
 import org.hisp.dhis.common.BaseIdentifiableObject;
@@ -69,15 +78,6 @@
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.jdbc.core.JdbcTemplate;
 
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Date;
-import java.util.List;
-import java.util.Set;
-
-import static org.hisp.dhis.system.util.CollectionUtils.asSet;
-
 /**
  * @author Jim Grace
  */
@@ -496,12 +496,6 @@
     }
 
     @Override
-    public void tearDownTest()
-    {
-        jdbcTemplate.execute( "DROP TABLE _orgunitstructure;" );
-    }
-
-    @Override
     public boolean emptyDatabaseAfterTest()
     {
         return true;

=== 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 18:20:17 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalServiceTest.java	2015-04-15 18:39:33 +0000
@@ -305,12 +305,6 @@
     }
 
     @Override
-    public void tearDownTest()
-    {
-        jdbcTemplate.execute( "DROP TABLE _orgunitstructure;" );
-    }
-
-    @Override
     public boolean emptyDatabaseAfterTest()
     {
         return true;

=== modified file 'dhis-2/dhis-support/dhis-support-hibernate/src/main/java/org/hisp/dhis/dbms/HibernateDbmsManager.java'
--- dhis-2/dhis-support/dhis-support-hibernate/src/main/java/org/hisp/dhis/dbms/HibernateDbmsManager.java	2015-04-15 11:58:48 +0000
+++ dhis-2/dhis-support/dhis-support-hibernate/src/main/java/org/hisp/dhis/dbms/HibernateDbmsManager.java	2015-04-15 18:39:33 +0000
@@ -220,6 +220,18 @@
         dropTable( "aggregatedorgunitdatavalue" );
         dropTable( "aggregatedorgunitindicatorvalue" );
         dropTable( "aggregatedorgunitdatasetcompleteness" );
+        
+        dropTable( "_categoryoptioncomboname" );
+        dropTable( "_categoryoptiongroupsetstructure" );
+        dropTable( "_categorystructure" );
+        dropTable( "_dataelementcategoryoptioncombo" );
+        dropTable( "_dataelementgroupsetstructure" );
+        dropTable( "_dataelementstructure" );
+        dropTable( "_dateperiodstructure" );
+        dropTable( "_indicatorgroupsetstructure" );
+        dropTable( "_organisationunitgroupsetstructure" );
+        dropTable( "_orgunitstructure" );
+        dropTable( "_periodstructure" );
 
         log.debug( "Cleared database contents" );