← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21014: Hibernate configuration. Removed the ability to specify test hibernate properties file, not in us...

 

------------------------------------------------------------
revno: 21014
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2015-11-10 17:37:04 +0100
message:
  Hibernate configuration. Removed the ability to specify test hibernate properties file, not in use. Removed the ability to specify additional hibernate property files on classpath, confusing.
modified:
  dhis-2/dhis-support/dhis-support-external/src/main/java/org/hisp/dhis/external/conf/DefaultDhisConfigurationProvider.java
  dhis-2/dhis-support/dhis-support-hibernate/src/main/java/org/hisp/dhis/hibernate/DefaultHibernateConfigurationProvider.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-support/dhis-support-external/src/main/java/org/hisp/dhis/external/conf/DefaultDhisConfigurationProvider.java'
--- dhis-2/dhis-support/dhis-support-external/src/main/java/org/hisp/dhis/external/conf/DefaultDhisConfigurationProvider.java	2015-11-03 03:22:58 +0000
+++ dhis-2/dhis-support/dhis-support-external/src/main/java/org/hisp/dhis/external/conf/DefaultDhisConfigurationProvider.java	2015-11-10 16:37:04 +0000
@@ -111,7 +111,7 @@
     {
         return properties;
     }
-
+    
     @Override
     public String getProperty( ConfigurationKey key  )
     {

=== modified file 'dhis-2/dhis-support/dhis-support-hibernate/src/main/java/org/hisp/dhis/hibernate/DefaultHibernateConfigurationProvider.java'
--- dhis-2/dhis-support/dhis-support-hibernate/src/main/java/org/hisp/dhis/hibernate/DefaultHibernateConfigurationProvider.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-support/dhis-support-hibernate/src/main/java/org/hisp/dhis/hibernate/DefaultHibernateConfigurationProvider.java	2015-11-10 16:37:04 +0000
@@ -67,8 +67,7 @@
     // -------------------------------------------------------------------------
 
     private String defaultPropertiesFile = "hibernate-default.properties";
-    private String regularPropertiesFile = "hibernate.properties";
-    private String testPropertiesFile = "hibernate-test.properties";
+    private String propertiesFile = "hibernate.properties";
     
     private List<Resource> jarResources = new ArrayList<>();
     private List<Resource> dirResources = new ArrayList<>();
@@ -85,7 +84,7 @@
     }
 
     // -------------------------------------------------------------------------
-    // Initialise
+    // Initialize
     // -------------------------------------------------------------------------
 
     @PostConstruct
@@ -131,7 +130,7 @@
         }
 
         // ---------------------------------------------------------------------
-        // Add default properties
+        // Add default properties from class path
         // ---------------------------------------------------------------------
 
         Properties defaultProperties = getProperties( defaultPropertiesFile );
@@ -139,25 +138,6 @@
         configuration.addProperties( defaultProperties );
 
         // ---------------------------------------------------------------------
-        // Choose which properties file to look for
-        // ---------------------------------------------------------------------
-
-        boolean testing = "true".equals( System.getProperty( "org.hisp.dhis.test", "false" ) );
-
-        String propertiesFile = testing ? testPropertiesFile : regularPropertiesFile;
-
-        // ---------------------------------------------------------------------
-        // Add custom properties from classpath
-        // ---------------------------------------------------------------------
-
-        Properties customProperties = getProperties( propertiesFile );
-
-        if ( customProperties != null )
-        {
-            configuration.addProperties( customProperties );
-        }
-
-        // ---------------------------------------------------------------------
         // Add custom properties from file system
         // ---------------------------------------------------------------------
         
@@ -173,7 +153,9 @@
         // ---------------------------------------------------------------------
         // Disable second-level cache during testing
         // ---------------------------------------------------------------------
-        
+
+        boolean testing = "true".equals( System.getProperty( "org.hisp.dhis.test", "false" ) );
+
         if ( testing )
         {
             configuration.setProperty( "hibernate.cache.use_second_level_cache", "false" );