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

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.StatementJdbc30Test
All Implemented Interfaces:
junit.framework.Test

public class StatementJdbc30Test
extends BaseJDBCTestCase

Test the Statement class in JDBC 30. This test converts the old jdbcapi/statementJdbc30.java test to JUnit.


Field Summary
private static java.lang.String CLIENT_SUITE_NAME
           
 
Fields inherited from class org.apache.derbyTesting.junit.BaseTestCase
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE
 
Constructor Summary
StatementJdbc30Test(java.lang.String name)
          Create a test with the given name.
 
Method Summary
private  void assertFailedExecuteUpdateForColumnIndex(java.sql.SQLException ex)
          Assert executeUpdateForColumnIndex failed.
private  void assertFailedExecuteUpdateForColumnName(java.sql.SQLException ex)
          Assert executeUpdateForColumnName failed.
private static junit.framework.Test baseSuite(java.lang.String name)
           
static junit.framework.Test suite()
          Create suite containing client and embedded tests and to run all tests in this class
 void testExecuteNoAutoGenColumnIndex()
          After doing an insert into a table that doesn't have a generated column, the test should fail.
 void testExecuteNoAutoGenColumnName()
          After doing an insert into a table that doesn't have a generated column, the test should fail.
 void testExecuteUpdateNoAutoGenColumnIndex()
          Tests stmt.executeUpdate(String, int[]) After doing an insert into a table that doesn't have a generated column, the test should fail.
 void testExecuteUpdateNoAutoGenColumnName()
          Tests stmt.executeUpdate(String, String[]) After doing an insert into a table that doesn't have a generated column, the test should fail.
 void testGetGenerateKeys()
          Testing stmt.getGeneratedKeys()
 void testGetMoreResults()
          Tests stmt.getMoreResults(int)
 void testGetResultSetHoldability()
          Testing stmt.getResultSetHoldability()
 void testInsertNoGenKeys()
          Tests stmt.executeUpdate(String, int) with NO_GENERATED_KEYS.
 void testReadingData()
          Tests reading data from database
 void testSelectNoGenKeys()
          Tests stmt.execute(String, int) with NO_GENERATED_KEYS.
 void xtestMaxOpenStatementsWithQueryTimeout()
          DERBY-3198: Verify that we can have at least 16383 open Statements with query timeout.
 void xtestMultiExecWithQueryTimeout()
          DERBY-3198: Verify that a statement can be executed more than 32000 times, even when query timeout is enabled.
 
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

CLIENT_SUITE_NAME

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

StatementJdbc30Test

public StatementJdbc30Test(java.lang.String name)
Create a test with the given name.

Parameters:
name - name of the test.
Method Detail

suite

public static junit.framework.Test suite()
Create suite containing client and embedded tests and to run all tests in this class


baseSuite

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

testReadingData

public void testReadingData()
                     throws java.sql.SQLException
Tests reading data from database

Throws:
java.sql.SQLException - if error occurs

testGetMoreResults

public void testGetMoreResults()
                        throws java.sql.SQLException
Tests stmt.getMoreResults(int)

Throws:
java.sql.SQLException - if error occurs

testInsertNoGenKeys

public void testInsertNoGenKeys()
                         throws java.sql.SQLException
Tests stmt.executeUpdate(String, int) with NO_GENERATED_KEYS.

Throws:
java.sql.SQLException - if error occurs

testExecuteUpdateNoAutoGenColumnIndex

public void testExecuteUpdateNoAutoGenColumnIndex()
                                           throws java.sql.SQLException
Tests stmt.executeUpdate(String, int[]) After doing an insert into a table that doesn't have a generated column, the test should fail.

Throws:
java.sql.SQLException

testExecuteUpdateNoAutoGenColumnName

public void testExecuteUpdateNoAutoGenColumnName()
                                          throws java.sql.SQLException
Tests stmt.executeUpdate(String, String[]) After doing an insert into a table that doesn't have a generated column, the test should fail.

Throws:
java.sql.SQLException

testSelectNoGenKeys

public void testSelectNoGenKeys()
                         throws java.sql.SQLException
Tests stmt.execute(String, int) with NO_GENERATED_KEYS.

Throws:
java.sql.SQLException - if error occurs

testExecuteNoAutoGenColumnIndex

public void testExecuteNoAutoGenColumnIndex()
                                     throws java.sql.SQLException
After doing an insert into a table that doesn't have a generated column, the test should fail.

Throws:
java.sql.SQLException

assertFailedExecuteUpdateForColumnIndex

private void assertFailedExecuteUpdateForColumnIndex(java.sql.SQLException ex)
Assert executeUpdateForColumnIndex failed. There are different SQLStates for ColumnName(X0X0E) and ColumnIndex(X0X0F) as well as client and server

Parameters:
ex -

assertFailedExecuteUpdateForColumnName

private void assertFailedExecuteUpdateForColumnName(java.sql.SQLException ex)
Assert executeUpdateForColumnName failed. There are different SQLStates for ColumnIndex(X0X0F) and ColumnNam(X0X0E) as well as client and server.

Parameters:
ex -

testExecuteNoAutoGenColumnName

public void testExecuteNoAutoGenColumnName()
                                    throws java.sql.SQLException
After doing an insert into a table that doesn't have a generated column, the test should fail.

Throws:
java.sql.SQLException

xtestMultiExecWithQueryTimeout

public void xtestMultiExecWithQueryTimeout()
                                    throws java.sql.SQLException
DERBY-3198: Verify that a statement can be executed more than 32000 times, even when query timeout is enabled.

Throws:
java.sql.SQLException

xtestMaxOpenStatementsWithQueryTimeout

public void xtestMaxOpenStatementsWithQueryTimeout()
                                            throws java.sql.SQLException
DERBY-3198: Verify that we can have at least 16383 open Statements with query timeout. With query timeout, each Statement holds on to 2 Section objects until it is closed.

Throws:
java.sql.SQLException

testGetResultSetHoldability

public void testGetResultSetHoldability()
                                 throws java.sql.SQLException
Testing stmt.getResultSetHoldability()

Throws:
java.sql.SQLException

testGetGenerateKeys

public void testGetGenerateKeys()
                         throws java.sql.SQLException
Testing stmt.getGeneratedKeys()

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.