teiid SVN: r1440 - trunk/test-integration.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-09-21 16:36:52 -0400 (Mon, 21 Sep 2009)
New Revision: 1440
Modified:
trunk/test-integration/pom.xml
Log:
Teiid 773 - organize integration test - needed teiid-metadata dependency added
Modified: trunk/test-integration/pom.xml
===================================================================
--- trunk/test-integration/pom.xml 2009-09-21 20:36:14 UTC (rev 1439)
+++ trunk/test-integration/pom.xml 2009-09-21 20:36:52 UTC (rev 1440)
@@ -35,6 +35,10 @@
<dependency>
<groupId>org.jboss.teiid</groupId>
<artifactId>teiid-metadata</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-metadata</artifactId>
<type>test-jar</type>
</dependency>
<dependency>
@@ -45,7 +49,6 @@
<dependency>
<groupId>org.jboss.teiid</groupId>
<artifactId>teiid-connector-sdk</artifactId>
- <scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.teiid</groupId>
@@ -93,20 +96,17 @@
<groupId>org.jboss.teiid.connectors</groupId>
<artifactId>connector-loopback</artifactId>
<version>${project.version}</version>
- <scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.teiid.connectors</groupId>
<artifactId>connector-text</artifactId>
<version>${project.version}</version>
- <scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.teiid.connectors</groupId>
<artifactId>connector-text</artifactId>
<type>test-jar</type>
<version>${project.version}</version>
- <scope>test</scope>
</dependency>
<dependency>
@@ -119,7 +119,6 @@
<artifactId>connector-jdbc</artifactId>
<type>test-jar</type>
<version>${project.version}</version>
- <scope>test</scope>
</dependency>
<!-- external dependencies -->
15 years, 3 months
teiid SVN: r1439 - in trunk/test-integration: db and 1 other directory.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-09-21 16:36:14 -0400 (Mon, 21 Sep 2009)
New Revision: 1439
Modified:
trunk/test-integration/common/pom.xml
trunk/test-integration/db/pom.xml
Log:
renamed the artifact names to be prefixed by test-integeration
Modified: trunk/test-integration/common/pom.xml
===================================================================
--- trunk/test-integration/common/pom.xml 2009-09-21 20:35:21 UTC (rev 1438)
+++ trunk/test-integration/common/pom.xml 2009-09-21 20:36:14 UTC (rev 1439)
@@ -7,7 +7,7 @@
<version>6.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
- <artifactId>common</artifactId>
+ <artifactId>test-integration-common</artifactId>
<name>Common Integration Tests</name>
<groupId>org.jboss.teiid.teiid-test-integration</groupId>
Modified: trunk/test-integration/db/pom.xml
===================================================================
--- trunk/test-integration/db/pom.xml 2009-09-21 20:35:21 UTC (rev 1438)
+++ trunk/test-integration/db/pom.xml 2009-09-21 20:36:14 UTC (rev 1439)
@@ -7,7 +7,7 @@
<version>6.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
- <artifactId>db</artifactId>
+ <artifactId>test-integration-db</artifactId>
<name>DB Dependent Integration Tests</name>
<groupId>org.jboss.teiid.teiid-test-integration</groupId>
@@ -108,10 +108,10 @@
</property>
</systemProperties>
-<!--
+
<forkMode>always</forkMode>
<forkedProcessTimeoutInSeconds>600</forkedProcessTimeoutInSeconds>
- -->
+
<includes>
<!-- <include>**/*TestCase.java</include> -->
<include>**/*Test.java</include>
15 years, 3 months
teiid SVN: r1438 - trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-09-21 16:35:21 -0400 (Mon, 21 Sep 2009)
New Revision: 1438
Modified:
trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/DataSourceConnection.java
Log:
Teiid 773 - setting up the xa transaction tests
Modified: trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/DataSourceConnection.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/DataSourceConnection.java 2009-09-21 20:34:33 UTC (rev 1437)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/DataSourceConnection.java 2009-09-21 20:35:21 UTC (rev 1438)
@@ -34,7 +34,7 @@
// the driver is only used for making direct connections to the source, the
// connector type will provide the JDBCPropertyNames.CONNECTION_SOURCE driver class
- public static final String DS_DATASOURCE = "datasource"; //$NON-NLS-1$
+ public static final String DS_DRIVER = "driver"; //$NON-NLS-1$
public static final String DS_SERVERNAME = "servername"; //$NON-NLS-1$
public static final String DS_SERVERPORT = "portnumber"; //$NON-NLS-1$
@@ -79,9 +79,9 @@
this.applName = this.getEnvironment().getProperty(DS_APPLICATION_NAME);
- driver = this.getEnvironment().getProperty(DS_DATASOURCE);
+ driver = this.getEnvironment().getProperty(DS_DRIVER);
if (driver == null || driver.length() == 0) {
- throw new TransactionRuntimeException("Property " + DS_DATASOURCE + " was not specified");
+ throw new TransactionRuntimeException("Property " + DS_DRIVER + " was not specified");
}
this.username = this.getEnvironment().getProperty(DS_USER);
@@ -89,19 +89,6 @@
}
-//
-// public synchronized XAConnection getXAAdminConnection() throws QueryTestFailedException {
-// if (xaConnection == null) {
-// try {
-// xaConnection = createAdminConnection();
-// } catch (Exception e) {
-// throw new QueryTestFailedException(e);
-// }
-// }
-// return xaConnection;
-// }
-
-
public Connection getConnection() throws QueryTestFailedException {
try {
return getXAConnection().getConnection();
@@ -150,42 +137,8 @@
return ((XADataSource)dataSource).getXAConnection();
- }
-
-// private XAConnection createAdminConnection() throws SQLException, InstantiationException, IllegalAccessException, ClassNotFoundException {
-// BaseDataSource dataSource = (BaseDataSource)Class.forName(this.driver).newInstance();
-//
-// dataSource.setDatabaseName("Admin");
-// if (this.applName != null) {
-// dataSource.setApplicationName(this.applName);
-// }
-//
-// if (dataSource instanceof EmbeddedDataSource) {
-// ((EmbeddedDataSource)dataSource).setBootstrapFile(this.serverName);
-// } else {
-// ((MMDataSource)dataSource).setServerName(this.serverName);
-// ((MMDataSource)dataSource).setPortNumber(Integer.parseInt(this.portNumber));
-// }
-//
-// if (this.username != null) {
-// dataSource.setUser(this.username);
-// dataSource.setPassword(this.pwd);
-// }
-//
-//
-// return ((XADataSource)dataSource).getXAConnection();
-// }
+ }
-// private static XAConnection getDataSource(String prefix, Properties props) throws SQLException, InstantiationException, IllegalAccessException, ClassNotFoundException {
-// // depending upon the DataDirect class hirarchy..
-// DataSource dataSource = (DataSource)Class.forName(props.getProperty(DS_DRIVER)).newInstance();
-// PropertiesUtils.setBeanProperties(dataSource, props, prefix);
-//
-// return ((XADataSource)dataSource).getXAConnection();
-// }
-
-
-
public void shutdown() {
try {
15 years, 3 months
teiid SVN: r1437 - trunk/test-integration/db/src/main/resources/datasources.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-09-21 16:34:33 -0400 (Mon, 21 Sep 2009)
New Revision: 1437
Modified:
trunk/test-integration/db/src/main/resources/datasources/datasource_mapping.xml
Log:
Teiid 773 - setting up the xa transaction tests
Modified: trunk/test-integration/db/src/main/resources/datasources/datasource_mapping.xml
===================================================================
--- trunk/test-integration/db/src/main/resources/datasources/datasource_mapping.xml 2009-09-21 20:31:25 UTC (rev 1436)
+++ trunk/test-integration/db/src/main/resources/datasources/datasource_mapping.xml 2009-09-21 20:34:33 UTC (rev 1437)
@@ -68,7 +68,7 @@
<property name="dir">oracle</property>
<property name="connectortype">Oracle XA Connector</property>
</datasource>
- <datasource name="ds_sqlserver">
+ <datasource name="ds_sqlserve_xa">
<property name="dir">sqlserver</property>
<property name="connectortype">SQL Server XA Connector</property>
</datasource>
15 years, 3 months
teiid SVN: r1436 - trunk/test-integration/db/src/main/java/org/teiid/test/framework.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-09-21 16:31:25 -0400 (Mon, 21 Sep 2009)
New Revision: 1436
Modified:
trunk/test-integration/db/src/main/java/org/teiid/test/framework/TransactionContainer.java
Log:
Teiid 773 - organize integration test
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-21 20:31:03 UTC (rev 1435)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/TransactionContainer.java 2009-09-21 20:31:25 UTC (rev 1436)
@@ -120,6 +120,10 @@
}
+ if (test.exceptionExpected() && !test.exceptionOccurred()) {
+ throw new TransactionRuntimeException("Expected exception, but one did not occur");
+ }
+
try {
detail("Start validation: " + test.getTestName());
15 years, 3 months
teiid SVN: r1435 - trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-09-21 16:31:03 -0400 (Mon, 21 Sep 2009)
New Revision: 1435
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/ConnectionStrategyFactory.java
trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/ConnectionUtil.java
trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/DataSourceConnection.java
trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/DriverConnection.java
trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/JEEConnection.java
Log:
Teiid 773 - setting up the xa transaction tests
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-09-21 20:30:36 UTC (rev 1434)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/ConnectionStrategy.java 2009-09-21 20:31:03 UTC (rev 1435)
@@ -30,28 +30,29 @@
public abstract class ConnectionStrategy {
- public static final String DS_USER = "user"; //$NON-NLS-1$
-
- // need both user variables because Teiid uses 'user' and connectors use 'username'
- public static final String DS_USERNAME = JDBCPropertyNames.USERNAME; //$NON-NLS-1$
- public static final String DS_PASSWORD = JDBCPropertyNames.PASSWORD; //$NON-NLS-1$
-
- // the driver is only used for making direct connections to the source, the
- // connector type will provide the JDBCPropertyNames.CONNECTION_SOURCE driver class
- public static final String DS_DRIVER = "driver"; //$NON-NLS-1$
-
- public static final String DS_URL = JDBCPropertyNames.URL; //$NON-NLS-1$
- public static final String DS_SERVERNAME = "servername"; //$NON-NLS-1$
- public static final String DS_SERVERPORT = "portnumber"; //$NON-NLS-1$
- public static final String DS_JNDINAME = "ds-jndiname"; //$NON-NLS-1$
- public static final String DS_DATABASENAME = "databasename"; //$NON-NLS-1$
- public static final String DS_APPLICATION_NAME = "application-name"; //$NON-NLS-1$
-
- public static final String PROCESS_BATCH = "process-batch"; //$NON-NLS-1$
- public static final String CONNECTOR_BATCH = "connector-batch"; //$NON-NLS-1$
- public static final String JNDINAME_USERTXN = "usertxn-jndiname"; //$NON-NLS-1$
-
-
+// public static final String DS_USER = "user"; //$NON-NLS-1$
+//
+// // need both user variables because Teiid uses 'user' and connectors use 'username'
+// public static final String DS_USERNAME = JDBCPropertyNames.USERNAME; //$NON-NLS-1$
+// public static final String DS_PASSWORD = JDBCPropertyNames.PASSWORD; //$NON-NLS-1$
+//
+// // the driver is only used for making direct connections to the source, the
+// // connector type will provide the JDBCPropertyNames.CONNECTION_SOURCE driver class
+// public static final String DS_DRIVER = "driver"; //$NON-NLS-1$
+// public static final String DS_DATASOURCE = "datasource"; //$NON-NLS-1$
+//
+// public static final String DS_URL = JDBCPropertyNames.URL; //$NON-NLS-1$
+// public static final String DS_SERVERNAME = "servername"; //$NON-NLS-1$
+// public static final String DS_SERVERPORT = "portnumber"; //$NON-NLS-1$
+//
+// public static final String DS_DATABASENAME = "databasename"; //$NON-NLS-1$
+// public static final String DS_APPLICATION_NAME = "application-name"; //$NON-NLS-1$
+//
+ public static final String JNDINAME_USERTXN = "usertxn-jndiname"; //$NON-NLS-1$
+
+ public static final String PROCESS_BATCH = "process-batch"; //$NON-NLS-1$
+ public static final String CONNECTOR_BATCH = "connector-batch"; //$NON-NLS-1$
+
public static final String AUTOCOMMIT = "autocommit"; //$NON-NLS-1$
public static final String TXN_AUTO_WRAP = ExecutionProperties.PROP_TXN_AUTO_WRAP;
@@ -205,6 +206,7 @@
org.teiid.test.framework.datasource.DataSource ds = DataSourceMgr.getInstance().getDatasource(useName, m.getName());
if (ds != null) {
+ System.out.println("Setting up Connector Binding of Type: " + ds.getConnectorType()); //$NON-NLS-1$
AdminOptions ao = new AdminOptions(AdminOptions.OnConflict.OVERWRITE);
ao.addOption(AdminOptions.BINDINGS_IGNORE_DECRYPT_ERROR);
@@ -222,6 +224,7 @@
} catch (QueryTestFailedException qt) {
throw qt;
} catch (Exception t) {
+ t.printStackTrace();
throw new QueryTestFailedException(t);
}
Modified: trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/ConnectionStrategyFactory.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/ConnectionStrategyFactory.java 2009-09-21 20:30:36 UTC (rev 1434)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/ConnectionStrategyFactory.java 2009-09-21 20:31:03 UTC (rev 1435)
@@ -18,7 +18,7 @@
private static ConnectionStrategyFactory _instance = null;
private ConnectionStrategy strategy = null;
- private static Map<String, ConnectionStrategy> sources = null;
+ private Map<String, ConnectionStrategy> sources = null;
private ConnectionStrategyFactory(){
@@ -27,17 +27,17 @@
public static synchronized ConnectionStrategyFactory getInstance() {
if (_instance == null) {
_instance = new ConnectionStrategyFactory();
- try {
- _instance.initialize();
- } catch (QueryTestFailedException e) {
+
+ _instance. init();
// TODO Auto-generated catch block
- throw new TransactionRuntimeException(e);
- }
+// _instance = null;
+// throw new TransactionRuntimeException(e);
+// }
}
return _instance;
}
- private static void init() {
+ private void init() {
if (sources == null) {
sources = new HashMap<String, ConnectionStrategy>();
}
@@ -75,15 +75,13 @@
}
- public ConnectionStrategy getConnectionStrategy() {
+ public synchronized ConnectionStrategy getConnectionStrategy() throws QueryTestFailedException {
+ if (strategy == null) {
+ this.strategy = create(ConfigPropertyLoader.getProperties());
+ }
return this.strategy;
}
- private void initialize() throws QueryTestFailedException {
- init();
- this.strategy = create(ConfigPropertyLoader.getProperties());
-
- }
private ConnectionStrategy create(Properties props) throws QueryTestFailedException {
@@ -116,11 +114,10 @@
return strategy;
}
- public synchronized static ConnectionStrategy createDriverStrategy(String identifier, Properties props) throws QueryTestFailedException {
+ public synchronized ConnectionStrategy createDriverStrategy(String identifier, Properties props) throws QueryTestFailedException {
if (identifier == null) {
return new DriverConnection(props);
}
- init();
ConnectionStrategy strategy = null;
if (sources.containsKey(identifier)) {
@@ -134,11 +131,10 @@
}
- public synchronized static ConnectionStrategy createDataSourceStrategy(String identifier, Properties props) throws QueryTestFailedException {
+ public synchronized ConnectionStrategy createDataSourceStrategy(String identifier, Properties props) throws QueryTestFailedException {
if (identifier == null) {
return new DataSourceConnection(props);
}
- init();
ConnectionStrategy strategy = null;
if (sources.containsKey(identifier)) {
@@ -152,12 +148,11 @@
}
- public synchronized static ConnectionStrategy createJEEStrategy(String identifier, Properties props) throws QueryTestFailedException {
+ public synchronized ConnectionStrategy createJEEStrategy(String identifier, Properties props) throws QueryTestFailedException {
if (identifier == null) {
return new JEEConnection(props);
}
- init();
ConnectionStrategy strategy = null;
if (sources.containsKey(identifier)) {
strategy = sources.get(identifier);
Modified: trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/ConnectionUtil.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/ConnectionUtil.java 2009-09-21 20:30:36 UTC (rev 1434)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/ConnectionUtil.java 2009-09-21 20:31:03 UTC (rev 1435)
@@ -37,7 +37,7 @@
+ " has no datasource properties");
}
- return ConnectionStrategyFactory.createDriverStrategy(identifier,
+ return ConnectionStrategyFactory.getInstance().createDriverStrategy(identifier,
sourceProps).getConnection();
}
@@ -69,7 +69,7 @@
+ " has no datasource properties");
}
- return ConnectionStrategyFactory.createDataSourceStrategy(
+ return ConnectionStrategyFactory.getInstance().createDataSourceStrategy(
identifier, sourceProps).getXAConnection();
}
throw new RuntimeException("No Connection by name :" + identifier); //$NON-NLS-1$
Modified: trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/DataSourceConnection.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/DataSourceConnection.java 2009-09-21 20:30:36 UTC (rev 1434)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/DataSourceConnection.java 2009-09-21 20:31:03 UTC (rev 1435)
@@ -11,18 +11,41 @@
import javax.sql.XAConnection;
import javax.sql.XADataSource;
+import org.teiid.connector.jdbc.JDBCPropertyNames;
+import org.teiid.jdbc.TeiidDataSource;
import org.teiid.test.framework.exception.QueryTestFailedException;
import org.teiid.test.framework.exception.TransactionRuntimeException;
import com.metamatrix.jdbc.BaseDataSource;
import com.metamatrix.jdbc.EmbeddedDataSource;
import com.metamatrix.jdbc.MMDataSource;
+import com.metamatrix.jdbc.api.ExecutionProperties;
/**
*
*/
public class DataSourceConnection extends ConnectionStrategy {
+
+ public static final String DS_USER = "user"; //$NON-NLS-1$
+
+ // need both user variables because Teiid uses 'user' and connectors use 'username'
+ public static final String DS_USERNAME = JDBCPropertyNames.USERNAME; //$NON-NLS-1$
+ public static final String DS_PASSWORD = JDBCPropertyNames.PASSWORD; //$NON-NLS-1$
+
+ // the driver is only used for making direct connections to the source, the
+ // connector type will provide the JDBCPropertyNames.CONNECTION_SOURCE driver class
+ public static final String DS_DATASOURCE = "datasource"; //$NON-NLS-1$
+
+ public static final String DS_SERVERNAME = "servername"; //$NON-NLS-1$
+ public static final String DS_SERVERPORT = "portnumber"; //$NON-NLS-1$
+ public static final String DS_JNDINAME = "ds-jndiname"; //$NON-NLS-1$
+ public static final String DS_DATABASENAME = "databasename"; //$NON-NLS-1$
+ public static final String DS_APPLICATION_NAME = "application-name"; //$NON-NLS-1$
+
+// public static final String JNDINAME_USERTXN = "usertxn-jndiname"; //$NON-NLS-1$
+
+
private String driver = null;
private String username = null;
private String pwd = null;
@@ -56,9 +79,9 @@
this.applName = this.getEnvironment().getProperty(DS_APPLICATION_NAME);
- driver = this.getEnvironment().getProperty(DS_DRIVER);
+ driver = this.getEnvironment().getProperty(DS_DATASOURCE);
if (driver == null || driver.length() == 0) {
- throw new TransactionRuntimeException("Property " + DS_DRIVER + " was not specified");
+ throw new TransactionRuntimeException("Property " + DS_DATASOURCE + " was not specified");
}
this.username = this.getEnvironment().getProperty(DS_USER);
@@ -103,8 +126,11 @@
}
private XAConnection createConnection() throws SQLException, InstantiationException, IllegalAccessException, ClassNotFoundException {
- BaseDataSource dataSource = (BaseDataSource)Class.forName(this.driver).newInstance();
+ System.out.println("Creating Datasource Connection: \"" + this.serverName + " - " + this.databaseName + "\""); //$NON-NLS-1$ //$NON-NLS-2$
+
+ BaseDataSource dataSource = (BaseDataSource)Class.forName(this.driver).newInstance();
+
dataSource.setDatabaseName(this.databaseName);
if (this.applName != null) {
dataSource.setApplicationName(this.applName);
@@ -113,8 +139,8 @@
if (dataSource instanceof EmbeddedDataSource) {
((EmbeddedDataSource)dataSource).setBootstrapFile(this.serverName);
} else {
- ((MMDataSource)dataSource).setServerName(this.serverName);
- ((MMDataSource)dataSource).setPortNumber(Integer.parseInt(this.portNumber));
+ ((TeiidDataSource)dataSource).setServerName(this.serverName);
+ ((TeiidDataSource)dataSource).setPortNumber(Integer.parseInt(this.portNumber));
}
if (this.username != null) {
Modified: trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/DriverConnection.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/DriverConnection.java 2009-09-21 20:30:36 UTC (rev 1434)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/DriverConnection.java 2009-09-21 20:31:03 UTC (rev 1435)
@@ -9,16 +9,33 @@
import java.sql.SQLException;
import java.util.Properties;
+import org.teiid.connector.jdbc.JDBCPropertyNames;
import org.teiid.test.framework.exception.QueryTestFailedException;
import org.teiid.test.framework.exception.TransactionRuntimeException;
+import com.metamatrix.jdbc.api.ExecutionProperties;
+
/**
* The DriverConnection strategy that can get connections in standalone mode
* or embedded mode.
*/
public class DriverConnection extends ConnectionStrategy{
+
+ public static final String DS_USER = "user"; //$NON-NLS-1$
+
+ // need both user variables because Teiid uses 'user' and connectors use 'username'
+ public static final String DS_USERNAME = JDBCPropertyNames.USERNAME; //$NON-NLS-1$
+ public static final String DS_PASSWORD = JDBCPropertyNames.PASSWORD; //$NON-NLS-1$
+
+ // the driver is only used for making direct connections to the source, the
+ // connector type will provide the JDBCPropertyNames.CONNECTION_SOURCE driver class
+ public static final String DS_DRIVER = "driver"; //$NON-NLS-1$
+
+ public static final String DS_URL = JDBCPropertyNames.URL; //$NON-NLS-1$
+ public static final String DS_APPLICATION_NAME = "application-name"; //$NON-NLS-1$
+
private String url = null;
private String driver = null;
@@ -90,7 +107,7 @@
private Connection getJDBCConnection(String driver, String url, String user, String passwd) throws QueryTestFailedException {
- System.out.println("Creating Connection: \"" + url + "\""); //$NON-NLS-1$ //$NON-NLS-2$
+ System.out.println("Creating Driver Connection: \"" + url + "\""); //$NON-NLS-1$ //$NON-NLS-2$
Connection conn;
try {
@@ -104,6 +121,9 @@
} catch (SQLException e) {
throw new QueryTestFailedException(e);
+ } catch (Throwable t) {
+ t.printStackTrace();
+ throw new QueryTestFailedException(t.getMessage());
}
return conn;
Modified: trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/JEEConnection.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/JEEConnection.java 2009-09-21 20:30:36 UTC (rev 1434)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/JEEConnection.java 2009-09-21 20:31:03 UTC (rev 1435)
@@ -21,6 +21,8 @@
*/
public class JEEConnection extends ConnectionStrategy{
+ public static final String DS_JNDINAME = "ds-jndiname"; //$NON-NLS-1$
+
private String jndi_name = null;
@@ -57,7 +59,7 @@
public void validate() {
// TODO Auto-generated method stub
- jndi_name = getEnvironment().getProperty(ConnectionStrategy.DS_JNDINAME);
+ jndi_name = getEnvironment().getProperty(DS_JNDINAME);
if (jndi_name == null || jndi_name.length() == 0) {
throw new TransactionRuntimeException("Property " + DS_JNDINAME + " was not specified");
}
15 years, 3 months
teiid SVN: r1434 - trunk/test-integration/db/src/main/java/org/teiid/test/framework/transaction.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-09-21 16:30:36 -0400 (Mon, 21 Sep 2009)
New Revision: 1434
Modified:
trunk/test-integration/db/src/main/java/org/teiid/test/framework/transaction/TransactionFactory.java
trunk/test-integration/db/src/main/java/org/teiid/test/framework/transaction/XATransaction.java
Log:
Teiid 773 - setting up the xa transaction tests
Modified: trunk/test-integration/db/src/main/java/org/teiid/test/framework/transaction/TransactionFactory.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/framework/transaction/TransactionFactory.java 2009-09-21 20:30:11 UTC (rev 1433)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/transaction/TransactionFactory.java 2009-09-21 20:30:36 UTC (rev 1434)
@@ -7,6 +7,7 @@
import org.teiid.test.framework.ConfigPropertyLoader;
import org.teiid.test.framework.ConfigPropertyNames;
import org.teiid.test.framework.TransactionContainer;
+import org.teiid.test.framework.exception.QueryTestFailedException;
import org.teiid.test.framework.exception.TransactionRuntimeException;
import org.teiid.test.framework.connection.ConnectionStrategy;
import org.teiid.test.framework.connection.ConnectionStrategyFactory;
@@ -20,7 +21,7 @@
private TransactionFactory(){}
- public static TransactionContainer create() {
+ public static TransactionContainer create() throws QueryTestFailedException {
TransactionContainer transacton = null;
// load the configuration properties defined at this time for the test
Modified: trunk/test-integration/db/src/main/java/org/teiid/test/framework/transaction/XATransaction.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/framework/transaction/XATransaction.java 2009-09-21 20:30:11 UTC (rev 1433)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/transaction/XATransaction.java 2009-09-21 20:30:36 UTC (rev 1434)
@@ -29,6 +29,8 @@
XAResource xaResource = getXAConnection().getXAResource();
xaResource.setTransactionTimeout(120);
xaResource.start(xid, XAResource.TMNOFLAGS);
+ debug("Start transaction using XID: " + xid.toString());
+
} catch (Exception e) {
throw new TransactionRuntimeException(e);
}
@@ -45,8 +47,11 @@
protected void after(TransactionQueryTest test) {
boolean delistSuccessful = false;
boolean commit = false;
+
+ XAResource xaResource = null;
+ boolean exception = false;
try {
- XAResource xaResource = getXAConnection().getXAResource();
+ xaResource = getXAConnection().getXAResource();
xaResource.end(xid, XAResource.TMSUCCESS);
@@ -55,17 +60,20 @@
}
delistSuccessful = true;
} catch (Exception e) {
+ exception = true;
throw new TransactionRuntimeException(e);
} finally {
try {
if (!delistSuccessful || test.rollbackAllways()|| test.exceptionOccurred()) {
- getXAConnection().getXAResource().rollback(xid);
+ xaResource.rollback(xid);
}
else if (commit) {
- getXAConnection().getXAResource().commit(xid, true);
+ xaResource.commit(xid, true);
}
} catch (Exception e) {
- throw new TransactionRuntimeException(e);
+ if (!exception) {
+ throw new TransactionRuntimeException(e);
+ }
}
}
}
15 years, 3 months
teiid SVN: r1433 - trunk/test-integration/db/src/main/resources/transactions.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-09-21 16:30:11 -0400 (Mon, 21 Sep 2009)
New Revision: 1433
Modified:
trunk/test-integration/db/src/main/resources/transactions/transaction.properties
Log:
Teiid 773 - organize integration test
Modified: trunk/test-integration/db/src/main/resources/transactions/transaction.properties
===================================================================
--- trunk/test-integration/db/src/main/resources/transactions/transaction.properties 2009-09-21 20:29:30 UTC (rev 1432)
+++ trunk/test-integration/db/src/main/resources/transactions/transaction.properties 2009-09-21 20:30:11 UTC (rev 1433)
@@ -1,5 +1,10 @@
+#
+# This is properties file used for bootstrap Teiid embedded for loading
+#
+#Path to the Teiid Configuration file
dqp.configFile=../configuration.xml
-#ServerConfig.xml
+
+# Path to the directory where the VDBs are located, or list of VDBS separated by ";"
vdb.definition=./Transaction.vdb
dqp.buffer.usedisk=false
dqp.buffer.processorBatchSize=5
@@ -12,22 +17,11 @@
processName=integrationTest
#dqp.workdir=./tmp/
-#processName=dqpprocess
#only for testing, as this takes more time to start and shutdown
#metamatrix.xatxnmgr.enable_recovery=false
-#
-# This is properties file used for bootstrap Teiid embedded for loading
-#
-
-#Path to the Teiid Configuration file
-#dqp.configFile=./deploy/configuration.xml
-
-# Path to the directory where the VDBs are located, or list of VDBS separated by ";"
-#vdb.definition=./deploy/
-
#Log file (optional) - will be modified to include the instance name, i.e. teiid_1.log
dqp.logFile=./teiid.log
15 years, 3 months
teiid SVN: r1432 - trunk/test-integration/db/src/test/java/org/teiid/test/testcases.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-09-21 16:29:30 -0400 (Mon, 21 Sep 2009)
New Revision: 1432
Modified:
trunk/test-integration/db/src/test/java/org/teiid/test/testcases/BaseAbstractTransactionTestCase.java
Log:
Teiid 773 - setting up the xa transaction tests
Modified: trunk/test-integration/db/src/test/java/org/teiid/test/testcases/BaseAbstractTransactionTestCase.java
===================================================================
--- trunk/test-integration/db/src/test/java/org/teiid/test/testcases/BaseAbstractTransactionTestCase.java 2009-09-21 20:28:11 UTC (rev 1431)
+++ trunk/test-integration/db/src/test/java/org/teiid/test/testcases/BaseAbstractTransactionTestCase.java 2009-09-21 20:29:30 UTC (rev 1432)
@@ -24,7 +24,7 @@
super(name);
}
- protected TransactionContainer getTransactionContainter() {
+ protected TransactionContainer getTransactionContainter() throws QueryTestFailedException {
return TransactionFactory.create();
}
15 years, 3 months
teiid SVN: r1431 - trunk/test-integration/db/src/test/java/org/teiid/test/testcases.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-09-21 16:28:11 -0400 (Mon, 21 Sep 2009)
New Revision: 1431
Added:
trunk/test-integration/db/src/test/java/org/teiid/test/testcases/XATransactionDatasourceFalseOffTest.java
Modified:
trunk/test-integration/db/src/test/java/org/teiid/test/testcases/SingleSourceTransactionScenarios.java
Log:
Teiid 773 - setting up the xa transaction tests
Modified: trunk/test-integration/db/src/test/java/org/teiid/test/testcases/SingleSourceTransactionScenarios.java
===================================================================
--- trunk/test-integration/db/src/test/java/org/teiid/test/testcases/SingleSourceTransactionScenarios.java 2009-09-21 20:24:15 UTC (rev 1430)
+++ trunk/test-integration/db/src/test/java/org/teiid/test/testcases/SingleSourceTransactionScenarios.java 2009-09-21 20:28:11 UTC (rev 1431)
@@ -6,7 +6,6 @@
import org.teiid.test.framework.AbstractQueryTransactionTest;
import org.teiid.test.framework.QueryExecution;
-import org.teiid.test.framework.TransactionQueryTest;
import com.metamatrix.jdbc.api.AbstractQueryTest;
Copied: trunk/test-integration/db/src/test/java/org/teiid/test/testcases/XATransactionDatasourceFalseOffTest.java (from rev 1427, trunk/test-integration/db/src/test/java/org/teiid/test/testcases/XATransactionDriverFalseOffTest.java)
===================================================================
--- trunk/test-integration/db/src/test/java/org/teiid/test/testcases/XATransactionDatasourceFalseOffTest.java (rev 0)
+++ trunk/test-integration/db/src/test/java/org/teiid/test/testcases/XATransactionDatasourceFalseOffTest.java 2009-09-21 20:28:11 UTC (rev 1431)
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2000-2007 MetaMatrix, Inc.
+ * All rights reserved.
+ */
+package org.teiid.test.testcases;
+
+import org.teiid.test.framework.ConfigPropertyNames;
+import org.teiid.test.framework.connection.ConnectionStrategy;
+
+
+/**
+ * Local Transaction Test
+ *
+ * Settings:
+ *
+ * - Transaction Type = local
+ * - Using Driver
+ * - Autocommit = True
+ * - TxnAutoWrap = Off
+ */
+public class XATransactionDatasourceFalseOffTest extends TwoSourceTransactionScenarios {
+
+ public XATransactionDatasourceFalseOffTest(String name) {
+ super(name);
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ System.setProperty(ConfigPropertyNames.CONFIG_FILE, "xa-config.properties");
+
+ System.setProperty(ConfigPropertyNames.CONNECTION_TYPE, ConfigPropertyNames.CONNECTION_TYPES.DATASOURCE_CONNECTION);
+ System.setProperty(ConnectionStrategy.AUTOCOMMIT, "false");
+ System.setProperty(ConnectionStrategy.TXN_AUTO_WRAP, "off");
+ // System.setProperty(ConnectionStrategy.FETCH_SIZE, "true");
+
+
+ }
+
+
+
+}
Property changes on: trunk/test-integration/db/src/test/java/org/teiid/test/testcases/XATransactionDatasourceFalseOffTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 3 months