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

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.SURBaseTest
                      extended by org.apache.derbyTesting.functionTests.tests.jdbcapi.HoldabilityTest
All Implemented Interfaces:
junit.framework.Test

public class HoldabilityTest
extends SURBaseTest

Tests holdable resultsets.


Field Summary
private static java.lang.String selectStatement
           
 
Fields inherited from class org.apache.derbyTesting.functionTests.tests.jdbcapi.SURBaseTest
CURSOR_NOT_POSITIONED_ON_INSERT_ROW, CURSOR_NOT_UPDATABLE_SQL_STATE, CURSOR_OPERATION_CONFLICT, FOR_UPDATE_NOT_PERMITTED_SQL_STATE, INVALID_CURSOR_STATE_NO_CURRENT_ROW, LOCK_TIMEOUT_EXPRESSION_SQL_STATE, LOCK_TIMEOUT_SQL_STATE, QUERY_NOT_QUALIFIED_FOR_UPDATABLE_RESULTSET, recordCount, RESULTSET_NOT_UPDATABLE_SQL_STATE
 
Fields inherited from class org.apache.derbyTesting.junit.BaseTestCase
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE
 
Constructor Summary
HoldabilityTest(java.lang.String name)
          Creates a new instance of HoldabilityTest
 
Method Summary
private  void onlineCompress(boolean purge, boolean defragment, boolean truncate)
          Executes online compress
protected  void setUp()
          Sets up the connection, then create the data model
static junit.framework.Test suite()
           
protected  void tearDown()
          Tear down this fixture, sub-classes should call super.tearDown().
 void testCompressOnHeldForwardOnlyUpdatableResultSetScanInit()
          Test that a forward only resultset can be held over commit while it has not done any scanning, and that after a compress it is still updatable.
 void testCompressOnHeldForwardOnlyUpdatableResultSetScanInProgress()
          Test that a forward only resultset can be held over commit while it is in progress of scanning, and that after a compress the resultset is still updatable.
 void testCompressOnHeldScrollableUpdatableResultSetScanDone()
          Test that running a compress on a holdable scrollable updatable resultset will invalidate the Resultset from doing updates after a renavigate.
 void testCompressOnHeldScrollableUpdatableResultSetScanInit()
          Test that running a compress on a holdable scrollable updatable resultset will not invalidate the ResultSet from doing updates, if the scan is initialized
 void testCompressOnHeldScrollableUpdatableResultSetScanInProgress()
          Test that running a compress on a holdable scrollable updatable resultset will invalidate the Resultset from doing updates after a renavigate, if the scan is in progress.
 void testHeldForwardOnlyResultSetScanInit()
          Test that a forward only resultset can be held over commit while it has not done any scanning
 void testHeldForwardOnlyResultSetScanInProgress()
          Test that a forward only resultset can be held over commit while it is in progress of scanning
 void testHeldForwardOnlyUpdatableResultSetScanInit()
          Test that a forward only resultset can be held over commit while it has not done any scanning, and be updatable
 void testHeldForwardOnlyUpdatableResultSetScanInProgress()
          Test that a forward only resultset can be held over commit while it is in progress of scanning
 void testHeldScrollableResultSetScanDone()
          Test that a scrollable resultset can be held over commit after the resultset has been populated
 void testHeldScrollableResultSetScanInit()
          Test that a scrollable resultset can be held over commit while it has not done any scanning
 void testHeldScrollableResultSetScanInProgress()
          Test that a scrollable resultset can be held over commit while it is in progress of scanning
 void testHeldScrollableUpdatableResultSetScanDone()
          Test that a scrollable updatable resultset can be held over commit after the resultset has been populated
 void testHeldScrollableUpdatableResultSetScanInit()
          Test that a scrollable updatable resultset can be held over commit while it has not done any scanning
 void testHeldScrollableUpdatableResultSetScanInProgress()
          Test that a scrollable updatable resultset can be held over commit while it is in progress of scanning
 void testUpdateRowAfterCommitOnHeldForwardOnlyResultSet()
          Test that updateRow() after a commit requires a renavigation on a held forward only ResulTset.
 void testUpdateRowAfterCommitOnHeldScrollInsensitiveResultSet()
          Test that updateRow() after a commit requires a renavigation on a held scrollinsensitve ResulTset.
