Author: vhalbert(a)redhat.com
Date: 2009-09-18 13:09:52 -0400 (Fri, 18 Sep 2009)
New Revision: 1370
Modified:
trunk/client-jdbc/src/test/java/com/metamatrix/jdbc/api/AbstractQueryTest.java
Log:
Teiid 773 - organize integration test - the change to AbstractQueryTest is to allow for
comparing results in a case insensitive manner. This is needed because different
databases return values in all uppercase and in others in lowercase.
Modified: trunk/client-jdbc/src/test/java/com/metamatrix/jdbc/api/AbstractQueryTest.java
===================================================================
---
trunk/client-jdbc/src/test/java/com/metamatrix/jdbc/api/AbstractQueryTest.java 2009-09-18
17:05:35 UTC (rev 1369)
+++
trunk/client-jdbc/src/test/java/com/metamatrix/jdbc/api/AbstractQueryTest.java 2009-09-18
17:09:52 UTC (rev 1370)
@@ -109,7 +109,7 @@
assertNotNull(this.internalConnection);
assertTrue(!this.internalConnection.isClosed());
boolean result = false;
- if (params != null) {
+ if (params != null && params.length > 0) {
if (sql.startsWith("exec ")) { //$NON-NLS-1$
sql = sql.substring(5);
this.internalStatement =
this.internalConnection.prepareCall("{?=call "+sql+"}"); //$NON-NLS-1$
//$NON-NLS-2$
@@ -359,12 +359,12 @@
}
}
- static String read(BufferedReader r) throws IOException {
+ protected static String read(BufferedReader r, boolean casesensitive) throws
IOException {
StringBuffer result = new StringBuffer();
String s = null;
try {
while ((s = r.readLine()) != null) {
- result.append(s.trim());
+ result.append( (casesensitive ? s.trim() : s.trim().toLowerCase()) );
result.append("\n"); //$NON-NLS-1$
}
} finally {
@@ -373,8 +373,8 @@
return result.toString();
}
- void compareResults(BufferedReader resultReader, BufferedReader expectedReader)
throws IOException {
- assertEquals(read(expectedReader), read(resultReader));
+ protected void compareResults(BufferedReader resultReader, BufferedReader
expectedReader) throws IOException {
+ assertEquals(read(expectedReader, true) , read(resultReader, true));
}
public void printResults() {
Show replies by date