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

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Thu Oct 1 09:55:33 EDT 2009


Author: vhalbert at redhat.com
Date: 2009-10-01 09:55:33 -0400 (Thu, 01 Oct 2009)
New Revision: 1509

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 -  since the ConfigPropertyLoader is now only valid per test, need to remove the logic that removes the system properties.   Any system properties that are set at the VM level, need to be maintained for the duration of the process and are considered valid for all those tests at that time.

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-09-30 18:47:20 UTC (rev 1508)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/ConfigPropertyLoader.java	2009-10-01 13:55:33 UTC (rev 1509)
@@ -10,7 +10,12 @@
 
 /**
  * The ConfigProperteryLoader will load the configuration properties to be used by a test.
+ * These properties only live for the duration of one test.
  * 
+ * NOTE: System properties set by the VM will be considered long living.   This is so the 
+ * 		-Dusedatasources option can be maintained for the duration of a set of tests. 
+ * 
+ * 
  * @author vanhalbert
  *
  */
@@ -20,7 +25,7 @@
 	 * The default config file to use when #CONFIG_FILE system property isn't
 	 * set
 	 */
-	protected static final String DEFAULT_CONFIG_FILE_NAME = "default-config.properties";
+	public static final String DEFAULT_CONFIG_FILE_NAME = "default-config.properties";
 
 	private Properties props = null;
 
@@ -47,15 +52,6 @@
 
 		loadProperties(filename);
 		
-		
-		Properties p = System.getProperties();
-		p.remove(ConfigPropertyNames.CONFIG_FILE);
-		p.remove(ConfigPropertyNames.EXCLUDE_DATASBASE_TYPES_PROP);
-		p.remove(ConfigPropertyNames.USE_DATASOURCES_PROP);
-		p.remove(ConfigPropertyNames.CONNECTION_TYPE);
-		p.remove(ConfigPropertyNames.TRANSACTION_TYPE);
-		
-		
 	}
 
 

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-09-30 18:47:20 UTC (rev 1508)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/TransactionContainer.java	2009-10-01 13:55:33 UTC (rev 1509)
@@ -6,13 +6,17 @@
 
 import java.util.Properties;
 
+import net.sf.saxon.functions.Substring;
+
 import org.teiid.test.framework.connection.ConnectionStrategy;
 import org.teiid.test.framework.connection.ConnectionStrategyFactory;
 import org.teiid.test.framework.datasource.DataSourceFactory;
 import org.teiid.test.framework.exception.QueryTestFailedException;
 import org.teiid.test.framework.exception.TransactionRuntimeException;
 
+import com.metamatrix.core.util.StringUtil;
 
+
 public abstract class TransactionContainer {
 	
 		private boolean debug = false;
@@ -21,6 +25,8 @@
 		protected Properties props;
 		protected ConnectionStrategy connStrategy;
 		protected DataSourceFactory dsfactory;
+		
+		protected String testClassName = null;
 	    
 	    protected TransactionContainer(ConfigPropertyLoader propertyconfig){        
 	    	this.config = propertyconfig;
@@ -46,7 +52,8 @@
 	        
 	    public void runTransaction(TransactionQueryTest test) {
 	    	
-	    			    		
+	    	this.testClassName =StringUtil.getLastToken(test.getClass().getName(), ".");
+ 		
 	        try {		 
 	        	
 	        	runIt(test);
@@ -72,6 +79,7 @@
 	    }
 	    
 	    private void runIt(TransactionQueryTest test)  {
+	    	
 	    	detail("Start transaction test: " + test.getTestName());
  
 	        try {  
@@ -136,13 +144,13 @@
 	    
 	    protected void debug(String message) {
 	    	if (debug) {
-	    		System.out.println("[" + this.getClass().getSimpleName() + "] " + message);
+	    		System.out.println("[" + this.testClassName + "] " + message);
 	    	}
 	    	
 	    }
 	    
 	    protected void detail(String message) {
-	    	System.out.println("[" + this.getClass().getSimpleName() + "] " + message);
+	    	System.out.println("[" + this.testClassName + "] " + message);
 	    }
 	    
 



More information about the teiid-commits mailing list