private  void verifyCompressInvalidation(java.sql.ResultSet rs)
          Verifies that the ResultSet is invalidated from doing updates after a compress.
private  void verifyResultSetUpdatableAfterCompress(java.sql.ResultSet rs)
          Verifies that even after a compress, the ResultSet of this type and state is updatable.
 
Methods inherited from class org.apache.derbyTesting.functionTests.tests.jdbcapi.SURBaseTest
assertFailOnUpdate, assertWarning, initializeConnection, scrollBackward, scrollBackwardAndUpdate, scrollBackwardAndUpdatePositioned, scrollForward, scrollForwardAndUpdate, scrollForwardAndUpdatePositioned, updateTuple, updateTuplePositioned, verifyTuple
 
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, openConnection, openDefaultConnection, openDefaultConnection, openUserConnection, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, rollback, runScript, runScript, runSQLCommands, setAutoCommit, 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, 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

selectStatement

private static final java.lang.String selectStatement
See Also:
Constant Field Values
Constructor Detail

HoldabilityTest

public HoldabilityTest(java.lang.String name)
Creates a new instance of HoldabilityTest

Method Detail

suite

public static junit.framework.Test suite()

setUp

protected void setUp()
              throws java.lang.Exception
Sets up the connection, then create the data model

Overrides:
setUp in class junit.framework.TestCase
Throws:
java.lang.Exception

tearDown

protected void tearDown()
                 throws java.lang.Exception
Description copied from class: BaseJDBCTestCase
Tear down this fixture, sub-classes should call super.tearDown(). This cleanups & closes the connection if it is open and any statement objects returned through the utility methods.

Overrides:
tearDown in class BaseJDBCTestCase
Throws:
java.lang.Exception

testHeldForwardOnlyResultSetScanInit

public void testHeldForwardOnlyResultSetScanInit()
                                          throws java.sql.SQLException
Test that a forward only resultset can be held over commit while it has not done any scanning

Throws:
java.sql.SQLException

testHeldForwardOnlyResultSetScanInProgress

public void testHeldForwardOnlyResultSetScanInProgress()
                                                throws java.sql.SQLException
Test that a forward only resultset can be held over commit while it is in progress of scanning

Throws:
java.sql.SQLException

testHeldForwardOnlyUpdatableResultSetScanInit

public void testHeldForwardOnlyUpdatableResultSetScanInit()
                                                   throws java.sql.SQLException
Test that a forward only resultset can be held over commit while it has not done any scanning, and be updatable

Throws:
java.sql.SQLException

testCompressOnHeldForwardOnlyUpdatableResultSetScanInProgress

public void testCompressOnHeldForwardOnlyUpdatableResultSetScanInProgress()
                                                                   throws java.sql.SQLException
Test that a forward only resultset can be held over commit while it is in progress of scanning, and that after a compress the resultset is still updatable.

Throws:
java.sql.SQLException

testCompressOnHeldForwardOnlyUpdatableResultSetScanInit

public void testCompressOnHeldForwardOnlyUpdatableResultSetScanInit()
                                                             throws java.sql.SQLException
Test that a forward only resultset can be held over commit while it has not done any scanning, and that after a compress it is still updatable.

Throws:
java.sql.SQLException

testHeldForwardOnlyUpdatableResultSetScanInProgress

public void testHeldForwardOnlyUpdatableResultSetScanInProgress()
                                                         throws java.sql.SQLException
Test that a forward only resultset can be held over commit while it is in progress of scanning

Throws:
java.sql.SQLException

testHeldScrollableResultSetScanInit

public void testHeldScrollableResultSetScanInit()
                                         throws java.sql.SQLException
Test that a scrollable resultset can be held over commit while it has not done any scanning

Throws:
java.sql.SQLException

