You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by di...@apache.org on 2003/11/02 18:46:12 UTC

cvs commit: jakarta-commons/dbcp/src/test/org/apache/commons/dbcp TesterStatement.java TesterResultSet.java TesterPreparedStatement.java TesterConnection.java

dirkv       2003/11/02 09:46:12

  Modified:    dbcp/src/test/org/apache/commons/dbcp TesterStatement.java
                        TesterResultSet.java TesterPreparedStatement.java
                        TesterConnection.java
  Log:
  support for resultSetType, resultSetConcurrency in junit tests
  
  Revision  Changes    Path
  1.12      +10 -3     jakarta-commons/dbcp/src/test/org/apache/commons/dbcp/TesterStatement.java
  
  Index: TesterStatement.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/dbcp/src/test/org/apache/commons/dbcp/TesterStatement.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- TesterStatement.java	15 Oct 2003 19:52:13 -0000	1.11
  +++ TesterStatement.java	2 Nov 2003 17:46:12 -0000	1.12
  @@ -78,6 +78,13 @@
       public TesterStatement(Connection conn) {
           _connection = conn;
       }
  +
  +    public TesterStatement(Connection conn, int resultSetType, int resultSetConcurrency) {
  +        _connection = conn;
  +        _resultSetType = resultSetType;
  +        _resultSetConcurrency = resultSetConcurrency;
  +    }
  +    
       protected Connection _connection = null;
       protected boolean _open = true;
       protected int _rowsUpdated = 1;
  
  
  
  1.9       +15 -5     jakarta-commons/dbcp/src/test/org/apache/commons/dbcp/TesterResultSet.java
  
  Index: TesterResultSet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/dbcp/src/test/org/apache/commons/dbcp/TesterResultSet.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- TesterResultSet.java	15 Oct 2003 19:53:30 -0000	1.8
  +++ TesterResultSet.java	2 Nov 2003 17:46:12 -0000	1.9
  @@ -90,6 +90,16 @@
           _data = data;
       }
   
  +    public TesterResultSet(Statement stmt, Object[][] data, int type, int concurrency) {
  +        _statement = stmt;
  +        _data = data;
  +        _type = type;
  +        _concurrency = concurrency;
  +    }
  +    
  +    protected int _type = ResultSet.TYPE_FORWARD_ONLY;
  +    protected int _concurrency = ResultSet.CONCUR_READ_ONLY;
  +
       protected Object[][] _data = null;
       protected int _currentRow = -1;
       
  @@ -423,11 +433,11 @@
       }
   
       public int getType() throws SQLException {
  -        return 1003;
  +        return this._type;
       }
   
       public int getConcurrency() throws SQLException {
  -        return 1007;
  +        return this._concurrency;
       }
   
       public boolean rowUpdated() throws SQLException {
  
  
  
  1.10      +10 -5     jakarta-commons/dbcp/src/test/org/apache/commons/dbcp/TesterPreparedStatement.java
  
  Index: TesterPreparedStatement.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/dbcp/src/test/org/apache/commons/dbcp/TesterPreparedStatement.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- TesterPreparedStatement.java	15 Oct 2003 19:53:30 -0000	1.9
  +++ TesterPreparedStatement.java	2 Nov 2003 17:46:12 -0000	1.10
  @@ -93,12 +93,17 @@
           _sql = sql;
       }
   
  +    public TesterPreparedStatement(Connection conn, String sql, int resultSetType, int resultSetConcurrency) {
  +        super(conn, resultSetType, resultSetConcurrency);
  +        _sql = sql;
  +    }
  +
       public ResultSet executeQuery(String sql) throws SQLException {
           checkOpen();
           if("null".equals(sql)) {
               return null;
           } else {
  -            return new TesterResultSet(this);
  +            return new TesterResultSet(this, null, _resultSetType, _resultSetConcurrency);
           }
       }
   
  @@ -112,7 +117,7 @@
           if("null".equals(_sql)) {
               return null;
           } else {
  -            return new TesterResultSet(this);
  +            return new TesterResultSet(this, null, _resultSetType, _resultSetConcurrency);
           }
       }
   
  
  
  
  1.10      +4 -4      jakarta-commons/dbcp/src/test/org/apache/commons/dbcp/TesterConnection.java
  
  Index: TesterConnection.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/dbcp/src/test/org/apache/commons/dbcp/TesterConnection.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- TesterConnection.java	15 Oct 2003 19:53:30 -0000	1.9
  +++ TesterConnection.java	2 Nov 2003 17:46:12 -0000	1.10
  @@ -190,7 +190,7 @@
   
       public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException {
           checkOpen();
  -        return new TesterPreparedStatement(this, sql);
  +        return new TesterPreparedStatement(this, sql, resultSetType, resultSetConcurrency);
       }
   
       public void rollback() throws SQLException {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org