[teiid-commits] teiid SVN: r3124 - trunk/test-integration/common/src/test/java/org/teiid/transport.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Wed Apr 27 10:54:53 EDT 2011


Author: shawkins
Date: 2011-04-27 10:54:53 -0400 (Wed, 27 Apr 2011)
New Revision: 3124

Modified:
   trunk/test-integration/common/src/test/java/org/teiid/transport/TestODBCSocketTransport.java
Log:
TEIID-1176 further refinement of odbc handling.  messages are queued and extended queries will properly handle error conditions

Modified: trunk/test-integration/common/src/test/java/org/teiid/transport/TestODBCSocketTransport.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/transport/TestODBCSocketTransport.java	2011-04-27 01:26:25 UTC (rev 3123)
+++ trunk/test-integration/common/src/test/java/org/teiid/transport/TestODBCSocketTransport.java	2011-04-27 14:54:53 UTC (rev 3124)
@@ -29,6 +29,7 @@
 import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
+import java.sql.SQLException;
 import java.sql.Statement;
 import java.util.Properties;
 
@@ -142,6 +143,25 @@
 		TestMMDatabaseMetaData.compareResultSet(rs);
 	}	
 	
+	@Test public void testPreparedError() throws Exception {
+		PreparedStatement stmt = conn.prepareStatement("select cast(? as integer)");
+		stmt.setString(1, "a");
+		try {
+			stmt.executeQuery();
+		} catch (SQLException e) {
+			assertTrue(e.getMessage().contains("Error converting"));
+		}
+	}
+	
+	@Test public void testPreparedError1() throws Exception {
+		PreparedStatement stmt = conn.prepareStatement("select");
+		try {
+			stmt.executeQuery();
+		} catch (SQLException e) {
+			assertTrue(e.getMessage().contains("Parsing error"));
+		}
+	}
+	
 	@Test public void testEscapedLiteral() throws Exception {
 		Statement stmt = conn.createStatement();
 		ResultSet rs = stmt.executeQuery("select E'\\n\\thello pg'");



More information about the teiid-commits mailing list