testHeldScrollableResultSetScanInProgress

public void testHeldScrollableResultSetScanInProgress()
                                               throws java.sql.SQLException
Test that a scrollable resultset can be held over commit while it is in progress of scanning

Throws:
java.sql.SQLException

testHeldScrollableResultSetScanDone

public void testHeldScrollableResultSetScanDone()
                                         throws java.sql.SQLException
Test that a scrollable resultset can be held over commit after the resultset has been populated

Throws:
java.sql.SQLException

testHeldScrollableUpdatableResultSetScanInit

public void testHeldScrollableUpdatableResultSetScanInit()
                                                  throws java.sql.SQLException
Test that a scrollable updatable resultset can be held over commit while it has not done any scanning

Throws:
java.sql.SQLException

testHeldScrollableUpdatableResultSetScanInProgress

public void testHeldScrollableUpdatableResultSetScanInProgress()
                                                        throws java.sql.SQLException
Test that a scrollable updatable resultset can be held over commit while it is in progress of scanning

Throws:
java.sql.SQLException

testHeldScrollableUpdatableResultSetScanDone

public void testHeldScrollableUpdatableResultSetScanDone()
                                                  throws java.sql.SQLException
Test that a scrollable updatable resultset can be held over commit after the resultset has been populated

Throws:
java.sql.SQLException

testUpdateRowAfterCommitOnHeldForwardOnlyResultSet

public void testUpdateRowAfterCommitOnHeldForwardOnlyResultSet()
                                                        throws java.sql.SQLException
Test that updateRow() after a commit requires a renavigation on a held forward only ResulTset.

Throws:
java.sql.SQLException

testUpdateRowAfterCommitOnHeldScrollInsensitiveResultSet

public void testUpdateRowAfterCommitOnHeldScrollInsensitiveResultSet()
                                                              throws java.sql.SQLException
Test that updateRow() after a commit requires a renavigation on a held scrollinsensitve ResulTset.

Throws:
java.sql.SQLException

testCompressOnHeldScrollableUpdatableResultSetScanInit

public void testCompressOnHeldScrollableUpdatableResultSetScanInit()
                                                            throws java.sql.SQLException
Test that running a compress on a holdable scrollable updatable resultset will not invalidate the ResultSet from doing updates, if the scan is initialized

Throws:
java.sql.SQLException

testCompressOnHeldScrollableUpdatableResultSetScanInProgress

public void testCompressOnHeldScrollableUpdatableResultSetScanInProgress()
                                                                  throws java.sql.SQLException
Test that running a compress on a holdable scrollable updatable resultset will invalidate the Resultset from doing updates after a renavigate, if the scan is in progress.

Throws:
java.sql.SQLException

testCompressOnHeldScrollableUpdatableResultSetScanDone

public void testCompressOnHeldScrollableUpdatableResultSetScanDone()
                                                            throws java.sql.SQLException
Test that running a compress on a holdable scrollable updatable resultset will invalidate the Resultset from doing updates after a renavigate.

Throws:
java.sql.SQLException

verifyResultSetUpdatableAfterCompress

private void verifyResultSetUpdatableAfterCompress(java.sql.ResultSet rs)
                                            throws java.sql.SQLException
Verifies that even after a compress, the ResultSet of this type and state is updatable.

Throws:
java.sql.SQLException

verifyCompressInvalidation

private void verifyCompressInvalidation(java.sql.ResultSet rs)
                                 throws java.sql.SQLException
Verifies that the ResultSet is invalidated from doing updates after a compress.

Parameters:
rs - ResultSet which we test is being invalidated
Throws:
java.sql.SQLException

onlineCompress

private void onlineCompress(boolean purge,
                            boolean defragment,
                            boolean truncate)
                     throws java.sql.SQLException
Executes online compress

Parameters:
purge - set to true to purge rows
defragment - set to true to defragment rows
truncate - set to true to truncate pages
Throws:
java.sql.SQLException

Built on Thu 2009-11-26 18:42:53-0800, from revision 884739

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