Index: pom.xml
===================================================================
--- pom.xml
+++ pom.xml
@@ -28,6 +28,7 @@
search-model
search-util
search-tool/tool
+ search-test
@@ -46,6 +47,7 @@
search-model
search-util
search-tool/tool
+ search-test
Index: search-impl/impl/pom.xml
===================================================================
--- search-impl/impl/pom.xml
+++ search-impl/impl/pom.xml
@@ -16,6 +16,36 @@
3.5-beta6
+
+
+ 1.5
+
+ 1.5
+
+
+
+ org.sakaiproject
+ sakai-search-test-1.5
+ ${project.version}
+ test
+
+
+
+
+ 1.6
+
+ 1.6
+
+
+
+ org.sakaiproject
+ sakai-search-test-1.6
+ ${project.version}
+ test
+
+
+
+
Index: search-impl/impl/src/test/org/sakaiproject/search/index/soaktest/SharedTestDataSource.java
===================================================================
--- search-impl/impl/src/test/org/sakaiproject/search/index/soaktest/SharedTestDataSource.java
+++ search-impl/impl/src/test/org/sakaiproject/search/index/soaktest/SharedTestDataSource.java
@@ -21,14 +21,9 @@
package org.sakaiproject.search.index.soaktest;
-import java.io.PrintWriter;
-import java.sql.CallableStatement;
import java.sql.Connection;
-import java.sql.DatabaseMetaData;
import java.sql.PreparedStatement;
import java.sql.SQLException;
-import java.sql.SQLWarning;
-import java.sql.Savepoint;
import java.sql.Statement;
import java.sql.Timestamp;
import java.util.Map;
@@ -40,6 +35,8 @@ import org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS;
import org.apache.commons.dbcp.datasources.SharedPoolDataSource;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.sakaiproject.search.jdbc.WrappingConnection;
+import org.sakaiproject.search.jdbc.WrappingDataSource;
import org.sakaiproject.search.model.SearchBuilderItem;
/**
@@ -116,10 +113,8 @@ public class SharedTestDataSource
tds.setMaxWait(5);
tds.setDefaultAutoCommit(false);
- wds = new DataSource()
+ wds = new WrappingDataSource(tds)
{
-
-
public Connection getConnection() throws SQLException
{
final Connection c = tds.getConnection();
@@ -138,14 +133,9 @@ public class SharedTestDataSource
if ( sb.length() > 0 ) {
log.warn("Older Connections found, possible connection leak "+sb.toString()+"\n");
}
- return new Connection()
+ return new WrappingConnection(c)
{
- public void clearWarnings() throws SQLException
- {
- c.clearWarnings();
- }
-
public void close() throws SQLException
{
connections.remove(c);
@@ -158,233 +148,9 @@ public class SharedTestDataSource
}
- public void commit() throws SQLException
- {
- c.commit();
- }
-
- public Statement createStatement() throws SQLException
- {
-
- return c.createStatement();
- }
-
- public Statement createStatement(int resultSetType,
- int resultSetConcurrency) throws SQLException
- {
- return c.createStatement(resultSetType, resultSetConcurrency);
- }
-
- public Statement createStatement(int resultSetType,
- int resultSetConcurrency, int resultSetHoldability)
- throws SQLException
- {
- return c.createStatement(resultSetType, resultSetConcurrency,
- resultSetHoldability);
- }
-
- public boolean getAutoCommit() throws SQLException
- {
- return c.getAutoCommit();
- }
-
- public String getCatalog() throws SQLException
- {
- return c.getCatalog();
- }
-
- public int getHoldability() throws SQLException
- {
- return c.getHoldability();
- }
-
- public DatabaseMetaData getMetaData() throws SQLException
- {
- return c.getMetaData();
- }
-
- public int getTransactionIsolation() throws SQLException
- {
- return c.getTransactionIsolation();
- }
-
- public Map> getTypeMap() throws SQLException
- {
- return c.getTypeMap();
- }
-
- public SQLWarning getWarnings() throws SQLException
- {
- return c.getWarnings();
- }
-
- public boolean isClosed() throws SQLException
- {
- return c.isClosed();
- }
-
- public boolean isReadOnly() throws SQLException
- {
- return c.isReadOnly();
- }
-
- public String nativeSQL(String sql) throws SQLException
- {
- return c.nativeSQL(sql);
- }
-
- public CallableStatement prepareCall(String sql) throws SQLException
- {
- return c.prepareCall(sql);
- }
-
- public CallableStatement prepareCall(String sql, int resultSetType,
- int resultSetConcurrency) throws SQLException
- {
- return c.prepareCall(sql, resultSetType, resultSetConcurrency);
- }
-
- public CallableStatement prepareCall(String sql, int resultSetType,
- int resultSetConcurrency, int resultSetHoldability)
- throws SQLException
- {
- return c.prepareCall(sql, resultSetType, resultSetConcurrency,
- resultSetHoldability);
- }
-
- public PreparedStatement prepareStatement(String sql)
- throws SQLException
- {
- return c.prepareStatement(sql);
- }
-
- public PreparedStatement prepareStatement(String sql,
- int autoGeneratedKeys) throws SQLException
- {
- return c.prepareStatement(sql, autoGeneratedKeys);
- }
-
- public PreparedStatement prepareStatement(String sql,
- int[] columnIndexes) throws SQLException
- {
- return c.prepareStatement(sql, columnIndexes);
- }
-
- public PreparedStatement prepareStatement(String sql,
- String[] columnNames) throws SQLException
- {
- return c.prepareStatement(sql, columnNames);
- }
-
- public PreparedStatement prepareStatement(String sql,
- int resultSetType, int resultSetConcurrency)
- throws SQLException
- {
- return c.prepareStatement(sql, resultSetType,
- resultSetConcurrency);
- }
-
- public PreparedStatement prepareStatement(String sql,
- int resultSetType, int resultSetConcurrency,
- int resultSetHoldability) throws SQLException
- {
- return c.prepareStatement(sql, resultSetType,
- resultSetConcurrency, resultSetHoldability);
- }
-
- public void releaseSavepoint(Savepoint savepoint) throws SQLException
- {
- c.releaseSavepoint(savepoint);
- }
-
- public void rollback() throws SQLException
- {
- c.rollback();
-
- }
-
- public void rollback(Savepoint savepoint) throws SQLException
- {
- c.rollback(savepoint);
-
- }
-
- public void setAutoCommit(boolean autoCommit) throws SQLException
- {
- c.setAutoCommit(autoCommit);
-
- }
-
- public void setCatalog(String catalog) throws SQLException
- {
- c.setCatalog(catalog);
-
- }
-
- public void setHoldability(int holdability) throws SQLException
- {
- c.setHoldability(holdability);
-
- }
-
- public void setReadOnly(boolean readOnly) throws SQLException
- {
- c.setReadOnly(readOnly);
-
- }
-
- public Savepoint setSavepoint() throws SQLException
- {
- return c.setSavepoint();
- }
-
- public Savepoint setSavepoint(String name) throws SQLException
- {
- return c.setSavepoint(name);
- }
-
- public void setTransactionIsolation(int level) throws SQLException
- {
- c.setTransactionIsolation(level);
-
- }
-
- public void setTypeMap(Map> map) throws SQLException
- {
- c.setTypeMap(map);
-
- }
-
};
}
- public Connection getConnection(String username, String password)
- throws SQLException
- {
- return tds.getConnection(username, password);
- }
-
- public PrintWriter getLogWriter() throws SQLException
- {
- return tds.getLogWriter();
- }
-
- public int getLoginTimeout() throws SQLException
- {
- // TODO Auto-generated method stub
- return tds.getLoginTimeout();
- }
-
- public void setLogWriter(PrintWriter out) throws SQLException
- {
- tds.setLogWriter(out);
- }
-
- public void setLoginTimeout(int seconds) throws SQLException
- {
- tds.setLoginTimeout(seconds);
- }
-
};
Connection connection = tds.getConnection();
Index: search-impl/impl/src/test/org/sakaiproject/search/indexer/impl/test/TDataSource.java
===================================================================
--- search-impl/impl/src/test/org/sakaiproject/search/indexer/impl/test/TDataSource.java
+++ search-impl/impl/src/test/org/sakaiproject/search/indexer/impl/test/TDataSource.java
@@ -21,14 +21,9 @@
package org.sakaiproject.search.indexer.impl.test;
-import java.io.PrintWriter;
-import java.sql.CallableStatement;
import java.sql.Connection;
-import java.sql.DatabaseMetaData;
import java.sql.PreparedStatement;
import java.sql.SQLException;
-import java.sql.SQLWarning;
-import java.sql.Savepoint;
import java.sql.Statement;
import java.sql.Timestamp;
import java.util.ArrayList;
@@ -49,6 +44,8 @@ import org.apache.lucene.search.Hits;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.TermQuery;
import org.sakaiproject.search.api.SearchService;
+import org.sakaiproject.search.jdbc.WrappingConnection;
+import org.sakaiproject.search.jdbc.WrappingDataSource;
import org.sakaiproject.search.model.SearchBuilderItem;
import org.sakaiproject.search.model.impl.SearchBuilderItemImpl;
@@ -67,8 +64,9 @@ public class TDataSource
private DriverAdapterCPDS cpds;
- public TDataSource(int poolSize, final boolean logging) throws Exception
- {
+ public TDataSource(int poolSize, final boolean logging) throws Exception {
+ super();
+
cpds = new DriverAdapterCPDS();
/*
* try { // can we test against mysql
@@ -94,261 +92,29 @@ public class TDataSource
tds.setMaxWait(5);
tds.setDefaultAutoCommit(false);
- wds = new DataSource()
- {
-
- public Connection getConnection() throws SQLException
- {
- final Connection c = tds.getConnection();
+ wds = new WrappingDataSource(tds) {
+
+ public Connection getConnection() throws SQLException {
+ final Connection c = super.getConnection();
nopen++;
if (logging) log.info("+++++++++++Opened " + nopen);
Exception ex = new Exception();
StackTraceElement[] ste = ex.getStackTrace();
log.debug("Stack Trace " + ste[1].toString());
- return new Connection()
- {
-
- public void clearWarnings() throws SQLException
- {
- c.clearWarnings();
- }
+ return new WrappingConnection(c) {
public void close() throws SQLException
{
c.close();
nopen--;
if (logging) log.info("--------------Closed " + nopen);
-
}
-
- public void commit() throws SQLException
- {
- c.commit();
- }
-
- public Statement createStatement() throws SQLException
- {
-
- return c.createStatement();
- }
-
- public Statement createStatement(int resultSetType,
- int resultSetConcurrency) throws SQLException
- {
- return c.createStatement(resultSetType, resultSetConcurrency);
- }
-
- public Statement createStatement(int resultSetType,
- int resultSetConcurrency, int resultSetHoldability)
- throws SQLException
- {
- return c.createStatement(resultSetType, resultSetConcurrency,
- resultSetHoldability);
- }
-
- public boolean getAutoCommit() throws SQLException
- {
- return c.getAutoCommit();
- }
-
- public String getCatalog() throws SQLException
- {
- return c.getCatalog();
- }
-
- public int getHoldability() throws SQLException
- {
- return c.getHoldability();
- }
-
- public DatabaseMetaData getMetaData() throws SQLException
- {
- return c.getMetaData();
- }
-
- public int getTransactionIsolation() throws SQLException
- {
- return c.getTransactionIsolation();
- }
-
- public Map> getTypeMap() throws SQLException
- {
- return c.getTypeMap();
- }
-
- public SQLWarning getWarnings() throws SQLException
- {
- return c.getWarnings();
- }
-
- public boolean isClosed() throws SQLException
- {
- return c.isClosed();
- }
-
- public boolean isReadOnly() throws SQLException
- {
- return c.isReadOnly();
- }
-
- public String nativeSQL(String sql) throws SQLException
- {
- return c.nativeSQL(sql);
- }
-
- public CallableStatement prepareCall(String sql) throws SQLException
- {
- return c.prepareCall(sql);
- }
-
- public CallableStatement prepareCall(String sql, int resultSetType,
- int resultSetConcurrency) throws SQLException
- {
- return c.prepareCall(sql, resultSetType, resultSetConcurrency);
- }
-
- public CallableStatement prepareCall(String sql, int resultSetType,
- int resultSetConcurrency, int resultSetHoldability)
- throws SQLException
- {
- return c.prepareCall(sql, resultSetType, resultSetConcurrency,
- resultSetHoldability);
- }
-
- public PreparedStatement prepareStatement(String sql)
- throws SQLException
- {
- return c.prepareStatement(sql);
- }
-
- public PreparedStatement prepareStatement(String sql,
- int autoGeneratedKeys) throws SQLException
- {
- return c.prepareStatement(sql, autoGeneratedKeys);
- }
-
- public PreparedStatement prepareStatement(String sql,
- int[] columnIndexes) throws SQLException
- {
- return c.prepareStatement(sql, columnIndexes);
- }
-
- public PreparedStatement prepareStatement(String sql,
- String[] columnNames) throws SQLException
- {
- return c.prepareStatement(sql, columnNames);
- }
-
- public PreparedStatement prepareStatement(String sql,
- int resultSetType, int resultSetConcurrency)
- throws SQLException
- {
- return c.prepareStatement(sql, resultSetType,
- resultSetConcurrency);
- }
-
- public PreparedStatement prepareStatement(String sql,
- int resultSetType, int resultSetConcurrency,
- int resultSetHoldability) throws SQLException
- {
- return c.prepareStatement(sql, resultSetType,
- resultSetConcurrency, resultSetHoldability);
- }
-
- public void releaseSavepoint(Savepoint savepoint) throws SQLException
- {
- c.releaseSavepoint(savepoint);
- }
-
- public void rollback() throws SQLException
- {
- c.rollback();
-
- }
-
- public void rollback(Savepoint savepoint) throws SQLException
- {
- c.rollback(savepoint);
-
- }
-
- public void setAutoCommit(boolean autoCommit) throws SQLException
- {
- c.setAutoCommit(autoCommit);
-
- }
-
- public void setCatalog(String catalog) throws SQLException
- {
- c.setCatalog(catalog);
-
- }
-
- public void setHoldability(int holdability) throws SQLException
- {
- c.setHoldability(holdability);
-
- }
-
- public void setReadOnly(boolean readOnly) throws SQLException
- {
- c.setReadOnly(readOnly);
-
- }
-
- public Savepoint setSavepoint() throws SQLException
- {
- return c.setSavepoint();
- }
-
- public Savepoint setSavepoint(String name) throws SQLException
- {
- return c.setSavepoint(name);
- }
-
- public void setTransactionIsolation(int level) throws SQLException
- {
- c.setTransactionIsolation(level);
-
- }
-
- public void setTypeMap(Map> map) throws SQLException
- {
- c.setTypeMap(map);
-
- }
-
+
};
}
-
- public Connection getConnection(String username, String password)
- throws SQLException
- {
- return tds.getConnection(username, password);
- }
-
- public PrintWriter getLogWriter() throws SQLException
- {
- return tds.getLogWriter();
- }
-
- public int getLoginTimeout() throws SQLException
- {
- // TODO Auto-generated method stub
- return tds.getLoginTimeout();
- }
-
- public void setLogWriter(PrintWriter out) throws SQLException
- {
- tds.setLogWriter(out);
- }
-
- public void setLoginTimeout(int seconds) throws SQLException
- {
- tds.setLoginTimeout(seconds);
- }
-
+
};
+
Connection connection = tds.getConnection();
Statement s = connection.createStatement();
Index: search-test/pom.xml
===================================================================
--- search-test/pom.xml
+++ search-test/pom.xml
@@ -0,0 +1,36 @@
+
+
+ 4.0.0
+
+ base
+ org.sakaiproject
+ 2.7.0-SNAPSHOT
+ ../pom.xml
+
+ Sakai Search Project
+ org.sakaiproject
+ search-test
+ pom
+ This is in a separate POM to allow standard profile handling in the toplevel POM. This activates the correct test related
+ project depending on which JVM is in use.
+
+
+ 1.5
+
+ 1.5
+
+
+ test-1.5
+
+
+
+ 1.6
+
+ 1.6
+
+
+ test-1.6
+
+
+
+
Index: search-test/test-1.5/pom.xml
===================================================================
--- search-test/test-1.5/pom.xml
+++ search-test/test-1.5/pom.xml
@@ -0,0 +1,26 @@
+
+
+ 4.0.0
+
+ search-base
+ org.sakaiproject
+ 2.7.0-SNAPSHOT
+ ../../pom.xml
+
+ sakai-search-test-1.5
+ org.sakaiproject
+ sakai-search-test-1.5
+ jar
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+
+
+ 1.5
+
+
+
+
+
Index: search-test/test-1.5/src/java/org/sakaiproject/search/jdbc/WrappingConnection.java
===================================================================
--- search-test/test-1.5/src/java/org/sakaiproject/search/jdbc/WrappingConnection.java
+++ search-test/test-1.5/src/java/org/sakaiproject/search/jdbc/WrappingConnection.java
@@ -0,0 +1,235 @@
+/**
+ *
+ */
+package org.sakaiproject.search.jdbc;
+
+import java.sql.Array;
+import java.sql.Blob;
+import java.sql.CallableStatement;
+import java.sql.Clob;
+import java.sql.Connection;
+import java.sql.DatabaseMetaData;
+import java.sql.PreparedStatement;
+import java.sql.SQLException;
+import java.sql.SQLWarning;
+import java.sql.Savepoint;
+import java.sql.Statement;
+import java.sql.Struct;
+import java.util.Map;
+import java.util.Properties;
+
+public class WrappingConnection implements Connection {
+ private final Connection c;
+
+ public WrappingConnection(Connection c) {
+ this.c = c;
+ }
+
+ public void close() throws SQLException
+ {
+ c.close();
+ }
+
+ public void clearWarnings() throws SQLException
+ {
+ c.clearWarnings();
+ }
+
+ public void commit() throws SQLException
+ {
+ c.commit();
+ }
+
+ public Statement createStatement() throws SQLException
+ {
+
+ return c.createStatement();
+ }
+
+ public Statement createStatement(int resultSetType,
+ int resultSetConcurrency) throws SQLException
+ {
+ return c.createStatement(resultSetType, resultSetConcurrency);
+ }
+
+ public Statement createStatement(int resultSetType,
+ int resultSetConcurrency, int resultSetHoldability)
+ throws SQLException
+ {
+ return c.createStatement(resultSetType, resultSetConcurrency,
+ resultSetHoldability);
+ }
+
+ public boolean getAutoCommit() throws SQLException
+ {
+ return c.getAutoCommit();
+ }
+
+ public String getCatalog() throws SQLException
+ {
+ return c.getCatalog();
+ }
+
+ public int getHoldability() throws SQLException
+ {
+ return c.getHoldability();
+ }
+
+ public DatabaseMetaData getMetaData() throws SQLException
+ {
+ return c.getMetaData();
+ }
+
+ public int getTransactionIsolation() throws SQLException
+ {
+ return c.getTransactionIsolation();
+ }
+
+ public Map> getTypeMap() throws SQLException
+ {
+ return c.getTypeMap();
+ }
+
+ public SQLWarning getWarnings() throws SQLException
+ {
+ return c.getWarnings();
+ }
+
+ public boolean isClosed() throws SQLException
+ {
+ return c.isClosed();
+ }
+
+ public boolean isReadOnly() throws SQLException
+ {
+ return c.isReadOnly();
+ }
+
+ public String nativeSQL(String sql) throws SQLException
+ {
+ return c.nativeSQL(sql);
+ }
+
+ public CallableStatement prepareCall(String sql) throws SQLException
+ {
+ return c.prepareCall(sql);
+ }
+
+ public CallableStatement prepareCall(String sql, int resultSetType,
+ int resultSetConcurrency) throws SQLException
+ {
+ return c.prepareCall(sql, resultSetType, resultSetConcurrency);
+ }
+
+ public CallableStatement prepareCall(String sql, int resultSetType,
+ int resultSetConcurrency, int resultSetHoldability)
+ throws SQLException
+ {
+ return c.prepareCall(sql, resultSetType, resultSetConcurrency,
+ resultSetHoldability);
+ }
+
+ public PreparedStatement prepareStatement(String sql)
+ throws SQLException
+ {
+ return c.prepareStatement(sql);
+ }
+
+ public PreparedStatement prepareStatement(String sql,
+ int autoGeneratedKeys) throws SQLException
+ {
+ return c.prepareStatement(sql, autoGeneratedKeys);
+ }
+
+ public PreparedStatement prepareStatement(String sql,
+ int[] columnIndexes) throws SQLException
+ {
+ return c.prepareStatement(sql, columnIndexes);
+ }
+
+ public PreparedStatement prepareStatement(String sql,
+ String[] columnNames) throws SQLException
+ {
+ return c.prepareStatement(sql, columnNames);
+ }
+
+ public PreparedStatement prepareStatement(String sql,
+ int resultSetType, int resultSetConcurrency)
+ throws SQLException
+ {
+ return c.prepareStatement(sql, resultSetType,
+ resultSetConcurrency);
+ }
+
+ public PreparedStatement prepareStatement(String sql,
+ int resultSetType, int resultSetConcurrency,
+ int resultSetHoldability) throws SQLException
+ {
+ return c.prepareStatement(sql, resultSetType,
+ resultSetConcurrency, resultSetHoldability);
+ }
+
+ public void releaseSavepoint(Savepoint savepoint) throws SQLException
+ {
+ c.releaseSavepoint(savepoint);
+ }
+
+ public void rollback() throws SQLException
+ {
+ c.rollback();
+
+ }
+
+ public void rollback(Savepoint savepoint) throws SQLException
+ {
+ c.rollback(savepoint);
+
+ }
+
+ public void setAutoCommit(boolean autoCommit) throws SQLException
+ {
+ c.setAutoCommit(autoCommit);
+
+ }
+
+ public void setCatalog(String catalog) throws SQLException
+ {
+ c.setCatalog(catalog);
+
+ }
+
+ public void setHoldability(int holdability) throws SQLException
+ {
+ c.setHoldability(holdability);
+
+ }
+
+ public void setReadOnly(boolean readOnly) throws SQLException
+ {
+ c.setReadOnly(readOnly);
+
+ }
+
+ public Savepoint setSavepoint() throws SQLException
+ {
+ return c.setSavepoint();
+ }
+
+ public Savepoint setSavepoint(String name) throws SQLException
+ {
+ return c.setSavepoint(name);
+ }
+
+ public void setTransactionIsolation(int level) throws SQLException
+ {
+ c.setTransactionIsolation(level);
+
+ }
+
+ public void setTypeMap(Map> map) throws SQLException
+ {
+ c.setTypeMap(map);
+
+ }
+
+}
\ No newline at end of file
Index: search-test/test-1.5/src/java/org/sakaiproject/search/jdbc/WrappingDataSource.java
===================================================================
--- search-test/test-1.5/src/java/org/sakaiproject/search/jdbc/WrappingDataSource.java
+++ search-test/test-1.5/src/java/org/sakaiproject/search/jdbc/WrappingDataSource.java
@@ -0,0 +1,52 @@
+/**
+ *
+ */
+package org.sakaiproject.search.jdbc;
+
+import java.io.PrintWriter;
+import java.sql.Connection;
+import java.sql.SQLException;
+
+import javax.sql.DataSource;
+
+public class WrappingDataSource implements DataSource {
+
+ private DataSource wds;
+
+ public WrappingDataSource(DataSource ds)
+ {
+ wds = ds;
+ }
+
+ public Connection getConnection() throws SQLException
+ {
+ return wds.getConnection();
+ }
+
+ public Connection getConnection(String username, String password)
+ throws SQLException
+ {
+ return wds.getConnection(username, password);
+ }
+
+ public PrintWriter getLogWriter() throws SQLException
+ {
+ return wds.getLogWriter();
+ }
+
+ public int getLoginTimeout() throws SQLException
+ {
+ return wds.getLoginTimeout();
+ }
+
+ public void setLogWriter(PrintWriter out) throws SQLException
+ {
+ wds.setLogWriter(out);
+ }
+
+ public void setLoginTimeout(int seconds) throws SQLException
+ {
+ wds.setLoginTimeout(seconds);
+ }
+
+}
\ No newline at end of file
Index: search-test/test-1.6/pom.xml
===================================================================
--- search-test/test-1.6/pom.xml
+++ search-test/test-1.6/pom.xml
@@ -0,0 +1,26 @@
+
+
+ 4.0.0
+
+ search-base
+ org.sakaiproject
+ 2.7.0-SNAPSHOT
+ ../../pom.xml
+
+ sakai-search-test-1.6
+ org.sakaiproject
+ sakai-search-test-1.6
+ jar
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+
+
+ 1.6
+
+
+
+
+
Index: search-test/test-1.6/src/java/org/sakaiproject/search/jdbc/WrappingConnection.java
===================================================================
--- search-test/test-1.6/src/java/org/sakaiproject/search/jdbc/WrappingConnection.java
+++ search-test/test-1.6/src/java/org/sakaiproject/search/jdbc/WrappingConnection.java
@@ -0,0 +1,308 @@
+/**
+ *
+ */
+package org.sakaiproject.search.jdbc;
+
+import java.sql.Array;
+import java.sql.Blob;
+import java.sql.CallableStatement;
+import java.sql.Clob;
+import java.sql.Connection;
+import java.sql.DatabaseMetaData;
+import java.sql.NClob;
+import java.sql.PreparedStatement;
+import java.sql.SQLClientInfoException;
+import java.sql.SQLException;
+import java.sql.SQLWarning;
+import java.sql.SQLXML;
+import java.sql.Savepoint;
+import java.sql.Statement;
+import java.sql.Struct;
+import java.util.Map;
+import java.util.Properties;
+
+public class WrappingConnection implements Connection {
+ private final Connection c;
+
+ public WrappingConnection(Connection c) {
+ this.c = c;
+ }
+
+ public void close() throws SQLException
+ {
+ c.close();
+ }
+
+ public void clearWarnings() throws SQLException
+ {
+ c.clearWarnings();
+ }
+
+ public void commit() throws SQLException
+ {
+ c.commit();
+ }
+
+ public Statement createStatement() throws SQLException
+ {
+
+ return c.createStatement();
+ }
+
+ public Statement createStatement(int resultSetType,
+ int resultSetConcurrency) throws SQLException
+ {
+ return c.createStatement(resultSetType, resultSetConcurrency);
+ }
+
+ public Statement createStatement(int resultSetType,
+ int resultSetConcurrency, int resultSetHoldability)
+ throws SQLException
+ {
+ return c.createStatement(resultSetType, resultSetConcurrency,
+ resultSetHoldability);
+ }
+
+ public boolean getAutoCommit() throws SQLException
+ {
+ return c.getAutoCommit();
+ }
+
+ public String getCatalog() throws SQLException
+ {
+ return c.getCatalog();
+ }
+
+ public int getHoldability() throws SQLException
+ {
+ return c.getHoldability();
+ }
+
+ public DatabaseMetaData getMetaData() throws SQLException
+ {
+ return c.getMetaData();
+ }
+
+ public int getTransactionIsolation() throws SQLException
+ {
+ return c.getTransactionIsolation();
+ }
+
+ public Map> getTypeMap() throws SQLException
+ {
+ return c.getTypeMap();
+ }
+
+ public SQLWarning getWarnings() throws SQLException
+ {
+ return c.getWarnings();
+ }
+
+ public boolean isClosed() throws SQLException
+ {
+ return c.isClosed();
+ }
+
+ public boolean isReadOnly() throws SQLException
+ {
+ return c.isReadOnly();
+ }
+
+ public String nativeSQL(String sql) throws SQLException
+ {
+ return c.nativeSQL(sql);
+ }
+
+ public CallableStatement prepareCall(String sql) throws SQLException
+ {
+ return c.prepareCall(sql);
+ }
+
+ public CallableStatement prepareCall(String sql, int resultSetType,
+ int resultSetConcurrency) throws SQLException
+ {
+ return c.prepareCall(sql, resultSetType, resultSetConcurrency);
+ }
+
+ public CallableStatement prepareCall(String sql, int resultSetType,
+ int resultSetConcurrency, int resultSetHoldability)
+ throws SQLException
+ {
+ return c.prepareCall(sql, resultSetType, resultSetConcurrency,
+ resultSetHoldability);
+ }
+
+ public PreparedStatement prepareStatement(String sql)
+ throws SQLException
+ {
+ return c.prepareStatement(sql);
+ }
+
+ public PreparedStatement prepareStatement(String sql,
+ int autoGeneratedKeys) throws SQLException
+ {
+ return c.prepareStatement(sql, autoGeneratedKeys);
+ }
+
+ public PreparedStatement prepareStatement(String sql,
+ int[] columnIndexes) throws SQLException
+ {
+ return c.prepareStatement(sql, columnIndexes);
+ }
+
+ public PreparedStatement prepareStatement(String sql,
+ String[] columnNames) throws SQLException
+ {
+ return c.prepareStatement(sql, columnNames);
+ }
+
+ public PreparedStatement prepareStatement(String sql,
+ int resultSetType, int resultSetConcurrency)
+ throws SQLException
+ {
+ return c.prepareStatement(sql, resultSetType,
+ resultSetConcurrency);
+ }
+
+ public PreparedStatement prepareStatement(String sql,
+ int resultSetType, int resultSetConcurrency,
+ int resultSetHoldability) throws SQLException
+ {
+ return c.prepareStatement(sql, resultSetType,
+ resultSetConcurrency, resultSetHoldability);
+ }
+
+ public void releaseSavepoint(Savepoint savepoint) throws SQLException
+ {
+ c.releaseSavepoint(savepoint);
+ }
+
+ public void rollback() throws SQLException
+ {
+ c.rollback();
+
+ }
+
+ public void rollback(Savepoint savepoint) throws SQLException
+ {
+ c.rollback(savepoint);
+
+ }
+
+ public void setAutoCommit(boolean autoCommit) throws SQLException
+ {
+ c.setAutoCommit(autoCommit);
+
+ }
+
+ public void setCatalog(String catalog) throws SQLException
+ {
+ c.setCatalog(catalog);
+
+ }
+
+ public void setHoldability(int holdability) throws SQLException
+ {
+ c.setHoldability(holdability);
+
+ }
+
+ public void setReadOnly(boolean readOnly) throws SQLException
+ {
+ c.setReadOnly(readOnly);
+
+ }
+
+ public Savepoint setSavepoint() throws SQLException
+ {
+ return c.setSavepoint();
+ }
+
+ public Savepoint setSavepoint(String name) throws SQLException
+ {
+ return c.setSavepoint(name);
+ }
+
+ public void setTransactionIsolation(int level) throws SQLException
+ {
+ c.setTransactionIsolation(level);
+
+ }
+
+ public void setTypeMap(Map> map) throws SQLException
+ {
+ c.setTypeMap(map);
+
+ }
+
+ @Override
+ public Array createArrayOf(String typeName,
+ Object[] elements) throws SQLException {
+ return c.createArrayOf(typeName, elements);
+ }
+
+ @Override
+ public Blob createBlob() throws SQLException {
+ return c.createBlob();
+ }
+
+ @Override
+ public Clob createClob() throws SQLException {
+ return c.createClob();
+ }
+
+ @Override
+ public NClob createNClob() throws SQLException {
+ return c.createNClob();
+ }
+
+ @Override
+ public SQLXML createSQLXML() throws SQLException {
+ return c.createSQLXML();
+ }
+
+ @Override
+ public Struct createStruct(String typeName,
+ Object[] attributes) throws SQLException {
+ return c.createStruct(typeName, attributes);
+ }
+
+ @Override
+ public Properties getClientInfo() throws SQLException {
+ return c.getClientInfo();
+ }
+
+ @Override
+ public String getClientInfo(String name)
+ throws SQLException {
+ return c.getClientInfo(name);
+ }
+
+ @Override
+ public boolean isValid(int timeout) throws SQLException {
+ return c.isValid(timeout);
+ }
+
+ @Override
+ public void setClientInfo(Properties properties)
+ throws SQLClientInfoException {
+ c.setClientInfo(properties);
+ }
+
+ @Override
+ public void setClientInfo(String name, String value)
+ throws SQLClientInfoException {
+ c.setClientInfo(name, value);
+ }
+
+ @Override
+ public boolean isWrapperFor(Class> iface)
+ throws SQLException {
+ return c.isWrapperFor(iface);
+ }
+
+ @Override
+ public T unwrap(Class iface) throws SQLException {
+ return c.unwrap(iface);
+ }
+}
\ No newline at end of file
Index: search-test/test-1.6/src/java/org/sakaiproject/search/jdbc/WrappingDataSource.java
===================================================================
--- search-test/test-1.6/src/java/org/sakaiproject/search/jdbc/WrappingDataSource.java
+++ search-test/test-1.6/src/java/org/sakaiproject/search/jdbc/WrappingDataSource.java
@@ -0,0 +1,61 @@
+/**
+ *
+ */
+package org.sakaiproject.search.jdbc;
+
+import java.io.PrintWriter;
+import java.sql.Connection;
+import java.sql.SQLException;
+
+import javax.sql.DataSource;
+
+public class WrappingDataSource implements DataSource {
+
+ private DataSource wds;
+
+ public WrappingDataSource(DataSource ds)
+ {
+ wds = ds;
+ }
+
+ public Connection getConnection() throws SQLException
+ {
+ return wds.getConnection();
+ }
+
+ public Connection getConnection(String username, String password)
+ throws SQLException
+ {
+ return wds.getConnection(username, password);
+ }
+
+ public PrintWriter getLogWriter() throws SQLException
+ {
+ return wds.getLogWriter();
+ }
+
+ public int getLoginTimeout() throws SQLException
+ {
+ return wds.getLoginTimeout();
+ }
+
+ public void setLogWriter(PrintWriter out) throws SQLException
+ {
+ wds.setLogWriter(out);
+ }
+
+ public void setLoginTimeout(int seconds) throws SQLException
+ {
+ wds.setLoginTimeout(seconds);
+ }
+
+ @Override
+ public boolean isWrapperFor(Class> iface) throws SQLException {
+ return isWrapperFor(iface);
+ }
+
+ @Override
+ public T unwrap(Class iface) throws SQLException {
+ return unwrap(iface);
+ }
+}
\ No newline at end of file