Author: vhalbert(a)redhat.com
Date: 2009-09-30 12:03:06 -0400 (Wed, 30 Sep 2009)
New Revision: 1494
Modified:
trunk/test-integration/db/src/main/java/org/teiid/test/framework/transaction/JNDITransaction.java
trunk/test-integration/db/src/main/java/org/teiid/test/framework/transaction/LocalTransaction.java
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 - changed the following:
- the testcase will not use system property to pass in overrides/additions to the loaded
config.properties file. Now will use an addProperty() method provided on the abstract
testcase that will apply the properties per test.
- remove the datasource_mapping.xml. There is no need to distinquish between xa and
nonxa connector types. The connector type will be specified in the
connection.properties file.
- if using the -DuserDataSources property to control datasource, it will imply order
based on whats specified. The config.properties file will now map the model to order
(i.e., pm1:1), where this order determines which datasource it will correspond to based on
the userDataSources property. This mapping is done so that the nightly testing process
can control which datasources are being used and can ensure retestability.
Modified:
trunk/test-integration/db/src/main/java/org/teiid/test/framework/transaction/JNDITransaction.java
===================================================================
---
trunk/test-integration/db/src/main/java/org/teiid/test/framework/transaction/JNDITransaction.java 2009-09-30
16:02:12 UTC (rev 1493)
+++
trunk/test-integration/db/src/main/java/org/teiid/test/framework/transaction/JNDITransaction.java 2009-09-30
16:03:06 UTC (rev 1494)
@@ -7,9 +7,10 @@
import javax.naming.InitialContext;
import javax.transaction.UserTransaction;
+import org.teiid.test.framework.ConfigPropertyLoader;
import org.teiid.test.framework.TransactionContainer;
import org.teiid.test.framework.TransactionQueryTest;
-import org.teiid.test.framework.connection.ConnectionStrategy;
+import org.teiid.test.framework.ConfigPropertyNames.CONNECTION_STRATEGY_PROPS;
import org.teiid.test.framework.exception.TransactionRuntimeException;
@@ -18,12 +19,12 @@
public class JNDITransaction extends TransactionContainer {
UserTransaction userTxn = null;
- public JNDITransaction() {
- super();
+ public JNDITransaction(ConfigPropertyLoader config) {
+ super(config);
}
protected void before(TransactionQueryTest test) {
- if (this.props.getProperty(ConnectionStrategy.JNDINAME_USERTXN) == null) {
+ if (this.props.getProperty(CONNECTION_STRATEGY_PROPS.JNDINAME_USERTXN) == null)
{
throw new TransactionRuntimeException("No JNDI name found for the User
Transaction to look up in application server");
}
@@ -31,7 +32,7 @@
// begin the transaction
InitialContext ctx = new InitialContext();
- this.userTxn =
(UserTransaction)ctx.lookup(this.props.getProperty(ConnectionStrategy.JNDINAME_USERTXN));
+ this.userTxn =
(UserTransaction)ctx.lookup(this.props.getProperty(CONNECTION_STRATEGY_PROPS.JNDINAME_USERTXN));
this.userTxn.begin();
} catch (Exception e) {
throw new TransactionRuntimeException(e);
Modified:
trunk/test-integration/db/src/main/java/org/teiid/test/framework/transaction/LocalTransaction.java
===================================================================
---
trunk/test-integration/db/src/main/java/org/teiid/test/framework/transaction/LocalTransaction.java 2009-09-30
16:02:12 UTC (rev 1493)
+++
trunk/test-integration/db/src/main/java/org/teiid/test/framework/transaction/LocalTransaction.java 2009-09-30
16:03:06 UTC (rev 1494)
@@ -4,21 +4,24 @@
*/
package org.teiid.test.framework.transaction;
+
import java.sql.SQLException;
+import org.teiid.test.framework.ConfigPropertyLoader;
import org.teiid.test.framework.TransactionContainer;
import org.teiid.test.framework.TransactionQueryTest;
import org.teiid.test.framework.exception.TransactionRuntimeException;
+
/**
* A transaction which is user controlled.
*/
public class LocalTransaction extends TransactionContainer {
- public LocalTransaction() {
- super();
+ public LocalTransaction(ConfigPropertyLoader config) {
+ super(config);
}
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-30
16:02:12 UTC (rev 1493)
+++
trunk/test-integration/db/src/main/java/org/teiid/test/framework/transaction/TransactionFactory.java 2009-09-30
16:03:06 UTC (rev 1494)
@@ -9,8 +9,6 @@
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;
@@ -21,35 +19,24 @@
private TransactionFactory(){}
- public static TransactionContainer create() throws QueryTestFailedException {
+ public static TransactionContainer create(ConfigPropertyLoader config) throws
QueryTestFailedException {
TransactionContainer transacton = null;
-
- // load the configuration properties defined at this time for the test
- ConfigPropertyLoader.loadConfigurationProperties();
-
-
- // ConnectionStrategy connstrategy =
ConnectionStrategyFactory.getInstance().getConnectionStrategy();
-
-// Properties props = ConfigPropertyLoader.getProperties();
-
-
- String type =
ConfigPropertyLoader.getProperty(ConfigPropertyNames.TRANSACTION_TYPE);
-
//connstrategy.getEnvironment().getProperty(ConfigPropertyNames.TRANSACTION_TYPE,
ConfigPropertyNames.TRANSACTION_TYPES.LOCAL_TRANSACTION);
+
+ String type = config.getProperty(ConfigPropertyNames.TRANSACTION_TYPE);
if (type == null) {
type = ConfigPropertyNames.TRANSACTION_TYPES.LOCAL_TRANSACTION;
-// throw new RuntimeException("Property " +
ConfigPropertyNames.TRANSACTION_TYPE + " was specified");
}
System.out.println("Create TransactionContainer: " + type);
if
(type.equalsIgnoreCase(ConfigPropertyNames.TRANSACTION_TYPES.LOCAL_TRANSACTION)) {
- transacton = new LocalTransaction();
+ transacton = new LocalTransaction(config);
}
else if
(type.equalsIgnoreCase(ConfigPropertyNames.TRANSACTION_TYPES.XATRANSACTION)) {
- transacton = new XATransaction();
+ transacton = new XATransaction(config);
}
else if
(type.equalsIgnoreCase(ConfigPropertyNames.TRANSACTION_TYPES.JNDI_TRANSACTION)) {
- transacton = new JNDITransaction();
+ transacton = new JNDITransaction(config);
} else {
throw new TransactionRuntimeException("Invalid property value of " +
type + " for " + ConfigPropertyNames.TRANSACTION_TYPE );
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-30
16:02:12 UTC (rev 1493)
+++
trunk/test-integration/db/src/main/java/org/teiid/test/framework/transaction/XATransaction.java 2009-09-30
16:03:06 UTC (rev 1494)
@@ -9,6 +9,7 @@
import javax.sql.XAConnection;
import javax.transaction.xa.XAResource;
+import org.teiid.test.framework.ConfigPropertyLoader;
import org.teiid.test.framework.TransactionContainer;
import org.teiid.test.framework.TransactionQueryTest;
import org.teiid.test.framework.exception.QueryTestFailedException;
@@ -20,8 +21,8 @@
private static Random RANDOM = new Random();
private MMXid xid;
- public XATransaction() {
- super();
+ public XATransaction(ConfigPropertyLoader config) {
+ super(config);
}
protected void before(TransactionQueryTest test) {
Show replies by date