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

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Wed Dec 16 17:35:48 EST 2009


Author: vhalbert at redhat.com
Date: 2009-12-16 17:35:48 -0500 (Wed, 16 Dec 2009)
New Revision: 1678

Modified:
   trunk/test-integration/db/src/main/java/org/teiid/test/client/TestClient.java
Log:
Teiid-909 -  changed to use the PropertiesUtils.resolveNestedProperties, removed duplicate logic

Modified: trunk/test-integration/db/src/main/java/org/teiid/test/client/TestClient.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/client/TestClient.java	2009-12-16 22:25:58 UTC (rev 1677)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/client/TestClient.java	2009-12-16 22:35:48 UTC (rev 1678)
@@ -90,8 +90,6 @@
 	
 	try {
     
-//	    testScenarios();
-	    
 	    runScenario();
 	    
 	} catch (Throwable t) {
@@ -243,44 +241,11 @@
 	Properties or = new Properties();
 	
 	Properties configprops = ConfigPropertyLoader.getInstance().getProperties();
-
 	
-	Iterator it = props.keySet().iterator();
-	while (it.hasNext()) {
-	    String key = (String) it.next();
-	    String value = props.getProperty( key );
-	    String newValue = value;
-	    int loc = value.indexOf("${");
-	    boolean sub = true;
-	    while (loc > -1) {
-
-		int endidx = newValue.indexOf("}", loc);
-		String prop_name = newValue.substring(loc + 2, endidx );
-		
-		String prop_value = or.getProperty(prop_name);
-		if (prop_value == null) {
-			prop_value = configprops.getProperty(prop_name);
-		}	
-		if (prop_value != null) {
-		
-		    newValue = StringUtil.replace(newValue, "${" + prop_name + "}", prop_value);
-		    sub = true;
-		    		    
-		}
-		if (newValue.length() > loc + 1 ) {
-		    loc = newValue.indexOf("${", loc + 1);
-		} else {
-		    loc = -1;
-		}
-		
-		
-	    }
-	    if (sub) {
-		or.setProperty(key, newValue);
-	    }
-	    		
-	}
+	configprops.putAll(props);
 	
+	or = PropertiesUtils.resolveNestedProperties(configprops);
+	
 	return or;
 
     }



More information about the teiid-commits mailing list