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

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Wed Nov 25 09:18:01 EST 2009


Author: vhalbert at redhat.com
Date: 2009-11-25 09:18:01 -0500 (Wed, 25 Nov 2009)
New Revision: 1590

Modified:
   trunk/test-integration/db/src/main/java/org/teiid/test/util/PropUtils.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/util/PropUtils.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/util/PropUtils.java	2009-11-25 14:17:42 UTC (rev 1589)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/util/PropUtils.java	2009-11-25 14:18:01 UTC (rev 1590)
@@ -11,14 +11,13 @@
 
 
 	public static Properties loadProperties(String filename, Properties defaults) {
-		Properties props = null;
+	    InputStream in = null;
+		Properties props = new Properties();
 		if (defaults != null) {
-			props = new Properties(defaults);
-		} else {
-			props = new Properties();
-		}
+			props.putAll(defaults);
+		} 
 	    try {
-	        InputStream in = ConfigPropertyLoader.class.getResourceAsStream(filename);
+	        in = ConfigPropertyLoader.class.getResourceAsStream(filename);
 	        if (in != null) {
 	        	Properties lprops = new Properties();
 	        	lprops.load(in);
@@ -30,6 +29,12 @@
 	        }
 	    } catch (IOException e) {
 	        throw new RuntimeException("Error loading properties from file '"+filename+ "'" + e.getMessage());
+	    } finally {
+		try {
+		    in.close();
+		} catch(Exception e){
+		    
+		}
 	    }
 	    
 	    return props;



More information about the teiid-commits mailing list