Author: vhalbert(a)redhat.com
Date: 2009-12-15 14:23:10 -0500 (Tue, 15 Dec 2009)
New Revision: 1668
Modified:
trunk/test-integration/db/src/main/java/org/teiid/test/client/ctc/XMLExpectedResults.java
trunk/test-integration/db/src/main/java/org/teiid/test/framework/TestLogger.java
trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/DataSourceConnection.java
trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/DriverConnection.java
Log:
Teiid 781 - removed using the connection proxy because it interfers with the integration
tests, also fixed the logger and changed the expected results to support specifying that
there are no rows expected for a query.
Modified:
trunk/test-integration/db/src/main/java/org/teiid/test/client/ctc/XMLExpectedResults.java
===================================================================
---
trunk/test-integration/db/src/main/java/org/teiid/test/client/ctc/XMLExpectedResults.java 2009-12-15
17:41:34 UTC (rev 1667)
+++
trunk/test-integration/db/src/main/java/org/teiid/test/client/ctc/XMLExpectedResults.java 2009-12-15
19:23:10 UTC (rev 1668)
@@ -183,16 +183,19 @@
// printResultSet(results));
// Convert results to ResultsHolder
- actualResults = new ResultsHolder(TagNames.Elements.QUERY_RESULTS);
- actualResults.setQueryID(expectedResults.getQueryID());
- convertResults(resultSet, batchSize, actualResults);
+ if (expectedResults.getRows().size() > 0) {
+ actualResults = new ResultsHolder(TagNames.Elements.QUERY_RESULTS);
+ actualResults.setQueryID(expectedResults.getQueryID());
+ convertResults(resultSet, batchSize, actualResults);
+ compareResults(actualResults, expectedResults, eMsg, isOrdered);
+ }
// DEBUG:
// debugOut.println("*** Actual Results (holder): " +
// actualResults);
// Compare expected results with actual results, record by record
- compareResults(actualResults, expectedResults, eMsg, isOrdered);
+
break;
Modified:
trunk/test-integration/db/src/main/java/org/teiid/test/framework/TestLogger.java
===================================================================
---
trunk/test-integration/db/src/main/java/org/teiid/test/framework/TestLogger.java 2009-12-15
17:41:34 UTC (rev 1667)
+++
trunk/test-integration/db/src/main/java/org/teiid/test/framework/TestLogger.java 2009-12-15
19:23:10 UTC (rev 1668)
@@ -24,6 +24,10 @@
import java.util.logging.Level;
import java.util.logging.Logger;
+import org.apache.log4j.BasicConfigurator;
+import org.apache.log4j.ConsoleAppender;
+
+
/**
* @author vanhalbert
*
@@ -34,10 +38,13 @@
public static final Level DEBUG = Level.FINEST;
public static final Level IMPORTANT = Level.FINE;
- private static final Logger LOGGER = Logger.getLogger("org.teiid.test");
+ private static final Logger LOGGER = Logger.getLogger("org.teiid.test");
static {
- LOGGER.setLevel(IMPORTANT);
+ BasicConfigurator.configure(new ConsoleAppender());
+
+ LOGGER.setLevel(INFO);
+
}
public static final void setLogLevel(Level level) {
@@ -45,16 +52,16 @@
}
public static final void logDebug(String msg) {
- log(Level.FINEST, msg, null);
+ log(Level.ALL, msg, null);
}
public static final void logDebug(String msg, Throwable t) {
- log(Level.FINEST, msg, t);
+ log(Level.ALL, msg, t);
}
// info related messages, which
public static final void logInfo(String msg) {
- log(Level.FINER, msg, null);
+ log(Level.INFO, msg, null);
}
// configuration related messages
@@ -64,12 +71,13 @@
// most important messages
public static final void log(String msg) {
- log(Level.FINE, msg, null);
+ log(Level.INFO, msg, null);
}
private static final void log(Level javaLevel, Object msg, Throwable t) {
+// System.out.println(msg);
+ if (LOGGER.isLoggable(javaLevel)) {
- if (LOGGER.isLoggable(javaLevel)) {
LOGGER.log(javaLevel, msg.toString(), t);
}
}
Modified:
trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/DataSourceConnection.java
===================================================================
---
trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/DataSourceConnection.java 2009-12-15
17:41:34 UTC (rev 1667)
+++
trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/DataSourceConnection.java 2009-12-15
19:23:10 UTC (rev 1668)
@@ -134,9 +134,6 @@
ClassNotFoundException {
TestLogger.log("Creating Datasource Connection: \"" + this.serverName +
" - " + this.databaseName + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- // DataSource dataSource =
(DataSource)Class.forName(props.getProperty(prefix+DS_DRIVER)).newInstance();
-
-
DataSource ds = (DataSource)Class.forName(this.driver).newInstance();
if (ds instanceof BaseDataSource) {
Modified:
trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/DriverConnection.java
===================================================================
---
trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/DriverConnection.java 2009-12-15
17:41:34 UTC (rev 1667)
+++
trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/DriverConnection.java 2009-12-15
19:23:10 UTC (rev 1668)
@@ -125,9 +125,10 @@
conn = DriverManager.getConnection(url);
}
- conn =
(Connection)Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), new
Class[] {java.sql.Connection.class}, new CloseInterceptor(conn));
+// if (this.useProxy()) {
+// conn =
(Connection)Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), new
Class[] {java.sql.Connection.class}, new CloseInterceptor(conn));
+// }
-
// } catch (SQLException e) {
} catch (Throwable t) {