teiid SVN: r1510 - trunk/test-integration/db/src/test/java/org/teiid/test/testcases.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-10-01 09:56:55 -0400 (Thu, 01 Oct 2009)
New Revision: 1510
Modified:
trunk/test-integration/db/src/test/java/org/teiid/test/testcases/LocalTransactionDriverFalseOffTest.java
trunk/test-integration/db/src/test/java/org/teiid/test/testcases/LocalTransactionDriverTrueOffTest.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/test/java/org/teiid/test/testcases/LocalTransactionDriverFalseOffTest.java
===================================================================
--- trunk/test-integration/db/src/test/java/org/teiid/test/testcases/LocalTransactionDriverFalseOffTest.java 2009-10-01 13:55:33 UTC (rev 1509)
+++ trunk/test-integration/db/src/test/java/org/teiid/test/testcases/LocalTransactionDriverFalseOffTest.java 2009-10-01 13:56:55 UTC (rev 1510)
@@ -4,6 +4,7 @@
*/
package org.teiid.test.testcases;
+import org.teiid.test.framework.ConfigPropertyLoader;
import org.teiid.test.framework.ConfigPropertyNames;
import org.teiid.test.framework.ConfigPropertyNames.CONNECTION_STRATEGY_PROPS;
@@ -27,13 +28,12 @@
protected void setUp() throws Exception {
super.setUp();
-// this.addProperty(ConfigPropertyNames.USE_DATASOURCES_PROP, "oracle,sqlserver");
-
this.addProperty(ConfigPropertyNames.CONNECTION_TYPE, ConfigPropertyNames.CONNECTION_TYPES.DRIVER_CONNECTION);
this.addProperty(CONNECTION_STRATEGY_PROPS.AUTOCOMMIT, "false");
this.addProperty(CONNECTION_STRATEGY_PROPS.TXN_AUTO_WRAP, "off");
-
+ this.addProperty(ConfigPropertyNames.CONFIG_FILE, ConfigPropertyLoader.DEFAULT_CONFIG_FILE_NAME);
+
}
Modified: trunk/test-integration/db/src/test/java/org/teiid/test/testcases/LocalTransactionDriverTrueOffTest.java
===================================================================
--- trunk/test-integration/db/src/test/java/org/teiid/test/testcases/LocalTransactionDriverTrueOffTest.java 2009-10-01 13:55:33 UTC (rev 1509)
+++ trunk/test-integration/db/src/test/java/org/teiid/test/testcases/LocalTransactionDriverTrueOffTest.java 2009-10-01 13:56:55 UTC (rev 1510)
@@ -4,6 +4,7 @@
*/
package org.teiid.test.testcases;
+import org.teiid.test.framework.ConfigPropertyLoader;
import org.teiid.test.framework.ConfigPropertyNames;
import org.teiid.test.framework.ConfigPropertyNames.CONNECTION_STRATEGY_PROPS;
@@ -30,7 +31,8 @@
this.addProperty(ConfigPropertyNames.CONNECTION_TYPE, ConfigPropertyNames.CONNECTION_TYPES.DRIVER_CONNECTION);
this.addProperty(CONNECTION_STRATEGY_PROPS.AUTOCOMMIT, "true");
this.addProperty(CONNECTION_STRATEGY_PROPS.TXN_AUTO_WRAP, "off");
-
+ this.addProperty(ConfigPropertyNames.CONFIG_FILE, ConfigPropertyLoader.DEFAULT_CONFIG_FILE_NAME);
+
}
15 years, 2 months
teiid SVN: r1509 - trunk/test-integration/db/src/main/java/org/teiid/test/framework.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)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);
}
15 years, 2 months