[jboss-cvs] JBossAS SVN: r67620 - in trunk/testsuite/src/main/org/jboss/test: jca/ejb and 3 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Nov 29 12:53:48 EST 2007
Author: adrian at jboss.org
Date: 2007-11-29 12:53:47 -0500 (Thu, 29 Nov 2007)
New Revision: 67620
Modified:
trunk/testsuite/src/main/org/jboss/test/jca/adapter/MockedXADataSource.java
trunk/testsuite/src/main/org/jboss/test/jca/ejb/JDBCStatementTestsConnectionSessionBean.java
trunk/testsuite/src/main/org/jboss/test/jca/jdbc/TestConnection.java
trunk/testsuite/src/main/org/jboss/test/jca/jdbc/TestDriver.java
trunk/testsuite/src/main/org/jboss/test/jca/jdbc/TestPreparedStatement.java
trunk/testsuite/src/main/org/jboss/test/jca/jdbc/TestStatement.java
trunk/testsuite/src/main/org/jboss/test/security/test/LoginModulesUnitTestCase.java
trunk/testsuite/src/main/org/jboss/test/web/mock/MockDataSource.java
Log:
Compile on Java6: Use proxies for the mock jdbc code
Modified: trunk/testsuite/src/main/org/jboss/test/jca/adapter/MockedXADataSource.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jca/adapter/MockedXADataSource.java 2007-11-29 17:44:57 UTC (rev 67619)
+++ trunk/testsuite/src/main/org/jboss/test/jca/adapter/MockedXADataSource.java 2007-11-29 17:53:47 UTC (rev 67620)
@@ -27,6 +27,9 @@
import javax.transaction.xa.XAResource;
import javax.transaction.xa.XAException;
import javax.transaction.xa.Xid;
+
+import org.omg.PortableInterceptor.HOLDING;
+
import java.util.Map;
import java.util.HashMap;
import java.util.Arrays;
@@ -110,147 +113,84 @@
public XAConnection getXAConnection() throws SQLException
{
- return new MockedXAConnection();
+ return (XAConnection) Proxy.newProxyInstance(getClass().getClassLoader(), new Class[] { XAConnection.class }, new MockedXAConnection());
}
public XAConnection getXAConnection(String user, String password) throws SQLException
{
- return new MockedXAConnection();
+ return getXAConnection();
}
// Inner
- public class MockedXAConnection
- implements XAConnection
+ public class MockedXAConnection implements InvocationHandler
{
private boolean closed;
- private Connection con = new MockedConnection();
+ private Connection con;
private XAResource xaResource = new MockedXAResource();
- public XAResource getXAResource() throws SQLException
+ public MockedXAConnection()
{
- return xaResource;
+ con = (Connection) Proxy.newProxyInstance(getClass().getClassLoader(), new Class[] { Connection.class }, new MockedConnection());
}
-
- public void close() throws SQLException
+
+ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
{
- closed = true;
+ String name = method.getName();
+ if ("getXAResource".equals(name))
+ return xaResource;
+ if ("getConnection".equals(name))
+ return con;
+ if ("close".equals(name))
+ closed = true;
+ return null;
}
- public Connection getConnection() throws SQLException
+ class MockedConnection implements InvocationHandler
{
- return con;
- }
-
- public void addConnectionEventListener(ConnectionEventListener listener)
- {
- }
-
- public void removeConnectionEventListener(ConnectionEventListener listener)
- {
- }
-
- class MockedConnection
- implements Connection
- {
private int holdability;
private int txIsolation;
private boolean autoCommit;
private boolean readOnly;
private String catalog;
-
- public String getUrl()
+
+ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
{
- return url;
- }
-
- public int getHoldability() throws SQLException
- {
+ String name = method.getName();
+ if ("getUrl".equals(name))
+ return url;
check();
- return holdability;
+ if ("getHoldability".equals(name))
+ return holdability;
+ if ("setHoldability".equals(name))
+ holdability = (Integer) args[0];
+ if ("getTransactionIsolation".equals(name))
+ return txIsolation;
+ if ("setTransactionIsolation".equals(name))
+ txIsolation = (Integer) args[0];
+ if ("getAutoCommit".equals(name))
+ return autoCommit;
+ if ("setAutoCommit".equals(name))
+ autoCommit = (Boolean) args[0];
+ if ("isClosed".equals(name))
+ return closed;
+ if ("isReadOnly".equals(name))
+ return readOnly;
+ if ("setReadOnly".equals(name))
+ readOnly = (Boolean) args[0];
+ if ("close".equals(name))
+ closed = true;
+ if ("getCatalog".equals(name))
+ return catalog;
+ if ("setCatalog".equals(name))
+ catalog = (String) args[0];
+ if ("getMetaData".equals(name))
+ return getMetaData();
+ if ("createStatement".equals(name))
+ return createStatement();
+ return null;
}
- public int getTransactionIsolation() throws SQLException
- {
- check();
- return txIsolation;
- }
-
- public void clearWarnings() throws SQLException
- {
- check();
- }
-
- public void close() throws SQLException
- {
- check();
- closed = true;
- }
-
- public void commit() throws SQLException
- {
- check();
- }
-
- public void rollback() throws SQLException
- {
- check();
- }
-
- public boolean getAutoCommit() throws SQLException
- {
- check();
- return autoCommit;
- }
-
- public boolean isClosed() throws SQLException
- {
- check();
- return closed;
- }
-
- public boolean isReadOnly() throws SQLException
- {
- check();
- return readOnly;
- }
-
- public void setHoldability(int holdability) throws SQLException
- {
- check();
- this.holdability = holdability;
- }
-
- public void setTransactionIsolation(int level) throws SQLException
- {
- check();
- this.txIsolation = level;
- }
-
- public void setAutoCommit(boolean autoCommit) throws SQLException
- {
- check();
- this.autoCommit = autoCommit;
- }
-
- public void setReadOnly(boolean readOnly) throws SQLException
- {
- check();
- this.readOnly = readOnly;
- }
-
- public String getCatalog() throws SQLException
- {
- check();
- return catalog;
- }
-
- public void setCatalog(String catalog) throws SQLException
- {
- check();
- this.catalog = catalog;
- }
-
public DatabaseMetaData getMetaData() throws SQLException
{
check();
@@ -276,29 +216,6 @@
);
}
- public SQLWarning getWarnings() throws SQLException
- {
- check();
- return null;
- }
-
- public Savepoint setSavepoint() throws SQLException
- {
- check();
- throw new UnsupportedOperationException("setSavepoint() is not implemented.");
- }
-
- public void releaseSavepoint(Savepoint savepoint) throws SQLException
- {
- check();
- throw new UnsupportedOperationException("releaseSavepoint() is not implemented.");
- }
-
- public void rollback(Savepoint savepoint) throws SQLException
- {
- check();
- }
-
public Statement createStatement() throws SQLException
{
check();
@@ -326,105 +243,6 @@
);
}
- public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException
- {
- check();
- throw new UnsupportedOperationException("Not implemented.");
- }
-
- public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability)
- throws SQLException
- {
- check();
- throw new UnsupportedOperationException("Not implemented.");
- }
-
- public Map getTypeMap() throws SQLException
- {
- check();
- throw new UnsupportedOperationException("Not implemented.");
- }
-
- public void setTypeMap(Map map) throws SQLException
- {
- check();
- throw new UnsupportedOperationException("Not implemented.");
- }
-
- public String nativeSQL(String sql) throws SQLException
- {
- check();
- throw new UnsupportedOperationException("Not implemented.");
- }
-
- public CallableStatement prepareCall(String sql) throws SQLException
- {
- check();
- throw new UnsupportedOperationException("Not implemented.");
- }
-
- public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency)
- throws SQLException
- {
- check();
- throw new UnsupportedOperationException("Not implemented.");
- }
-
- public CallableStatement prepareCall(String sql,
- int resultSetType,
- int resultSetConcurrency,
- int resultSetHoldability) throws SQLException
- {
- check();
- throw new UnsupportedOperationException("Not implemented.");
- }
-
- public PreparedStatement prepareStatement(String sql) throws SQLException
- {
- check();
- throw new UnsupportedOperationException("Not implemented.");
- }
-
- public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException
- {
- check();
- throw new UnsupportedOperationException("Not implemented.");
- }
-
- public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency)
- throws SQLException
- {
- check();
- throw new UnsupportedOperationException("Not implemented.");
- }
-
- public PreparedStatement prepareStatement(String sql,
- int resultSetType,
- int resultSetConcurrency,
- int resultSetHoldability) throws SQLException
- {
- check();
- throw new UnsupportedOperationException("Not implemented.");
- }
-
- public PreparedStatement prepareStatement(String sql, int columnIndexes[]) throws SQLException
- {
- check();
- throw new UnsupportedOperationException("Not implemented.");
- }
-
- public Savepoint setSavepoint(String name) throws SQLException
- {
- check();
- throw new UnsupportedOperationException("Not implemented.");
- }
-
- public PreparedStatement prepareStatement(String sql, String columnNames[]) throws SQLException
- {
- check();
- throw new UnsupportedOperationException("Not implemented.");
- }
-
// Private
private void check() throws SQLException
@@ -437,7 +255,7 @@
}
}
- private static class MockedXAResource
+ class MockedXAResource
implements XAResource
{
private int txTimeOut;
Modified: trunk/testsuite/src/main/org/jboss/test/jca/ejb/JDBCStatementTestsConnectionSessionBean.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jca/ejb/JDBCStatementTestsConnectionSessionBean.java 2007-11-29 17:44:57 UTC (rev 67619)
+++ trunk/testsuite/src/main/org/jboss/test/jca/ejb/JDBCStatementTestsConnectionSessionBean.java 2007-11-29 17:53:47 UTC (rev 67620)
@@ -24,6 +24,8 @@
import javax.ejb.SessionBean;
import javax.naming.InitialContext;
import javax.sql.DataSource;
+
+import java.lang.reflect.Proxy;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
@@ -84,7 +86,7 @@
Connection c = ds.getConnection();
WrappedConnection wc = (WrappedConnection) c;
Connection uc = wc.getUnderlyingConnection();
- tc = (TestConnection) uc;
+ tc = (TestConnection) Proxy.getInvocationHandler(uc);
c.close();
tc.setFail(true);
int closeCount1 = tc.getClosedCount();
@@ -117,7 +119,8 @@
}
finally
{
- tc.setFail(false);
+ if (tc != null)
+ tc.setFail(false);
}
}
Modified: trunk/testsuite/src/main/org/jboss/test/jca/jdbc/TestConnection.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jca/jdbc/TestConnection.java 2007-11-29 17:44:57 UTC (rev 67619)
+++ trunk/testsuite/src/main/org/jboss/test/jca/jdbc/TestConnection.java 2007-11-29 17:53:47 UTC (rev 67620)
@@ -21,15 +21,12 @@
*/
package org.jboss.test.jca.jdbc;
-import java.sql.Connection;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Statement;
-import java.sql.PreparedStatement;
-import java.sql.CallableStatement;
-import java.sql.DatabaseMetaData;
-import java.util.Map;
-import java.sql.SQLWarning;
-import java.sql.Savepoint;
/**
@@ -42,7 +39,8 @@
* @version
*/
-public class TestConnection implements Connection {
+public class TestConnection implements InvocationHandler
+{
private TestDriver driver;
@@ -54,6 +52,30 @@
{
this.driver = driver;
}
+
+ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
+ {
+ String name = method.getName();
+ if ("getHoldability".equals(name))
+ return 0;
+ if ("getTransactionIsolation".equals(name))
+ return 0;
+ if ("isReadOnly".equals(name))
+ return false;
+ if ("getAutoCommit".equals(name))
+ return autocommit;
+ if ("setAutoCommit".equals(name))
+ autocommit = (Boolean) args[0];
+ if ("isClosed".equals(name))
+ return closed;
+ if ("close".equals(name))
+ close();
+ if ("createStatement".equals(name))
+ return createStatement();
+ if ("createPreparedStatement".equals(name))
+ return createPreparedStatement();
+ return null;
+ }
public void setFail(boolean fail)
{
@@ -71,188 +93,19 @@
return null;
}
- public void clearWarnings()
- {
- }
-
public void close()
{
closed = true;
driver.connectionClosed();
}
- public void commit()
- {
- }
-
public Statement createStatement() throws SQLException
{
- return new TestStatement(driver);
+ return (Statement) Proxy.newProxyInstance(getClass().getClassLoader(), new Class[] { Statement.class }, new TestStatement(driver));
}
- public Statement createStatement(int rst, int rsc) throws SQLException
+ public PreparedStatement createPreparedStatement()
{
- return null;
+ return (PreparedStatement) Proxy.newProxyInstance(getClass().getClassLoader(), new Class[] { PreparedStatement.class }, new TestPreparedStatement(driver));
}
-
- public boolean getAutoCommit()
- {
- return autocommit;
- }
-
- public void setAutoCommit(boolean autocommit)
- {
- this.autocommit = autocommit;
- }
-
- public String getCatalog()
- {
- return null;
- }
-
- public DatabaseMetaData getMetaData()
- {
- return null;
- }
-
- public int getTransactionIsolation()
- {
- return 0;
- }
-
- public Map getTypeMap()
- {
- return null;
- }
-
- public SQLWarning getWarnings()
- {
- return null;
- }
-
- public boolean isClosed()
- {
- return closed;
- }
-
- public boolean isReadOnly()
- {
- return false;
- }
-
- public String nativeSQL(String sql)
- {
- return sql;
- }
-
- public CallableStatement prepareCall(String sql)
- {
- return null;
- }
-
- public CallableStatement prepareCall(String sql, int rst)
- {
- return null;
- }
-
- public CallableStatement prepareCall(String sql, int[] rst)
- {
- return null;
- }
-
- public CallableStatement prepareCall(String sql, int rst, int rsc)
- {
- return null;
- }
-
- public CallableStatement prepareCall(String sql, String[] rst)
- {
- return null;
- }
-
- public CallableStatement prepareCall(String sql, int rst, int rsc, int i)
- {
- return null;
- }
-
- public PreparedStatement prepareStatement(String sql)
- {
- return new TestPreparedStatement(driver);
- }
-
- public PreparedStatement prepareStatement(String sql, int rst, int rsc)
- {
- return new TestPreparedStatement(driver);
- }
-
- public PreparedStatement prepareStatement(String sql, int rst)
- {
- return null;
- }
-
- public PreparedStatement prepareStatement(String sql, int[] rst)
- {
- return null;
- }
-
- public PreparedStatement prepareStatement(String sql, String[] rst)
- {
- return null;
- }
-
- public PreparedStatement prepareStatement(String sql, int rst, int rsc, int i)
- {
- return null;
- }
-
- public void rollback()
- {
- }
-
- public void setCatalog(String cat)
- {
- }
-
- public void setReadOnly(boolean r0)
- {
- }
-
- public void setTransactionIsolation(int level)
- {
- }
-
- public void setTypeMap(Map map)
- {
- }
-
- public void setHoldability(int h)
- {
- }
-
- public int getHoldability()
- {
- return 0;
- }
-
- public Savepoint setSavepoint()
- {
- return null;
- }
-
- public Savepoint setSavepoint(String name)
- {
- return null;
- }
-
- public void rollback(Savepoint s)
- {
- }
- public void commit(Savepoint s)
- {
- }
-
- public void releaseSavepoint(Savepoint s)
- {
- }
-
-}// TestConnection
+}
Modified: trunk/testsuite/src/main/org/jboss/test/jca/jdbc/TestDriver.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jca/jdbc/TestDriver.java 2007-11-29 17:44:57 UTC (rev 67619)
+++ trunk/testsuite/src/main/org/jboss/test/jca/jdbc/TestDriver.java 2007-11-29 17:53:47 UTC (rev 67620)
@@ -21,6 +21,7 @@
*/
package org.jboss.test.jca.jdbc;
+import java.lang.reflect.Proxy;
import java.sql.Driver;
import java.sql.SQLException;
import java.util.Properties;
@@ -77,7 +78,7 @@
public Connection connect(String url, Properties info) throws SQLException
{
- return new TestConnection(this);
+ return (Connection) Proxy.newProxyInstance(getClass().getClassLoader(), new Class[] { Connection.class }, new TestConnection(this));
}
public int getMajorVersion()
Modified: trunk/testsuite/src/main/org/jboss/test/jca/jdbc/TestPreparedStatement.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jca/jdbc/TestPreparedStatement.java 2007-11-29 17:44:57 UTC (rev 67619)
+++ trunk/testsuite/src/main/org/jboss/test/jca/jdbc/TestPreparedStatement.java 2007-11-29 17:53:47 UTC (rev 67620)
@@ -21,22 +21,7 @@
*/
package org.jboss.test.jca.jdbc;
-import java.io.InputStream;
-import java.io.Reader;
-import java.math.BigDecimal;
-import java.net.URL;
-import java.sql.Array;
-import java.sql.Blob;
-import java.sql.Clob;
-import java.sql.Date;
-import java.sql.ParameterMetaData;
-import java.sql.PreparedStatement;
-import java.sql.Ref;
-import java.sql.ResultSet;
-import java.sql.ResultSetMetaData;
-import java.sql.Time;
-import java.sql.Timestamp;
-import java.util.Calendar;
+import java.lang.reflect.Method;
/**
* TestPreparedStatement.java
@@ -45,163 +30,21 @@
*/
public class TestPreparedStatement extends TestStatement
- implements PreparedStatement
{
public TestPreparedStatement(final TestDriver driver)
{
super(driver);
}
-
- public void addBatch()
+
+ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
{
+ if ("execute".equals(method.getName()))
+ return execute();
+ return super.invoke(proxy, method, args);
}
- public void clearParameters()
- {
- }
-
public boolean execute()
{
return true;
}
-
- public ResultSet executeQuery()
- {
- return null;
- }
-
- public int executeUpdate()
- {
- return 0;
- }
-
- public ResultSetMetaData getMetaData()
- {
- return null;
- }
-
- public ParameterMetaData getParameterMetaData()
- {
- return null;
- }
-
- public void setArray(int i, Array x)
- {
- }
-
- public void setAsciiStream(int i, InputStream is, int length)
- {
- }
-
- public void setBigDecimal(int i, BigDecimal x)
- {
- }
-
- public void setBinaryStream(int i, InputStream is, int length)
- {
- }
-
- public void setBlob(int i, Blob x)
- {
- }
-
- public void setBoolean(int i, boolean x)
- {
- }
-
- public void setByte(int i, byte x)
- {
- }
-
- public void setBytes(int i, byte[] x)
- {
- }
-
- public void setCharacterStream(int i, Reader r, int length)
- {
- }
-
- public void setClob(int i, Clob x)
- {
- }
-
- public void setDate(int i, Date x)
- {
- }
-
- public void setDate(int i, Date x, Calendar cal)
- {
- }
-
- public void setDouble(int i, double x)
- {
- }
-
- public void setFloat(int i, float x)
- {
- }
-
- public void setInt(int i, int x)
- {
- }
-
- public void setLong(int i, long x)
- {
- }
-
- public void setNull(int i, int sqlType)
- {
- }
-
- public void setNull(int i, int sqlType, String typeName)
- {
- }
-
- public void setObject(int i, Object x)
- {
- }
-
- public void setObject(int i, Object x, int targetSqlType)
- {
- }
-
- public void setObject(int i, Object x, int targetSqlType, int scale)
- {
- }
-
- public void setRef(int i, Ref ref)
- {
- }
-
- public void setShort(int i, short x)
- {
- }
-
- public void setString(int i, String x)
- {
- }
-
- public void setTime(int i, Time x)
- {
- }
-
- public void setTime(int i, Time x, Calendar cal)
- {
- }
-
- public void setTimestamp(int i, Timestamp x)
- {
- }
-
- public void setTimestamp(int i, Timestamp x, Calendar cal)
- {
- }
-
- public void setUnicodeStream(int i, InputStream x, int length)
- {
- }
-
- public void setURL(int i, URL url)
- {
- }
}
Modified: trunk/testsuite/src/main/org/jboss/test/jca/jdbc/TestStatement.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jca/jdbc/TestStatement.java 2007-11-29 17:44:57 UTC (rev 67619)
+++ trunk/testsuite/src/main/org/jboss/test/jca/jdbc/TestStatement.java 2007-11-29 17:53:47 UTC (rev 67620)
@@ -21,11 +21,10 @@
*/
package org.jboss.test.jca.jdbc;
-import java.sql.Connection;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
import java.sql.ResultSet;
import java.sql.SQLException;
-import java.sql.SQLWarning;
-import java.sql.Statement;
/**
@@ -38,8 +37,7 @@
* @version
*/
-public class TestStatement
- implements Statement
+public class TestStatement implements InvocationHandler
{
private final TestDriver driver;
@@ -49,385 +47,50 @@
{
this.driver = driver;
}
- // implementation of java.sql.Statement interface
-
- /**
- *
- * @exception java.sql.SQLException <description>
- */
- public void close() throws SQLException
+
+ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
{
+ String name = method.getName();
+ if ("execute".equals(name))
+ return execute((String) args[0]);
+ if ("executeQuery".equals(name))
+ return executeQuery((String) args[0]);
+ if ("executeUpdate".equals(name))
+ return executeUpdate((String) args[0]);
+ if ("getQueryTimeout".equals(name))
+ return getQueryTimeout();
+ if ("setQueryTimeout".equals(name))
+ setQueryTimeout((Integer) args[0]);
+ return null;
}
- /**
- *
- * @param param1 <description>
- * @return <description>
- * @exception java.sql.SQLException <description>
- */
public boolean execute(String sql) throws SQLException
{
if (driver.getFail())
- {
throw new SQLException("asked to fail");
- } // end of if ()
return false;
}
- /**
- *
- * @param param1 <description>
- * @param param2 <description>
- * @return <description>
- * @exception java.sql.SQLException <description>
- */
- public boolean execute(String sql, int autoGeneratedKeys) throws SQLException
- {
- return execute(sql);
- }
-
- /**
- *
- * @param param1 <description>
- * @param param2 <description>
- * @return <description>
- * @exception java.sql.SQLException <description>
- */
- public boolean execute(String sql, int[] columnIndexes) throws SQLException
- {
- return execute(sql);
- }
-
- /**
- *
- * @param param1 <description>
- * @param param2 <description>
- * @return <description>
- * @exception java.sql.SQLException <description>
- */
- public boolean execute(String sql, String[]columnNames ) throws SQLException
- {
- return execute(sql);
- }
-
- /**
- *
- * @return <description>
- * @exception java.sql.SQLException <description>
- */
- public Connection getConnection() throws SQLException
- {
- return null;
- }
-
- /**
- *
- * @return <description>
- * @exception java.sql.SQLException <description>
- */
- public SQLWarning getWarnings() throws SQLException
- {
- return null;
- }
-
- /**
- *
- * @exception java.sql.SQLException <description>
- */
- public void clearWarnings() throws SQLException
- {
- }
-
- /**
- *
- * @param param1 <description>
- * @return <description>
- * @exception java.sql.SQLException <description>
- */
public ResultSet executeQuery(String sql) throws SQLException
{
execute(sql);
return null;
}
- /**
- *
- * @param param1 <description>
- * @return <description>
- * @exception java.sql.SQLException <description>
- */
public int executeUpdate(String sql) throws SQLException
{
execute(sql);
return 0;
}
- /**
- *
- * @param param1 <description>
- * @param param2 <description>
- * @return <description>
- * @exception java.sql.SQLException <description>
- */
- public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException
- {
- return executeUpdate(sql);
- }
-
- /**
- *
- * @param param1 <description>
- * @param param2 <description>
- * @return <description>
- * @exception java.sql.SQLException <description>
- */
- public int executeUpdate(String sql, int[] columnIndexes) throws SQLException
- {
- return executeUpdate(sql);
- }
-
- /**
- *
- * @param param1 <description>
- * @param param2 <description>
- * @return <description>
- * @exception java.sql.SQLException <description>
- */
- public int executeUpdate(String sql, String[] columnNames) throws SQLException
- {
- return executeUpdate(sql);
- }
-
- /**
- *
- * @return <description>
- * @exception java.sql.SQLException <description>
- */
- public int getMaxFieldSize() throws SQLException
- {
- return 0;
- }
-
- /**
- *
- * @param param1 <description>
- * @exception java.sql.SQLException <description>
- */
- public void setMaxFieldSize(int max) throws SQLException
- {
- }
-
- /**
- *
- * @return <description>
- * @exception java.sql.SQLException <description>
- */
- public int getMaxRows() throws SQLException
- {
- return 0;
- }
-
- /**
- *
- * @param param1 <description>
- * @exception java.sql.SQLException <description>
- */
- public void setMaxRows(int max) throws SQLException
- {
- }
-
- /**
- *
- * @param param1 <description>
- * @exception java.sql.SQLException <description>
- */
- public void setEscapeProcessing(boolean enable) throws SQLException
- {
- }
-
- /**
- *
- * @return <description>
- * @exception java.sql.SQLException <description>
- */
public int getQueryTimeout() throws SQLException
{
return queryTimeout;
}
- /**
- *
- * @param param1 <description>
- * @exception java.sql.SQLException <description>
- */
public void setQueryTimeout(int timeout) throws SQLException
{
this.queryTimeout = timeout;
}
-
- /**
- *
- * @exception java.sql.SQLException <description>
- */
- public void cancel() throws SQLException
- {
- }
-
- /**
- *
- * @param param1 <description>
- * @exception java.sql.SQLException <description>
- */
- public void setCursorName(String name) throws SQLException
- {
- }
-
- /**
- *
- * @return <description>
- * @exception java.sql.SQLException <description>
- */
- public ResultSet getResultSet() throws SQLException
- {
- return null;
- }
-
- /**
- *
- * @return <description>
- * @exception java.sql.SQLException <description>
- */
- public int getUpdateCount() throws SQLException
- {
- return 0;
- }
-
- /**
- *
- * @return <description>
- * @exception java.sql.SQLException <description>
- */
- public boolean getMoreResults() throws SQLException
- {
- return false;
- }
-
- /**
- *
- * @param param1 <description>
- * @return <description>
- * @exception java.sql.SQLException <description>
- */
- public boolean getMoreResults(int current) throws SQLException
- {
- return false;
- }
-
- /**
- *
- * @param param1 <description>
- * @exception java.sql.SQLException <description>
- */
- public void setFetchDirection(int direction) throws SQLException
- {
- }
-
- /**
- *
- * @return <description>
- * @exception java.sql.SQLException <description>
- */
- public int getFetchDirection() throws SQLException
- {
- return 0;
- }
-
- /**
- *
- * @param param1 <description>
- * @exception java.sql.SQLException <description>
- */
- public void setFetchSize(int rows) throws SQLException
- {
- }
-
- /**
- *
- * @return <description>
- * @exception java.sql.SQLException <description>
- */
- public int getFetchSize() throws SQLException
- {
- return 0;
- }
-
- /**
- *
- * @return <description>
- * @exception java.sql.SQLException <description>
- */
- public int getResultSetConcurrency() throws SQLException
- {
- return 0;
- }
-
- /**
- *
- * @return <description>
- * @exception java.sql.SQLException <description>
- */
- public int getResultSetType() throws SQLException
- {
- return 0;
- }
-
- /**
- *
- * @param param1 <description>
- * @exception java.sql.SQLException <description>
- */
- public void addBatch(String sql) throws SQLException
- {
- }
-
- /**
- *
- * @exception java.sql.SQLException <description>
- */
- public void clearBatch() throws SQLException
- {
- }
-
- /**
- *
- * @return <description>
- * @exception java.sql.SQLException <description>
- */
- public int[] executeBatch() throws SQLException
- {
- return null;
- }
-
- /**
- *
- * @return <description>
- * @exception java.sql.SQLException <description>
- */
- public ResultSet getGeneratedKeys() throws SQLException
- {
- return null;
- }
-
- /**
- *
- * @return <description>
- * @exception java.sql.SQLException <description>
- */
- public int getResultSetHoldability() throws SQLException
- {
- return 0;
- }
-
-
-}// LocalStatement
+}
Modified: trunk/testsuite/src/main/org/jboss/test/security/test/LoginModulesUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/security/test/LoginModulesUnitTestCase.java 2007-11-29 17:44:57 UTC (rev 67619)
+++ trunk/testsuite/src/main/org/jboss/test/security/test/LoginModulesUnitTestCase.java 2007-11-29 17:53:47 UTC (rev 67620)
@@ -398,6 +398,16 @@
public void setLoginTimeout(int seconds) throws java.sql.SQLException
{
}
+
+ public boolean isWrapperFor(Class<?> iface) throws SQLException
+ {
+ return false;
+ }
+
+ public <T> T unwrap(Class<T> iface) throws SQLException
+ {
+ throw new SQLException("No wrapper");
+ }
}
static class TestSecurityDomain implements SecurityDomain, Serializable
Modified: trunk/testsuite/src/main/org/jboss/test/web/mock/MockDataSource.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/web/mock/MockDataSource.java 2007-11-29 17:44:57 UTC (rev 67619)
+++ trunk/testsuite/src/main/org/jboss/test/web/mock/MockDataSource.java 2007-11-29 17:53:47 UTC (rev 67620)
@@ -22,6 +22,16 @@
System.err.println("MockDataSource");
}
+ public boolean isWrapperFor(Class<?> iface) throws SQLException
+ {
+ return false;
+ }
+
+ public <T> T unwrap(Class<T> iface) throws SQLException
+ {
+ throw new SQLException("No wrapper");
+ }
+
public Connection getConnection() throws SQLException
{
return null;
More information about the jboss-cvs-commits
mailing list