[teiid-commits] teiid SVN: r1591 - trunk/test-integration/db/src/main/java/org/teiid/test/framework.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Wed Nov 25 10:26:11 EST 2009


Author: vhalbert at redhat.com
Date: 2009-11-25 10:26:10 -0500 (Wed, 25 Nov 2009)
New Revision: 1591

Modified:
   trunk/test-integration/db/src/main/java/org/teiid/test/framework/ConfigPropertyLoader.java
   trunk/test-integration/db/src/main/java/org/teiid/test/framework/TransactionContainer.java
Log:
Teiid 773 -  refactored back in the way jbedsp transaction classes where defined and added the other integration test

Modified: trunk/test-integration/db/src/main/java/org/teiid/test/framework/ConfigPropertyLoader.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/framework/ConfigPropertyLoader.java	2009-11-25 14:18:01 UTC (rev 1590)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/ConfigPropertyLoader.java	2009-11-25 15:26:10 UTC (rev 1591)
@@ -32,7 +32,15 @@
 	
 	private static ConfigPropertyLoader _instance = null;
 	private static String LAST_CONFIG_FILE = null;
+	
+	/**
+	 * Contains any overrides specified for the test
+	 */
+	private Properties overrides = new Properties();
 
+	/**
+	 * Contains the properties loaded from the config file
+	 */
 	private Properties props = null;
 	
 	private Map<String, String>modelAssignedDatabaseType = new HashMap<String, String>(5);
@@ -84,6 +92,7 @@
 	}
 	
 	public static synchronized void cleanup() {
+	    _instance.overrides.clear();
 	    _instance.modelAssignedDatabaseType.clear();
 	    _instance.props.clear();
 	    if (_instance.dsfactory != null) {
@@ -93,15 +102,6 @@
 	    LAST_CONFIG_FILE=null;
 	}
 
-//	private void loadConfigurationProperties() {
-//		String filename = System.getProperty(ConfigPropertyNames.CONFIG_FILE);
-//		if (filename == null) {
-//			filename = DEFAULT_CONFIG_FILE_NAME;
-//		}
-//
-//		loadProperties(LAST_CONFIG_FILE);
-//		
-//	}
 	
 	private void initialize() {
 	    loadProperties(LAST_CONFIG_FILE);
@@ -114,15 +114,30 @@
 
 
 	public String getProperty(String key) {
-		return props.getProperty(key);
+	    String rtn = null;
+	    rtn = overrides.getProperty(key);
+	    if (rtn == null) {
+		rtn = props.getProperty(key);
+		
+		if (rtn == null) {
+		    rtn = System.getProperty(key);
+		}
+	    }
+	    return rtn;
 	}
 	
 	public void setProperty(String key, String value) {
-		props.setProperty(key, value);
+	    	overrides.setProperty(key, value);
 	}
 
 	public Properties getProperties() {
-		return props;
+	    
+	    Properties p = new Properties();
+	    p.putAll(System.getProperties());
+	    p.putAll(props);
+	    p.putAll(overrides);
+	    
+		return p;
 	}
 	
 	public Map<String, String> getModelAssignedDatabaseTypes() {
@@ -135,9 +150,7 @@
 
 	private void loadProperties(String filename) {
 		
-		Properties sysprops = PropertiesUtils.clone(System.getProperties());
-		
-		props = PropUtils.loadProperties("/" + filename, sysprops);
+		props = PropUtils.loadProperties("/" + filename, null);
 
 	}
 

Modified: trunk/test-integration/db/src/main/java/org/teiid/test/framework/TransactionContainer.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/framework/TransactionContainer.java	2009-11-25 14:18:01 UTC (rev 1590)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/TransactionContainer.java	2009-11-25 15:26:10 UTC (rev 1591)
@@ -88,7 +88,8 @@
 		// cleanup all connections created for this test.
 		if (connStrategy != null) {
 		    connStrategy.shutdown();
-		}	    
+		}
+	    }
 	}
 
     }



More information about the teiid-commits mailing list