Author: vhalbert(a)redhat.com
Date: 2009-12-15 14:24:54 -0500 (Tue, 15 Dec 2009)
New Revision: 1669
Modified:
trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/ConnectionStrategy.java
trunk/test-integration/db/src/main/java/org/teiid/test/framework/datasource/DataSourceMgr.java
Log:
Teiid 781 - removed using the connection proxy because it interfers with the integration
tests, also fixed the logger and changed the expected results to support specifying that
there are no rows expected for a query.
Modified:
trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/ConnectionStrategy.java
===================================================================
---
trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/ConnectionStrategy.java 2009-12-15
19:23:10 UTC (rev 1668)
+++
trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/ConnectionStrategy.java 2009-12-15
19:24:54 UTC (rev 1669)
@@ -20,7 +20,6 @@
import org.teiid.adminapi.VDB;
import org.teiid.test.framework.ConfigPropertyLoader;
import org.teiid.test.framework.TestLogger;
-import org.teiid.test.framework.ConfigPropertyNames.CONNECTION_STRATEGY_PROPS;
import org.teiid.test.framework.datasource.DataSource;
import org.teiid.test.framework.datasource.DataSourceFactory;
import org.teiid.test.framework.datasource.DataSourceMgr;
@@ -37,6 +36,8 @@
private Properties env = null;
private DataSourceFactory dsFactory;
+ // the useProxy is used for non-teiid connections so that the sources are closed and
reconnected all the time
+ private boolean useProxy = false;
public ConnectionStrategy(Properties props, DataSourceFactory dsf) {
@@ -55,6 +56,14 @@
*/
public abstract Connection getConnection() throws QueryTestFailedException;
+ public boolean useProxy() {
+ return this.useProxy;
+ }
+
+ void setUseProxy(boolean useproxy) {
+ this.useProxy = useproxy;
+ }
+
/**
* @since
*/
@@ -121,25 +130,23 @@
if (this.isDataStoreDisabled()) {
return;
}
-
-
- String ac = this.env.getProperty(CONNECTION_STRATEGY_PROPS.AUTOCOMMIT,
"true");
- this.autoCommit = Boolean.getBoolean(ac);
-
- com.metamatrix.jdbc.api.Connection c =null;
+
+ com.metamatrix.jdbc.MMConnection c = null;
try {
// the the driver strategy is going to be used to connection directly to the
connector binding
// source, then no administration can be done
- java.sql.Connection conn = getConnection();
- if ( conn instanceof com.metamatrix.jdbc.api.Connection) {
- c = (com.metamatrix.jdbc.api.Connection) conn;
- } else {
- return;
- }
+ java.sql.Connection conn = getConnection();
+ if ( conn instanceof com.metamatrix.jdbc.MMConnection) {
+ c = (com.metamatrix.jdbc.MMConnection) conn;
+ } else {
+ TestLogger.log("ConnectionStrategy configuration: connection is not of type
MMConnection and therefore no vdb setup will be performed");
+ return;
+ }
+
Admin admin = (Admin)c.getAdminAPI();
-
+
setupVDBConnectorBindings(admin);
@@ -267,7 +274,7 @@
}
ds.setConnection(cs);
-
+
return ds.getConnection();
Modified:
trunk/test-integration/db/src/main/java/org/teiid/test/framework/datasource/DataSourceMgr.java
===================================================================
---
trunk/test-integration/db/src/main/java/org/teiid/test/framework/datasource/DataSourceMgr.java 2009-12-15
19:23:10 UTC (rev 1668)
+++
trunk/test-integration/db/src/main/java/org/teiid/test/framework/datasource/DataSourceMgr.java 2009-12-15
19:24:54 UTC (rev 1669)
@@ -104,6 +104,7 @@
private void loadDataSourceMappings() throws QueryTestFailedException {
if (ConfigPropertyLoader.getInstance().isDataStoreDisabled()) {
+ TestLogger.log("DataStore usage has been disabled");
return;
}