teiid SVN: r1599 - trunk/documentation/reference/src/main/docbook/en-US/content.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-11-25 15:23:42 -0500 (Wed, 25 Nov 2009)
New Revision: 1599
Modified:
trunk/documentation/reference/src/main/docbook/en-US/content/sql_support.xml
Log:
TEIID-251 TEIID-873 added support for order by expressions and removing parsing restrictions that limited quoted identifiers.
Modified: trunk/documentation/reference/src/main/docbook/en-US/content/sql_support.xml
===================================================================
--- trunk/documentation/reference/src/main/docbook/en-US/content/sql_support.xml 2009-11-25 19:19:14 UTC (rev 1598)
+++ trunk/documentation/reference/src/main/docbook/en-US/content/sql_support.xml 2009-11-25 20:23:42 UTC (rev 1599)
@@ -46,17 +46,28 @@
</para>
</listitem>
<listitem>
+ <para>Identifiers in double quotes can have any contents.
+ The double quote character can it's be escaped with an additional double quote. e.g. "some "" id"
+ </para>
+ </listitem>
+ <listitem>
<para> Because different data sources organize tables in different
ways, some prepending catalog or schema or user information,
- Teiid allows the 'table_spec' to be a dot-delimited construct.
+ Teiid allows table specification to be a dot-delimited construct.
</para>
</listitem>
<listitem>
- <para> Identifiers are not case-sensitive in Teiid.</para>
+ <para> When a table specification contains a dot resolving will allow for the match of
+ a partial name against any number of the end segments in the name.
+ </para>
</listitem>
<listitem>
- <para>The separate parts of an identifier can be quoted, with double quotes. This is not required, but some tools do this automatically. Quotes establish another level of grouping, in addition to the dot delimiters. Quotes should not be used in such a way that the table specification, which may itself have multiple parts, is split between two quoted sections.</para>
+ <para> Columns, schemas, and aliases identifiers cannot contain a dot.
+ </para>
</listitem>
+ <listitem>
+ <para> Identifiers, even when quoted, are not case-sensitive in Teiid.</para>
+ </listitem>
</itemizedlist>
<itemizedlist>
<para> Some examples of valid fully-qualified table identifiers are:
@@ -774,15 +785,14 @@
</para>
<para>
Usage:
- <synopsis label="Usage">ORDER BY column1 [ASC|DESC], ...</synopsis>
+ <synopsis label="Usage">ORDER BY expression [ASC|DESC], ...</synopsis>
</para>
<itemizedlist>
<para>Syntax Rules:
</para>
<listitem>
<para>Sort columns may be specified positionally by a 1 based
- integer or string literal, by SELECT clause alias name, or by a column
- reference.</para>
+ integer, by SELECT clause alias name, by SELECT clause expression, or by an unrelated expression.</para>
</listitem>
<listitem>
<para>Column references may appear in the SELECT clause as the
@@ -793,6 +803,11 @@
clause.</para>
</listitem>
<listitem>
+ <para>Unrelated expressions, expressions not appearing as an aliased expression in the select clause,
+ are allowed in the order by clause of a non-set QUERY. The columns referenced in the expression must also follow the prior rule.
+ </para>
+ </listitem>
+ <listitem>
<para>The ORDER BY columns must be of a comparable type.</para>
</listitem>
<listitem>
14 years, 10 months
teiid SVN: r1598 - trunk/test-integration/db/src/test/java/org/teiid/test/testcases.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-11-25 14:19:14 -0500 (Wed, 25 Nov 2009)
New Revision: 1598
Modified:
trunk/test-integration/db/src/test/java/org/teiid/test/testcases/CommonTransactionTests.java
Log:
Teiid 773 - commented out the "testMultipleSourcePartialProcessingUsingLimit, because it's hanging and not sure why at the money.
Modified: trunk/test-integration/db/src/test/java/org/teiid/test/testcases/CommonTransactionTests.java
===================================================================
--- trunk/test-integration/db/src/test/java/org/teiid/test/testcases/CommonTransactionTests.java 2009-11-25 17:27:41 UTC (rev 1597)
+++ trunk/test-integration/db/src/test/java/org/teiid/test/testcases/CommonTransactionTests.java 2009-11-25 19:19:14 UTC (rev 1598)
@@ -562,7 +562,7 @@
* Note: This is producing the below error some times; however this is SQL Server issue.
* http://support.microsoft.com/?kbid=834849
*/
- public void testMultipleSourcePartialProcessingUsingLimit() throws Exception {
+ public void xtestMultipleSourcePartialProcessingUsingLimit() throws Exception {
AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testMultipleSourcePartialProcessingUsingLimit") {
public void testCase() throws Exception {
execute("select * from vm.g1 where pm1e1 < 100 limit 10");
14 years, 10 months
teiid SVN: r1596 - trunk/test-integration/db/src/test/java/org/teiid/test/testcases.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-11-25 12:13:52 -0500 (Wed, 25 Nov 2009)
New Revision: 1596
Modified:
trunk/test-integration/db/src/test/java/org/teiid/test/testcases/CommonTransactionTests.java
trunk/test-integration/db/src/test/java/org/teiid/test/testcases/LocalTransactionTests.java
Log:
Teiid 773 - added the name of the method being tested so that the output indicates the test being run
Modified: trunk/test-integration/db/src/test/java/org/teiid/test/testcases/CommonTransactionTests.java
===================================================================
--- trunk/test-integration/db/src/test/java/org/teiid/test/testcases/CommonTransactionTests.java 2009-11-25 16:14:20 UTC (rev 1595)
+++ trunk/test-integration/db/src/test/java/org/teiid/test/testcases/CommonTransactionTests.java 2009-11-25 17:13:52 UTC (rev 1596)
@@ -77,7 +77,7 @@
* result = commit
*/
public void testSingleSourceSelect() throws Exception {
- AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest() {
+ AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testSingleSourceSelect") {
public void testCase() throws Exception {
execute("select * from pm1.g1 where pm1.g1.e1 < 100");
assertRowCount(100);
@@ -98,7 +98,7 @@
* result = commit
*/
public void testSingleSourceUpdate() throws Exception {
- AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest() {
+ AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testSingleSourceUpdate") {
public void testCase() throws Exception {
execute("insert into pm1.g1 (e1, e2) values(100, '100')");
}
@@ -122,7 +122,8 @@
* result = commit
*/
public void testSingleSourcePreparedUpdate() throws Exception {
- AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest() {
+ AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testSingleSourcePreparedUpdate") {
+
public void testCase() throws Exception {
execute("insert into pm1.g1 (e1, e2) values(?, ?)", new Object[] {new Integer(102), "102"});
}
@@ -145,7 +146,7 @@
* result = commit
*/
public void testSingleSourceMultipleCommands() throws Exception {
- AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest() {
+ AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testSingleSourceMultipleCommands") {
public void testCase() throws Exception {
execute("delete from pm1.g1 where pm1.g1.e1 >= ?", new Object[] {new Integer(100)});
@@ -180,7 +181,7 @@
* result = commit
*/
public void testSingleSourcePartialProcessing() throws Exception {
- AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest() {
+ AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testSingleSourcePartialProcessing") {
public void testCase() throws Exception {
execute("select * from pm1.g1 where pm1.g1.e1 < 100 limit 10");
assertRowCount(10);
@@ -202,7 +203,7 @@
* result = commit
*/
public void testMultipleSourceSelect() throws Exception {
- AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest() {
+ AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testMultipleSourceSelect") {
public void testCase() throws Exception {
execute("select * from pm1.g1 join pm2.g1 on pm1.g1.e1 = pm2.g1.e1 where pm1.g1.e1 < 100");
assertRowCount(100);
@@ -220,7 +221,7 @@
* result = commit
*/
public void testMultipleSourceVirtualSelect() throws Exception {
- AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest() {
+ AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testMultipleSourceVirtualSelect") {
public void testCase() throws Exception {
execute("select * from vm.g1 where vm.g1.pm1e1 < 100");
assertRowCount(100);
@@ -238,7 +239,7 @@
* result = commit
*/
public void testMultipleSourceUpdate() throws Exception {
- AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest() {
+ AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testMultipleSourceUpdate") {
public void testCase() throws Exception {
execute("insert into vm.g1 (pm1e1, pm1e2, pm2e1, pm2e2) values(500, '500', 500, '500')");
}
@@ -266,7 +267,7 @@
* result = commit
*/
public void testMultipleSourceSelectInto() throws Exception {
- AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest() {
+ AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testMultipleSourceSelectInto") {
public void testCase() throws Exception {
execute("insert into vm.g1 (pm1e1, pm1e2, pm2e1, pm2e2) values(501, '501', 501, '501')");
execute("select pm1.g1.e1, pm1.g1.e2 into pm2.g2 from pm1.g1 where pm1.g1.e1 = 501");
@@ -295,7 +296,7 @@
* result = commit
*/
public void testMultipleSourceBulkRowInsert() throws Exception {
- AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest() {
+ AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testMultipleSourceBulkRowInsert") {
public void testCase() throws Exception {
for (int i = 100; i < 112; i++) {
Integer val = new Integer(i);
@@ -329,7 +330,7 @@
* result = commit
*/
public void testMultipleSourcePreparedUpdate() throws Exception {
- AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest() {
+ AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testMultipleSourcePreparedUpdate") {
public void testCase() throws Exception {
Integer value = new Integer(500);
execute("insert into vm.g1 (pm1e1, pm1e2, pm2e1, pm2e2) values(?,?,?,?)", new Object[] {value, value.toString(), value, value.toString()});
@@ -359,7 +360,7 @@
* result = commit
*/
public void testMultipleSourceMultipleCommands() throws Exception {
- AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest() {
+ AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testMultipleSourceMultipleCommands") {
public void testCase() throws Exception {
execute("delete from pm1.g2 where e1 >= ?", new Object[] {new Integer(100)});
execute("delete from pm1.g1 where e1 >= ?", new Object[] {new Integer(100)});
@@ -409,7 +410,7 @@
* result = commit
*/
public void testMultipleSourceMultipleVirtualCommands() throws Exception {
- AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest() {
+ AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testMultipleSourceMultipleVirtualCommands") {
public void testCase() throws Exception {
for (int i = 200; i < 207; i++) {
@@ -453,7 +454,7 @@
* result = rollback
*/
public void testMultipleSourceMultipleCommandsCancel() throws Exception {
- AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest() {
+ AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testMultipleSourceMultipleCommandsCancel") {
public void testCase() throws Exception {
Thread t = new Thread("Cancel Thread") {
@@ -499,7 +500,7 @@
* result = rollback
*/
public void testMultipleSourceTimeout() throws Exception{
- AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest() {
+ AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testMultipleSourceTimeout") {
public void testCase() throws Exception {
executeBatch(getMultipleSourceBatch(), 1); // time out after 1 sec
}
@@ -562,7 +563,7 @@
* http://support.microsoft.com/?kbid=834849
*/
public void testMultipleSourcePartialProcessingUsingLimit() throws Exception {
- AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest() {
+ AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testMultipleSourcePartialProcessingUsingLimit") {
public void testCase() throws Exception {
execute("select * from vm.g1 where pm1e1 < 100 limit 10");
assertRowCount(10);
@@ -582,7 +583,7 @@
* http://support.microsoft.com/?kbid=834849
*/
public void testMultipleSourcePartialProcessingUsingMakedep() throws Exception {
- AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest() {
+ AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testMultipleSourcePartialProcessingUsingMakedep") {
public void testCase() throws Exception {
execute("select pm1.g1.e1, pm1.g1.e2 from pm1.g1 LEFT OUTER JOIN pm2.g1 MAKENOTDEP ON pm1.g1.e2 = pm2.g1.e2 where pm2.g1.e1 >= 50 and pm2.g1.e1 < 100");
assertRowCount(50);
Modified: trunk/test-integration/db/src/test/java/org/teiid/test/testcases/LocalTransactionTests.java
===================================================================
--- trunk/test-integration/db/src/test/java/org/teiid/test/testcases/LocalTransactionTests.java 2009-11-25 16:14:20 UTC (rev 1595)
+++ trunk/test-integration/db/src/test/java/org/teiid/test/testcases/LocalTransactionTests.java 2009-11-25 17:13:52 UTC (rev 1596)
@@ -39,7 +39,7 @@
* result = rollback
*/
public void testSingleSourceMultipleCommandsExplicitRollback() throws Exception {
- AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest() {
+ AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testSingleSourceMultipleCommandsExplicitRollback") {
public void testCase() throws Exception {
for (int i = 200; i < 220; i++) {
execute("insert into pm1.g1 (e1, e2) values("+i+",'"+i+"')");
@@ -71,7 +71,7 @@
* result = rollback
*/
public void testSingleSourceMultipleCommandsReferentialIntegrityRollback() throws Exception {
- AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest() {
+ AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testSingleSourceMultipleCommandsReferentialIntegrityRollback") {
public void testCase() throws Exception {
for (int i = 200; i < 220; i++) {
Integer val = new Integer(i);
@@ -105,7 +105,7 @@
* result = rollback
*/
public void testMultipleSourceMultipleCommandsExplicitRollback() throws Exception {
- AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest() {
+ AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testMultipleSourceMultipleCommandsExplicitRollback") {
public void testCase() throws Exception {
for (int i = 700; i < 720; i++) {
@@ -147,7 +147,7 @@
* result = rollback
*/
public void testMultipleSourceMultipleCommandsReferentialIntegrityRollback() throws Exception {
- AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest() {
+ AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testMultipleSourceMultipleCommandsReferentialIntegrityRollback") {
public void testCase() throws Exception {
for (int i = 700; i < 720; i++) {
@@ -190,7 +190,7 @@
* result = commit
*/
public void testMultipleSourceBulkRowInsertRollback() throws Exception {
- AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest() {
+ AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testMultipleSourceBulkRowInsertRollback") {
public void testCase() throws Exception {
for (int i = 100; i < 120; i++) {
Integer val = new Integer(i);
@@ -231,7 +231,7 @@
* result = commit
*/
public void testMultipleSourceMultipleVirtualCommandsRollback() throws Exception {
- AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest() {
+ AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testMultipleSourceMultipleVirtualCommandsRollback") {
public void testCase() throws Exception {
for (int i = 600; i < 615; i++) {
14 years, 10 months
teiid SVN: r1595 - trunk/test-integration/db.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-11-25 11:14:20 -0500 (Wed, 25 Nov 2009)
New Revision: 1595
Modified:
trunk/test-integration/db/pom.xml
Log:
Teiid 773 - fixed dependencies
Modified: trunk/test-integration/db/pom.xml
===================================================================
--- trunk/test-integration/db/pom.xml 2009-11-25 15:51:46 UTC (rev 1594)
+++ trunk/test-integration/db/pom.xml 2009-11-25 16:14:20 UTC (rev 1595)
@@ -61,69 +61,31 @@
<dependencies>
+
<dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-common-core</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.4</version>
</dependency>
+
<dependency>
<groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-common-internal</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
<artifactId>teiid-metadata</artifactId>
<version>${project.version}</version>
</dependency>
+
<dependency>
<groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-metadata</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
<artifactId>teiid-client</artifactId>
<version>${project.version}</version>
- <type>test-jar</type>
</dependency>
<dependency>
<groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-client</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-connector-sdk</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-connector-sdk</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
<artifactId>teiid-connector-api</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-client-jdbc</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-engine</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- </dependency>
+
<dependency>
<groupId>org.jboss.teiid</groupId>
<artifactId>teiid-txn-jbossts</artifactId>
@@ -136,12 +98,14 @@
<artifactId>teiid-runtime</artifactId>
<version>${project.version}</version>
</dependency>
+
<dependency>
<groupId>org.jboss.teiid</groupId>
<artifactId>teiid-runtime</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
- </dependency>
+ </dependency>
+
<dependency>
<groupId>org.jboss.teiid.connectors</groupId>
<artifactId>connector-loopback</artifactId>
@@ -152,32 +116,100 @@
<artifactId>connector-text</artifactId>
<version>${project.version}</version>
</dependency>
+
+
<dependency>
<groupId>org.jboss.teiid.connectors</groupId>
- <artifactId>connector-text</artifactId>
+ <artifactId>connector-jdbc</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+
+
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-engine</artifactId>
+ <version>${project.version}</version>
<type>test-jar</type>
+ </dependency>
+
+ <dependency>
+ <groupId>com.google.code.guice</groupId>
+ <artifactId>guice</artifactId>
+ <version>1.0</version>
+ </dependency>
+
+<!--
+
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-common-internal</artifactId>
<version>${project.version}</version>
+ <type>test-jar</type>
</dependency>
<dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-common-core</artifactId>
+ <version>${project.version}</version>
+ <type>test-jar</type>
+ </dependency>
+
+ <dependency>
<groupId>org.jboss.teiid.connectors</groupId>
- <artifactId>connector-jdbc</artifactId>
+ <artifactId>connector-text</artifactId>
+ <type>test-jar</type>
<version>${project.version}</version>
</dependency>
+
<dependency>
<groupId>org.jboss.teiid.connectors</groupId>
<artifactId>connector-jdbc</artifactId>
<type>test-jar</type>
<version>${project.version}</version>
</dependency>
+
- <!-- external dependencies -->
+
+
<dependency>
- <groupId>org.apache.derby</groupId>
- <artifactId>derby</artifactId>
- <version>${derby.version}</version>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-connector-sdk</artifactId>
+ <version>${project.version}</version>
+ <type>test-jar</type>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-metadata</artifactId>
+ <version>${project.version}</version>
+ <type>test-jar</type>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-connector-sdk</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+
+-->
+
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-client-jdbc</artifactId>
+ <version>${project.version}</version>
+ <type>test-jar</type>
</dependency>
+
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-client</artifactId>
+ <version>${project.version}</version>
+ <type>test-jar</type>
+ </dependency>
+
<!--
</dependencies>
@@ -206,6 +238,13 @@
<version>${derby.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>derby</artifactId>
+ <version>${derby.version}</version>
+
+ </dependency>
+
<!-- DBUnit dependencies -->
<dependency>
14 years, 10 months
teiid SVN: r1594 - in trunk/engine/src: main/resources/com/metamatrix/query and 2 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-11-25 10:51:46 -0500 (Wed, 25 Nov 2009)
New Revision: 1594
Added:
trunk/engine/src/test/java/org/teiid/metadata/
trunk/engine/src/test/java/org/teiid/metadata/TestCompositeMetadataStore.java
Modified:
trunk/engine/src/main/java/org/teiid/metadata/CompositeMetadataStore.java
trunk/engine/src/main/resources/com/metamatrix/query/i18n.properties
Log:
TEIID-46 refining the fix for proc resolution
Modified: trunk/engine/src/main/java/org/teiid/metadata/CompositeMetadataStore.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/metadata/CompositeMetadataStore.java 2009-11-25 15:29:54 UTC (rev 1593)
+++ trunk/engine/src/main/java/org/teiid/metadata/CompositeMetadataStore.java 2009-11-25 15:51:46 UTC (rev 1594)
@@ -37,6 +37,7 @@
import com.metamatrix.api.exception.MetaMatrixComponentException;
import com.metamatrix.api.exception.query.QueryMetadataException;
import com.metamatrix.metadata.runtime.api.MetadataSource;
+import com.metamatrix.query.QueryPlugin;
/**
* Aggregates the metadata from multiple stores.
@@ -113,7 +114,7 @@
String fullName = p.getFullName();
if (fullName.regionMatches(true, fullName.length() - name.length(), name, 0, name.length())) {
if (result != null) {
- return null; //don't allow ambiguous
+ throw new QueryMetadataException(QueryPlugin.Util.getString("ambiguous_procedure", name.substring(1))); //$NON-NLS-1$
}
result = p;
}
Modified: trunk/engine/src/main/resources/com/metamatrix/query/i18n.properties
===================================================================
--- trunk/engine/src/main/resources/com/metamatrix/query/i18n.properties 2009-11-25 15:29:54 UTC (rev 1593)
+++ trunk/engine/src/main/resources/com/metamatrix/query/i18n.properties 2009-11-25 15:51:46 UTC (rev 1594)
@@ -193,6 +193,7 @@
ERR.015.008.0053= Element "{0}" is ambiguous, it exists in two or more groups.
ERR.015.008.0054= Element "{0}" is not defined by any relevant group.
ERR.015.008.0055= Group specified is ambiguous, resubmit the query by fully qualifying the group name
+ambiguous_procedure= Procedure ''{0}'' is ambiguous, use the fully qualified name instead
ERR.015.008.0056= Group does not exist
ERR.015.008.0057= Variable {0} is not resolvable.
ERR.015.008.0058= Variable {0} is declared with an invalid datatype {1}
Added: trunk/engine/src/test/java/org/teiid/metadata/TestCompositeMetadataStore.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/metadata/TestCompositeMetadataStore.java (rev 0)
+++ trunk/engine/src/test/java/org/teiid/metadata/TestCompositeMetadataStore.java 2009-11-25 15:51:46 UTC (rev 1594)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.metadata;
+
+import static org.junit.Assert.*;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+
+import org.junit.Test;
+import org.mockito.Mockito;
+import org.teiid.connector.metadata.runtime.Datatype;
+import org.teiid.connector.metadata.runtime.MetadataFactory;
+
+import com.metamatrix.api.exception.query.QueryMetadataException;
+import com.metamatrix.common.types.DataTypeManager;
+import com.metamatrix.metadata.runtime.api.MetadataSource;
+
+public class TestCompositeMetadataStore {
+
+ @Test public void testAmbiguousProc() throws Exception {
+ Map<String, Datatype> datatypes = new HashMap<String, Datatype>();
+ datatypes.put(DataTypeManager.DefaultDataTypes.STRING, new Datatype());
+ MetadataFactory mf = new MetadataFactory("x", datatypes, new Properties()); //$NON-NLS-1$
+ mf.addProcedure("y"); //$NON-NLS-1$
+ MetadataFactory mf1 = new MetadataFactory("x1", datatypes, new Properties()); //$NON-NLS-1$
+ mf1.addProcedure("y"); //$NON-NLS-1$
+ CompositeMetadataStore cms = new CompositeMetadataStore(Arrays.asList(mf.getMetadataStore(), mf1.getMetadataStore()), Mockito.mock(MetadataSource.class));
+ try {
+ cms.getStoredProcedure("y"); //$NON-NLS-1$
+ fail("expected exception"); //$NON-NLS-1$
+ } catch (QueryMetadataException e) {
+ assertEquals("Procedure 'y' is ambiguous, use the fully qualified name instead", e.getMessage()); //$NON-NLS-1$
+ }
+ }
+
+}
Property changes on: trunk/engine/src/test/java/org/teiid/metadata/TestCompositeMetadataStore.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years, 10 months
teiid SVN: r1593 - trunk/test-integration/db/src/test/java/org/teiid/test/testcases.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-11-25 10:29:54 -0500 (Wed, 25 Nov 2009)
New Revision: 1593
Modified:
trunk/test-integration/db/src/test/java/org/teiid/test/testcases/BaseAbstractTransactionTestCase.java
Log:
Teiid 773 - refactored back in the way jbedsp transaction classes where defined and added the other integration test
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-11-25 15:29:33 UTC (rev 1592)
+++ trunk/test-integration/db/src/test/java/org/teiid/test/testcases/BaseAbstractTransactionTestCase.java 2009-11-25 15:29:54 UTC (rev 1593)
@@ -4,13 +4,10 @@
import org.teiid.test.framework.ConfigPropertyLoader;
import org.teiid.test.framework.TransactionContainer;
-import org.teiid.test.framework.exception.TransactionRuntimeException;
public abstract class BaseAbstractTransactionTestCase extends TestCase {
- protected ConfigPropertyLoader config = null;
protected TransactionContainer container = null;
- protected boolean setupData = true;
public BaseAbstractTransactionTestCase(String name) {
super(name);
@@ -19,22 +16,27 @@
}
protected abstract TransactionContainer getTransactionContainter();
+
+
+ @Override
+ protected void setUp() throws Exception {
+ // TODO Auto-generated method stub
+ super.setUp();
+ }
- protected ConfigPropertyLoader getConfig() {
- return this.config;
+ @Override
+ protected void tearDown() throws Exception {
+ // TODO Auto-generated method stub
+ super.tearDown();
+
}
+
protected void addProperty(String key, String value) {
- if (config == null) {
- try {
- setUp();
- } catch (Exception e) {
- // TODO Auto-generated catch block
- throw new TransactionRuntimeException(e);
- }
- }
- config.setProperty(key, value);
+
+ ConfigPropertyLoader.getInstance().setProperty(key, value);
+
}
14 years, 10 months
teiid SVN: r1592 - trunk/test-integration/db/src/main/resources/ddl/mysql.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-11-25 10:29:33 -0500 (Wed, 25 Nov 2009)
New Revision: 1592
Modified:
trunk/test-integration/db/src/main/resources/ddl/mysql/create_tables.sql
Log:
Teiid 773 - fixed sql
Modified: trunk/test-integration/db/src/main/resources/ddl/mysql/create_tables.sql
===================================================================
--- trunk/test-integration/db/src/main/resources/ddl/mysql/create_tables.sql 2009-11-25 15:26:10 UTC (rev 1591)
+++ trunk/test-integration/db/src/main/resources/ddl/mysql/create_tables.sql 2009-11-25 15:29:33 UTC (rev 1592)
@@ -1,10 +1,12 @@
-- these tables are used by custom junit test for testing transactions
-
-create Table g1 (e1 NUMERIC(5) PRIMARY KEY, e2 varchar(50));
-create Table g2 (e1 NUMERIC(5) REFERENCES g1 (e1), e2 varchar(50));
-
create Table g1 (e1 NUMERIC(5) PRIMARY KEY, e2 varchar(50))ENGINE=INNODB;
create Table g2 (e1 NUMERIC(5), e2 varchar(50), FOREIGN KEY (e1) REFERENCES g1(e1))ENGINE=INNODB;
+
+--create Table g1 (e1 NUMERIC(5) PRIMARY KEY, e2 varchar(50));
+--create Table g2 (e1 NUMERIC(5) REFERENCES g1 (e1), e2 varchar(50));
+
+
+
\ No newline at end of file
14 years, 10 months
teiid SVN: r1591 - trunk/test-integration/db/src/main/java/org/teiid/test/framework.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-11-25 10:26:10 -0500 (Wed, 25 Nov 2009)
New Revision: 1591
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 - refactored back in the way jbedsp transaction classes where defined and added the other integration test
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-11-25 14:18:01 UTC (rev 1590)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/ConfigPropertyLoader.java 2009-11-25 15:26:10 UTC (rev 1591)
@@ -32,7 +32,15 @@
private static ConfigPropertyLoader _instance = null;
private static String LAST_CONFIG_FILE = null;
+
+ /**
+ * Contains any overrides specified for the test
+ */
+ private Properties overrides = new Properties();
+ /**
+ * Contains the properties loaded from the config file
+ */
private Properties props = null;
private Map<String, String>modelAssignedDatabaseType = new HashMap<String, String>(5);
@@ -84,6 +92,7 @@
}
public static synchronized void cleanup() {
+ _instance.overrides.clear();
_instance.modelAssignedDatabaseType.clear();
_instance.props.clear();
if (_instance.dsfactory != null) {
@@ -93,15 +102,6 @@
LAST_CONFIG_FILE=null;
}
-// private void loadConfigurationProperties() {
-// String filename = System.getProperty(ConfigPropertyNames.CONFIG_FILE);
-// if (filename == null) {
-// filename = DEFAULT_CONFIG_FILE_NAME;
-// }
-//
-// loadProperties(LAST_CONFIG_FILE);
-//
-// }
private void initialize() {
loadProperties(LAST_CONFIG_FILE);
@@ -114,15 +114,30 @@
public String getProperty(String key) {
- return props.getProperty(key);
+ String rtn = null;
+ rtn = overrides.getProperty(key);
+ if (rtn == null) {
+ rtn = props.getProperty(key);
+
+ if (rtn == null) {
+ rtn = System.getProperty(key);
+ }
+ }
+ return rtn;
}
public void setProperty(String key, String value) {
- props.setProperty(key, value);
+ overrides.setProperty(key, value);
}
public Properties getProperties() {
- return props;
+
+ Properties p = new Properties();
+ p.putAll(System.getProperties());
+ p.putAll(props);
+ p.putAll(overrides);
+
+ return p;
}
public Map<String, String> getModelAssignedDatabaseTypes() {
@@ -135,9 +150,7 @@
private void loadProperties(String filename) {
- Properties sysprops = PropertiesUtils.clone(System.getProperties());
-
- props = PropUtils.loadProperties("/" + filename, sysprops);
+ props = PropUtils.loadProperties("/" + filename, null);
}
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-11-25 14:18:01 UTC (rev 1590)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/TransactionContainer.java 2009-11-25 15:26:10 UTC (rev 1591)
@@ -88,7 +88,8 @@
// cleanup all connections created for this test.
if (connStrategy != null) {
connStrategy.shutdown();
- }
+ }
+ }
}
}
14 years, 10 months
teiid SVN: r1590 - trunk/test-integration/db/src/main/java/org/teiid/test/util.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-11-25 09:18:01 -0500 (Wed, 25 Nov 2009)
New Revision: 1590
Modified:
trunk/test-integration/db/src/main/java/org/teiid/test/util/PropUtils.java
Log:
Teiid 773 - refactored back in the way jbedsp transaction classes where defined and added the other integration test
Modified: trunk/test-integration/db/src/main/java/org/teiid/test/util/PropUtils.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/util/PropUtils.java 2009-11-25 14:17:42 UTC (rev 1589)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/util/PropUtils.java 2009-11-25 14:18:01 UTC (rev 1590)
@@ -11,14 +11,13 @@
public static Properties loadProperties(String filename, Properties defaults) {
- Properties props = null;
+ InputStream in = null;
+ Properties props = new Properties();
if (defaults != null) {
- props = new Properties(defaults);
- } else {
- props = new Properties();
- }
+ props.putAll(defaults);
+ }
try {
- InputStream in = ConfigPropertyLoader.class.getResourceAsStream(filename);
+ in = ConfigPropertyLoader.class.getResourceAsStream(filename);
if (in != null) {
Properties lprops = new Properties();
lprops.load(in);
@@ -30,6 +29,12 @@
}
} catch (IOException e) {
throw new RuntimeException("Error loading properties from file '"+filename+ "'" + e.getMessage());
+ } finally {
+ try {
+ in.close();
+ } catch(Exception e){
+
+ }
}
return props;
14 years, 10 months
teiid SVN: r1589 - in trunk/test-integration/db/src/main/java/org/teiid/test/framework: connection and 1 other directories.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-11-25 09:17:42 -0500 (Wed, 25 Nov 2009)
New Revision: 1589
Removed:
trunk/test-integration/db/src/main/java/org/teiid/test/framework/TransactionQueryTest.java
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
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/datasource/DataSourceFactory.java
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/DataStore.java
Log:
Teiid 773 - refactored back in the way jbedsp transaction classes where defined and added the other integration test
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-11-24 20:15:44 UTC (rev 1588)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/ConfigPropertyLoader.java 2009-11-25 14:17:42 UTC (rev 1589)
@@ -4,6 +4,7 @@
import java.util.Map;
import java.util.Properties;
+import org.teiid.test.framework.datasource.DataSourceFactory;
import org.teiid.test.framework.exception.TransactionRuntimeException;
import org.teiid.test.util.PropUtils;
@@ -28,39 +29,92 @@
* set
*/
public static final String DEFAULT_CONFIG_FILE_NAME = "default-config.properties";
+
+ private static ConfigPropertyLoader _instance = null;
+ private static String LAST_CONFIG_FILE = null;
private Properties props = null;
private Map<String, String>modelAssignedDatabaseType = new HashMap<String, String>(5);
+
+ private DataSourceFactory dsfactory = null;
private ConfigPropertyLoader() {
}
- public static synchronized ConfigPropertyLoader createInstance() {
- ConfigPropertyLoader _instance = null;
- _instance = new ConfigPropertyLoader();
- try {
- _instance.loadConfigurationProperties();
- } catch (TransactionRuntimeException e) {
- throw e;
- }
+ public static synchronized ConfigPropertyLoader getInstance() {
+ boolean diff = differentConfigProp();
+
+ if (_instance != null && !diff) {
+ return _instance;
+ }
+
+ if (_instance != null) {
+ cleanup();
+ }
+
+ _instance = new ConfigPropertyLoader();
+ try {
+ _instance.initialize();
+ } catch (TransactionRuntimeException e) {
+ throw e;
+ }
+
return _instance;
}
-
- private void loadConfigurationProperties() {
+
+ /**
+ * because a config file could be different for the subsequent test, check
+ * to see if the file is different.
+ * @return
+ */
+ private static boolean differentConfigProp( ) {
String filename = System.getProperty(ConfigPropertyNames.CONFIG_FILE);
if (filename == null) {
filename = DEFAULT_CONFIG_FILE_NAME;
}
+
+ if (LAST_CONFIG_FILE == null || ! LAST_CONFIG_FILE.equalsIgnoreCase(filename)) {
+ LAST_CONFIG_FILE = filename;
+ return true;
+ }
+ return false;
- loadProperties(filename);
-
}
+
+ public static synchronized void cleanup() {
+ _instance.modelAssignedDatabaseType.clear();
+ _instance.props.clear();
+ if (_instance.dsfactory != null) {
+ _instance.dsfactory.cleanup();
+ }
+ _instance = null;
+ LAST_CONFIG_FILE=null;
+ }
+// private void loadConfigurationProperties() {
+// String filename = System.getProperty(ConfigPropertyNames.CONFIG_FILE);
+// if (filename == null) {
+// filename = DEFAULT_CONFIG_FILE_NAME;
+// }
+//
+// loadProperties(LAST_CONFIG_FILE);
+//
+// }
+
+ private void initialize() {
+ loadProperties(LAST_CONFIG_FILE);
+ dsfactory = new DataSourceFactory(this);
+ }
+
+ public DataSourceFactory getDataSourceFactory() {
+ return this.dsfactory;
+ }
+
public String getProperty(String key) {
- return getProperties().getProperty(key);
+ return props.getProperty(key);
}
public void setProperty(String key, String value) {
@@ -83,21 +137,20 @@
Properties sysprops = PropertiesUtils.clone(System.getProperties());
- props = PropUtils
- .loadProperties("/" + filename, sysprops);
+ props = PropUtils.loadProperties("/" + filename, sysprops);
}
public static void main(String[] args) {
System.setProperty("test", "value");
- ConfigPropertyLoader _instance = ConfigPropertyLoader.createInstance();
+ ConfigPropertyLoader _instance = ConfigPropertyLoader.getInstance();
Properties p = _instance.getProperties();
if (p == null || p.isEmpty()) {
throw new RuntimeException("Failed to load config properties file");
}
- if (p.getProperty("test") == null) {
+ if (!p.getProperty("test").equalsIgnoreCase("value")) {
throw new RuntimeException("Failed to pickup system property");
}
System.out.println("Loaded Config Properties " + p.toString());
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-11-24 20:15:44 UTC (rev 1588)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/TransactionContainer.java 2009-11-25 14:17:42 UTC (rev 1589)
@@ -24,7 +24,7 @@
protected Properties props;
protected TransactionContainer() {
- ConfigPropertyLoader config = ConfigPropertyLoader.createInstance();
+ ConfigPropertyLoader config = ConfigPropertyLoader.getInstance();
try {
this.connStrategy = ConnectionStrategyFactory
@@ -88,8 +88,7 @@
// cleanup all connections created for this test.
if (connStrategy != null) {
connStrategy.shutdown();
- }
- }
+ }
}
}
Deleted: trunk/test-integration/db/src/main/java/org/teiid/test/framework/TransactionQueryTest.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/framework/TransactionQueryTest.java 2009-11-24 20:15:44 UTC (rev 1588)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/TransactionQueryTest.java 2009-11-25 14:17:42 UTC (rev 1589)
@@ -1,207 +0,0 @@
-package org.teiid.test.framework;
-
-import java.sql.Connection;
-import java.util.Properties;
-
-import javax.sql.XAConnection;
-
-import org.teiid.test.framework.connection.ConnectionStrategy;
-import org.teiid.test.framework.exception.QueryTestFailedException;
-
-import com.metamatrix.jdbc.api.AbstractQueryTest;
-
-/**
- * The TransactionQueryTest interface represents the transaction test lifecycle of execution
- * from which the @link TransactionContainer operates.
- * <br><br>
- * QueryTest lifecycle:</br>
- *
- * <br>
- * There are 4 phases or groupings of methods:
- * <li>Setup </li>
- * <li>Test </li>
- * <li>Validation</li>
- * <li>Cleanup</li>
- *
- * <br>
- * <p>
- * <b>1. Setup phase is about setting the global environment for the testing</b>
- * <br>
- *
- * <li>{@link #setConnectionStrategy(ConnectionStrategy)} - called first to provide
- * the environment (i.e, type of connection, parameters, etc) that the test will
- * be run under.
- * <li>{@link #hasRequiredDataSources()} - called after the connection
- * strategy is set so the determination can be made if this test has the
- * required datasources defined and available in order to run the test. If not,
- * then the test is bypassed.
- * <li>{@link #setup()} - called to enable the test to
- * perform any pretest (i.e., global) setup. Example would be data source setup.
- * <li>{@link #setConnection(Connection)} - called to set the client driver (i.e.,
- * Teiid) connection that will be used to execute queries against
- * <li>{@link #setExecutionProperties(Properties)} - called at this time so that the
- * overriding class can obtain / initialize settings that will be assigned when
- * <li>{@link AbstractQueryTest#assignExecutionProperties(Statement)} is called
- * prior to sql execution. (Example: set fetch size, batch time, or timeout)
- * </li>
- * <br>
- * <p>
- * <b>2. Test phase are the methods for executing a test, including any
- * before/after test logic to support the test</b>
- * <br><br>
- *
- * <li>{@link #before()} called before the execution of the test so that the
- * transaction boundary can be set and any other pretest conditions
- * <li>{@link #testCase()} called to execute the specific test
- * <li>{@link #after()} called after the test is executed, which will commit/rollback the transaction
- * and perform any other post conditions
- * </li>
- * <br>
- * <p>
- * <b>3. Validation phase is meant to enable data validation post transaction
- * completion. This is especially helpful when performing XA transactions
- * because the results are not completed and available until after the {@link #after()} step
- * is performed.</b>
- * <br><br>
- *
- * {@link #validateTestCase()}
- *
- * <p>
- * <b>4. Cleanup</b>
- * <br><br>
- *
- * {@link #cleanup()} Called to allow the testcase to perform any cleanup after execution.
- *
- * <br>
- * ================
- * <p>
- * <b>Other Notes:</b>
- * <br><br>
- *
- * The following methods were exposed from {@link AbstractQueryTest}:
- *
- * <li>{@link #exceptionExpected()} - when an exception is expected to occur, the
- * underlying logic will treat the execution as if it succeeded. </li>
- * <li>{@link #exceptionOccurred()} - this method indicates when an exception
- * actually occurred outside of the normal expected results. </li>
- * <li>{@link #getConnection()} and {@link #getXAConnection()} - these connection
- * methods are exposed for {@link #before()} and {@link #after()} methods</li>
- * <li>{@link #rollbackAllways()} - this is exposed for the {@link #after()} method
- * as to what behavior is expected after the execution of the test</li>
- *
- *
- * <br>
- * @author vanhalbert
- *
- */
-
-public interface TransactionQueryTest {
-
- /**
- * Returns the name of the test so that better tracing of what tests are
- * running/completing.
- *
- * @return String is test name
- */
- String getTestName();
-
- /**
- * Called to set the current connection strategy being used.
- *
- * @param connStrategy
- *
- * @since
- */
- void setConnectionStrategy(ConnectionStrategy connStrategy) throws QueryTestFailedException;
-
- /**
- * Called by the {@link TransactionContainer} prior to testcase processing
- * so that the responsibility for performing an setup duties (ie..,
- * datasource setup) can be done
- *
- *
- * @since
- */
- void setup() throws QueryTestFailedException;
-
- /**
- * Called by the @link TransactionContainer to set the Teiid connection to
- * be used in the test.
- *
- * @param conn
- *
- * @since
- */
- void setConnection(Connection conn);
-
- /**
- * Called to set the properties used to initialize prior to execution.
- *
- * @param props
- *
- * @since
- */
-// void setExecutionProperties(Properties props);
-
- /**
- * Override <code>before</code> if there is behavior that needs to be
- * performed prior to {@link #testCase()} being called.
- *
- *
- * @since
- */
- void before();
-
- /**
- * Implement testCase(), it is the entry point to the execution of the test.
- *
- * @throws Exception
- *
- * @since
- */
- void testCase() throws Exception;
-
- /**
- * Override <code>after</code> if there is behavior that needs to be
- * performed after {@link #testCase()} being called.
- *
- *
- * @since
- */
- void after();
-
- /**
- * Indicates what should be done when a failure occurs in
- * {@link #testCase()}
- *
- * @return
- *
- * @since
- */
- boolean rollbackAllways();
-
- /**
- * Called at the end of the test so that the testcase can clean itself up by
- * releasing any resources, closing any open connections, etc.
- *
- *
- * @since
- */
- void cleanup();
-
- /**
- * Returns the connection being used in the test.
- *
- * @return
- *
- * @since
- */
- Connection getConnection();
-
- XAConnection getXAConnection();
-
- boolean exceptionExpected();
-
- boolean exceptionOccurred();
-
-}
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-11-24 20:15:44 UTC (rev 1588)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/ConnectionStrategy.java 2009-11-25 14:17:42 UTC (rev 1589)
@@ -56,11 +56,11 @@
* @since
*/
public void shutdown() {
- try {
- this.dsFactory.cleanup();
- } catch (Throwable t) {
-
- }
+// try {
+// this.dsFactory.cleanup();
+// } catch (Throwable t) {
+//
+// }
}
public Connection getAdminConnection() throws QueryTestFailedException{
@@ -141,7 +141,7 @@
throw new TransactionRuntimeException(e.getMessage());
} finally {
// need to close and flush the connection after restarting
- this.shutdown();
+ // this.shutdown();
}
}
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-11-24 20:15:44 UTC (rev 1588)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/ConnectionStrategyFactory.java 2009-11-25 14:17:42 UTC (rev 1589)
@@ -24,7 +24,6 @@
public static ConnectionStrategy createConnectionStrategy(ConfigPropertyLoader configprops) throws QueryTestFailedException {
ConnectionStrategy strategy = null;
Properties props = configprops.getProperties();
- DataSourceFactory factory = new DataSourceFactory(configprops);
String type = props.getProperty(ConfigPropertyNames.CONNECTION_TYPE, ConfigPropertyNames.CONNECTION_TYPES.DRIVER_CONNECTION);
if (type == null) {
@@ -33,15 +32,15 @@
if (type.equalsIgnoreCase(ConfigPropertyNames.CONNECTION_TYPES.DRIVER_CONNECTION)) {
// pass in null to create new strategy
- strategy = new DriverConnection(props, factory);
+ strategy = new DriverConnection(props, configprops.getDataSourceFactory());
System.out.println("Created Driver Strategy");
}
else if (type.equalsIgnoreCase(ConfigPropertyNames.CONNECTION_TYPES.DATASOURCE_CONNECTION)) {
- strategy = new DataSourceConnection(props, factory);
+ strategy = new DataSourceConnection(props, configprops.getDataSourceFactory());
System.out.println("Created DataSource Strategy");
}
else if (type.equalsIgnoreCase(ConfigPropertyNames.CONNECTION_TYPES.JNDI_CONNECTION)) {
- strategy = new JEEConnection(props, factory);
+ strategy = new JEEConnection(props, configprops.getDataSourceFactory());
System.out.println("Created JEE Strategy");
}
@@ -59,7 +58,7 @@
//NOTE: to run this test to validate the DataSourceMgr, do the following:
// --- need 3 datasources, Oracle, SqlServer and 1 other
- ConfigPropertyLoader config = ConfigPropertyLoader.createInstance();
+ ConfigPropertyLoader config = ConfigPropertyLoader.getInstance();
new DataSourceFactory(config);
Modified: trunk/test-integration/db/src/main/java/org/teiid/test/framework/datasource/DataSourceFactory.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/framework/datasource/DataSourceFactory.java 2009-11-24 20:15:44 UTC (rev 1588)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/datasource/DataSourceFactory.java 2009-11-25 14:17:42 UTC (rev 1589)
@@ -120,7 +120,7 @@
public DataSourceFactory(ConfigPropertyLoader config) {
- this.configprops = PropertiesUtils.clone(config.getProperties());
+ this.configprops = PropertiesUtils.clone(config.getProperties(), null, true);
this.requiredDataBaseTypes = config.getModelAssignedDatabaseTypes();
config();
}
@@ -191,11 +191,12 @@
String dssName = it.next();
ds = availDatasources.get(dssName);
- if (!excludedDBTypes.contains(ds.getDBType())) {
+ if (ds != null && !excludedDBTypes.contains(ds.getDBType())) {
useDS.put(String.valueOf(i), dssName);
availDS.put(dssName, ds);
+ System.out.println("Using ds: " + dssName);
}
}
@@ -222,7 +223,7 @@
- if (requiredDataBaseTypes != null) {
+ if (requiredDataBaseTypes != null && requiredDataBaseTypes.size() > 0) {
this.hasRequiredDBTypes = true;
Iterator<String> rit = this.requiredDataBaseTypes.keySet().iterator();
@@ -312,7 +313,7 @@
}
- } if (useDS != null) {
+ } else if (useDS != null) {
String dsname = useDS.get(datasourceid);
if (dsname != null) {
ds = availDS.get(dsname);
@@ -386,6 +387,7 @@
public void cleanup() {
+ dsmgr.clear();
assignedDataSources.clear();
requiredDataBaseTypes.clear();
@@ -398,7 +400,7 @@
//NOTE: to run this test to validate the DataSourceMgr, do the following:
// --- need 3 datasources, Oracle, SqlServer and 1 other
- ConfigPropertyLoader config = ConfigPropertyLoader.createInstance();
+ ConfigPropertyLoader config = ConfigPropertyLoader.getInstance();
DataSourceFactory factory = new DataSourceFactory(config);
@@ -413,10 +415,12 @@
}
factory.cleanup();
+
+ ConfigPropertyLoader.cleanup();
// the following verifies that order of "use" datasources is applied to request for datasources.
- config = ConfigPropertyLoader.createInstance();
+ config = ConfigPropertyLoader.getInstance();
config.setProperty(ConfigPropertyNames.USE_DATASOURCES_PROP, "oracle,sqlserver");
@@ -455,8 +459,10 @@
// returned (excluded)
factory.cleanup();
+ ConfigPropertyLoader.cleanup();
- config = ConfigPropertyLoader.createInstance();
+
+ config = ConfigPropertyLoader.getInstance();
config.setProperty(ConfigPropertyNames.EXCLUDE_DATASBASE_TYPES_PROP, "sqlserver");
@@ -488,11 +494,13 @@
factory.cleanup();
+ ConfigPropertyLoader.cleanup();
+
// test required database types
// test 1 source
- config = ConfigPropertyLoader.createInstance();
+ config = ConfigPropertyLoader.getInstance();
config.setModelAssignedToDatabaseType("pm1", DataSourceFactory.DataBaseTypes.ORACLE);
@@ -506,9 +514,11 @@
System.out.println("Test1 Required DS1 " + ds1.getDBType());
factory.cleanup();
+ ConfigPropertyLoader.cleanup();
+
// test required database types
// test 2 sources, 1 required and other ANY
- config = ConfigPropertyLoader.createInstance();
+ config = ConfigPropertyLoader.getInstance();
config.setModelAssignedToDatabaseType("pm2", DataSourceFactory.DataBaseTypes.SQLSERVER);
@@ -523,11 +533,12 @@
System.out.println("Test2 Required DS2 " + ds2.getDBType());
factory.cleanup();
+ ConfigPropertyLoader.cleanup();
+
-
// test required database types
// test 2 sources, 2 required
- config = ConfigPropertyLoader.createInstance();
+ config = ConfigPropertyLoader.getInstance();
config.setModelAssignedToDatabaseType("pm2", DataSourceFactory.DataBaseTypes.SQLSERVER);
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-11-24 20:15:44 UTC (rev 1588)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/datasource/DataSourceMgr.java 2009-11-25 14:17:42 UTC (rev 1589)
@@ -43,7 +43,7 @@
* When run from maven, the {@link ConfigPropertyNames#OVERRIDE_DATASOURCES_LOC} will be assigned
* to this value because of its a place holder for when a user does set the vm argument.
*/
- private static final String UNASSIGNEDDSLOC="${datasourceloc}";
+ private static final String UNASSIGNEDDSLOC="${";
private Map<String, DataSource> allDatasourcesMap = new HashMap<String, DataSource>(); // key
// =
@@ -93,6 +93,10 @@
}
return null;
}
+
+ void clear() {
+ modelToDatasourceMap.clear();
+ }
public void setDataSource(String modelName, DataSource ds) {
modelToDatasourceMap.put(modelName, ds);
@@ -100,10 +104,13 @@
private void loadDataSourceMappings() throws QueryTestFailedException {
- String dsloc = ConfigPropertyLoader.createInstance().getProperty(ConfigPropertyNames.OVERRIDE_DATASOURCES_LOC);
+ String dsloc = ConfigPropertyLoader.getInstance().getProperty(ConfigPropertyNames.OVERRIDE_DATASOURCES_LOC);
- if (dsloc == null || dsloc.equalsIgnoreCase(UNASSIGNEDDSLOC)) {
+ if (dsloc == null || dsloc.indexOf(UNASSIGNEDDSLOC) > -1) {
dsloc = DEFAULT_DATASOURCES_LOC;
+ System.out.println("Using default datasource loc: " +dsloc);
+ } else {
+ System.out.println("Using override for datasources loc: " + dsloc);
}
File[] dirs = findAllChildDirectories(dsloc);
Modified: trunk/test-integration/db/src/main/java/org/teiid/test/framework/datasource/DataStore.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/framework/datasource/DataStore.java 2009-11-24 20:15:44 UTC (rev 1588)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/datasource/DataStore.java 2009-11-25 14:17:42 UTC (rev 1589)
@@ -7,6 +7,7 @@
import java.sql.Connection;
import java.sql.Statement;
+import org.teiid.test.framework.ConfigPropertyLoader;
import org.teiid.test.framework.connection.ConnectionStrategy;
import org.teiid.test.framework.exception.QueryTestFailedException;
@@ -22,6 +23,8 @@
* @param connStrategy
*/
public static void initialize(ConnectionStrategy connStrategy) {
+// ConfigPropertyLoader.cleanup();
+// ConfigPropertyLoader.getInstance();
try {
load(getConnection("pm1", connStrategy));
14 years, 10 months