org.apache.derbyTesting.functionTests.tests.jdbcapi
Class ResultSetMiscTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.derbyTesting.junit.BaseTestCase
              extended by org.apache.derbyTesting.junit.BaseJDBCTestCase
                  extended by org.apache.derbyTesting.functionTests.tests.jdbcapi.ResultSetMiscTest
All Implemented Interfaces:
junit.framework.Test

public class ResultSetMiscTest
extends BaseJDBCTestCase


Field Summary
private  java.lang.Object nogc
          Hang onto the SecurityCheck class while running the tests so that it is not garbage collected during the test and lose the information it has collected.
 
Fields inherited from class org.apache.derbyTesting.junit.BaseTestCase
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE
 
Constructor Summary
ResultSetMiscTest(java.lang.String name)
           
 
Method Summary
static junit.framework.Test baseSuite(java.lang.String name)
           
private  void checkLocksForAutoCommitSelect(java.sql.Connection conn, java.sql.Statement stmt, int action)
          Check locks with various commit sequences.
private  void checkSingleRSAutoCommit(java.sql.Connection conn)
          Tests for two things: 1) The ResultSet does not close implicitly when the ResultSet completes and holdability == HOLD_CURSORS_OVER_COMMIT 2) The ResultSet auto-commits when it completes and auto-commit is on.
private  void checkSingleRSCloseCursorsAtCommit(java.sql.Connection conn)
          Check to see that ResultSet closes implicitly when holdability is set to CLOSE_CURORS_AT_COMMIT.
private  boolean locksHeld()
           
static junit.framework.Test suite()
          Runs the test fixtures in embedded and client.
 void testAutoCommit()
          Setup up and run the auto-commit tests.
 void testBug4810()
          Test fix for Bug4810 -Connection.commit() & rollback() do not commit/rollback in auto-commit mode.
 void testCorrelationNamesAndMetaDataCalls()
           
 void testFloatMAX_VALUE(java.sql.Connection conn)
           
 void testResultSetMetaData()
          Test resultset metadata on columns of various types
 
Methods inherited from class org.apache.derbyTesting.junit.BaseJDBCTestCase
assertCallError, assertCheckTable, assertCompileError, assertEquals, assertEquals, assertEquals, assertEquivalentDataType, assertGetIntError, assertNextError, assertPreparedStatementError, assertSQLExceptionEquals, assertSQLState, assertSQLState, assertStatementError, assertStatementError, assertStatementError, assertStatementError, assertTableRowCount, assertUpdateCount, assertUpdateCount, checkAllConsistency, checkEstimatedRowCount, commit, createStatement, createStatement, createStatement, dropTable, dropTable, getConnection, getDatabaseProperty, getLastSQLException, initializeConnection, openConnection, openDefaultConnection, openDefaultConnection, openUserConnection, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, rollback, runScript, runScript, runSQLCommands, setAutoCommit, tearDown, usingDB2Client, usingDerbyNetClient, usingEmbedded
 
Methods inherited from class org.apache.derbyTesting.junit.BaseTestCase
alarm, assertEquals, assertEquals, assertEquals, assertExecJavaCmdAsExpected, assertSecurityManager, assertThrowableEquals, execJavaCmd, fail, getFailureFolder, getJavaExecutableName, getSystemProperty, getTestConfiguration, getTestResource, openTestResource, println, printStackTrace, readProcessOutput, removeDirectory, removeDirectory, removeSystemProperty, runBare, setSystemProperty, traceit
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runTest, setName, setUp, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

nogc

private final java.lang.Object nogc
Hang onto the SecurityCheck class while running the tests so that it is not garbage collected during the test and lose the information it has collected.

Constructor Detail

ResultSetMiscTest

public ResultSetMiscTest(java.lang.String name)
Method Detail

testResultSetMetaData

public void testResultSetMetaData()
                           throws java.sql.SQLException
Test resultset metadata on columns of various types

Throws:
java.sql.SQLException

testBug4810

public void testBug4810()
                 throws java.sql.SQLException
Test fix for Bug4810 -Connection.commit() & rollback() do not commit/rollback in auto-commit mode.

Throws:
java.sql.SQLException

testAutoCommit

public void testAutoCommit()
                    throws java.sql.SQLException
Setup up and run the auto-commit tests.

Throws:
java.sql.SQLException

testCorrelationNamesAndMetaDataCalls

public void testCorrelationNamesAndMetaDataCalls()
                                          throws java.sql.SQLException
Throws:
java.sql.SQLException

testFloatMAX_VALUE

public void testFloatMAX_VALUE(java.sql.Connection conn)
                        throws java.sql.SQLException
Throws:
java.sql.SQLException

checkSingleRSAutoCommit

private void checkSingleRSAutoCommit(java.sql.Connection conn)
                              throws java.sql.SQLException
Tests for two things: 1) The ResultSet does not close implicitly when the ResultSet completes and holdability == HOLD_CURSORS_OVER_COMMIT 2) The ResultSet auto-commits when it completes and auto-commit is on.

Parameters:
conn - The Connection
Throws:
java.sql.SQLException

checkSingleRSCloseCursorsAtCommit

private void checkSingleRSCloseCursorsAtCommit(java.sql.Connection conn)
                                        throws java.sql.SQLException
Check to see that ResultSet closes implicitly when holdability is set to CLOSE_CURORS_AT_COMMIT.

Parameters:
conn - The Connection
Throws:
java.sql.SQLException

checkLocksForAutoCommitSelect

private void checkLocksForAutoCommitSelect(java.sql.Connection conn,
                                           java.sql.Statement stmt,
                                           int action)
                                    throws java.sql.SQLException
Check locks with various commit sequences.

Parameters:
conn - Initialized connection
stmt - stmt to use for select from table
action - 0 = autocommit only 1 = commit with ResultSet open 2 = rollback with ResultSet open
Throws:
java.sql.SQLException

locksHeld

private boolean locksHeld()
                   throws java.sql.SQLException
Returns:
true if locks are held.
Throws:
java.sql.SQLException

suite

public static junit.framework.Test suite()
Runs the test fixtures in embedded and client.

Returns:
test suite

baseSuite

public static junit.framework.Test baseSuite(java.lang.String name)

Built on Wed 2009-11-25 18:43:31-0800, from revision 884373

Apache Derby V10.6 Internals - Copyright © 2004,2008 The Apache Software Foundation. All Rights Reserved.