[teiid-commits] teiid SVN: r1378 - in trunk/test-integration/db/src/test/java/org/teiid/test: testcases and 1 other directory.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Fri Sep 18 13:49:42 EDT 2009


Author: vhalbert at redhat.com
Date: 2009-09-18 13:49:42 -0400 (Fri, 18 Sep 2009)
New Revision: 1378

Modified:
   trunk/test-integration/db/src/test/java/org/teiid/test/framework/AbstractQueryTransactionTest.java
   trunk/test-integration/db/src/test/java/org/teiid/test/testcases/TwoSourceTransactionTest.java
Log:
Teiid 773 - organize integration test

Modified: trunk/test-integration/db/src/test/java/org/teiid/test/framework/AbstractQueryTransactionTest.java
===================================================================
--- trunk/test-integration/db/src/test/java/org/teiid/test/framework/AbstractQueryTransactionTest.java	2009-09-18 17:49:14 UTC (rev 1377)
+++ trunk/test-integration/db/src/test/java/org/teiid/test/framework/AbstractQueryTransactionTest.java	2009-09-18 17:49:42 UTC (rev 1378)
@@ -4,8 +4,12 @@
  */
 package org.teiid.test.framework;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 
+import java.io.BufferedReader;
+import java.io.IOException;
 import java.sql.Statement;
 import java.util.Properties;
 
@@ -50,6 +54,10 @@
        	assertNotNull(props);
         this.executionProperties = props;        
     }
+    @Override
+    protected void compareResults(BufferedReader resultReader, BufferedReader expectedReader) throws IOException {
+    	assertEquals(read(expectedReader, compareResultsCaseSensitive()) , read(resultReader, compareResultsCaseSensitive()));
+    }
     
     @Override protected void assignExecutionProperties(Statement stmt) {
         if (this.executionProperties != null) {  
@@ -57,8 +65,7 @@
                 com.metamatrix.jdbc.api.Statement statement = (com.metamatrix.jdbc.api.Statement)stmt;
                 String txnautowrap = this.executionProperties.getProperty(ExecutionProperties.PROP_TXN_AUTO_WRAP);
                 if (txnautowrap != null) {
-                	System.out.println("txnAutoWrap: " + txnautowrap);
-                    statement.setExecutionProperty(ExecutionProperties.PROP_TXN_AUTO_WRAP, txnautowrap);
+                     statement.setExecutionProperty(ExecutionProperties.PROP_TXN_AUTO_WRAP, txnautowrap);
                 }
                 
                 if (this.executionProperties.getProperty(ExecutionProperties.PROP_FETCH_SIZE) != null) {
@@ -73,6 +80,9 @@
     	return 1;
     }
     
+    public boolean compareResultsCaseSensitive() {
+    	return true;
+    }
 
 	@Override
 	public void setupDataSource() {

Modified: trunk/test-integration/db/src/test/java/org/teiid/test/testcases/TwoSourceTransactionTest.java
===================================================================
--- trunk/test-integration/db/src/test/java/org/teiid/test/testcases/TwoSourceTransactionTest.java	2009-09-18 17:49:14 UTC (rev 1377)
+++ trunk/test-integration/db/src/test/java/org/teiid/test/testcases/TwoSourceTransactionTest.java	2009-09-18 17:49:42 UTC (rev 1378)
@@ -4,11 +4,13 @@
  */
 package org.teiid.test.testcases;
 
+import java.sql.Connection;
 import java.sql.SQLException;
 import java.util.ArrayList;
 
 import org.teiid.test.framework.AbstractQueryTransactionTest;
 import org.teiid.test.framework.QueryExecution;
+import org.teiid.test.framework.datasource.DataSource;
 
 import com.metamatrix.jdbc.api.AbstractQueryTest;
 
@@ -187,7 +189,9 @@
           	public void validateTestCase() throws Exception {
                 
                 // now verify the results
-                AbstractQueryTest test = new QueryExecution(getSource("pm1"));
+          		Connection ds = getSource("pm1");
+          		System.out.println("Datasource: " + ds.getMetaData().getDatabaseProductName());
+                AbstractQueryTest test = new QueryExecution(ds);
                 test.execute("select * from g1 where e1 >= 100 and e1 < 112");
                 test.assertRowCount(12);
                 test.closeConnection();
@@ -283,6 +287,12 @@
             public int getNumberRequiredDataSources(){
             	return 2;
             }
+            
+            // because different databases return "varchar" in all caps "VARCHAR"
+            // the comparison is being done in a noncasesensitive manner
+            public boolean compareResultsCaseSensitive() {
+            	return false;
+            }
              
          	public void validateTestCase() throws Exception {
 
@@ -293,7 +303,10 @@
                 test.execute("select * from g2 where e1 >= 100 and e1 < 115");
                 test.assertRowCount(15);
                 test.execute("select distinct e2 from g1 where e1 > 100");
-                test.assertResultsSetEquals(new String[] {"e2[VARCHAR]", "blah"});
+                
+ //               assertResultsSetEquals(this.internalResultSet., new String[] {"e2[varchar]", "blah"});
+                
+                test.assertResultsSetEquals(new String[] {"e2[varchar]", "blah"});
                 test.closeConnection();  
          	}
  



More information about the teiid-commits mailing list