public class ResultSetTest extends Wrapper41Test
| Modifier and Type | Field and Description |
|---|---|
private static byte[] |
BYTES1 |
private static byte[] |
BYTES2 |
private static int |
insertKey
Key used to identify inserted rows.
|
private int |
key
Default row identifier used by the tests.
|
private java.sql.ResultSet |
rs
Default resultset used by the tests.
|
private java.sql.Statement |
stmt
Statement used to obtain default resultset.
|
private static java.lang.String |
str1 |
private static java.lang.String |
str2 |
BINARY_VALUE, TIME_VALUE, TIMESTAMP_VALUEDEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE| Constructor and Description |
|---|
ResultSetTest(java.lang.String name)
Create test with given name.
|
| Modifier and Type | Method and Description |
|---|---|
private static junit.framework.Test |
decorateTestSuite(junit.framework.Test rsSuite) |
private java.sql.ResultSet |
fetch(java.lang.String colName,
int key)
Fetch the specified row.
|
private java.sql.ResultSet |
fetchUpd(java.lang.String colName,
int key)
Fetch the specified row for update.
|
static void |
getResultSetWithHoldability(int holdability,
java.sql.ResultSet[] rs)
Method invoked by
testGetHoldability() (as a stored
procedure) to retrieve a result set with a given holdability. |
private static java.lang.String |
holdabilityString(int holdability)
Convert holdability from an integer to a readable string.
|
static java.sql.Blob |
makeBlob()
Function for making a Blob.
|
private java.sql.PreparedStatement |
prep(java.lang.String colName)
Prepare commonly used statement to insert a row.
|
private static int |
requestKey()
Get a key that is used to identify an inserted row.
|
protected void |
setUp() |
static junit.framework.Test |
suite()
T E S T S E T U P *
|
protected void |
tearDown()
Tear down this fixture, sub-classes should call
super.tearDown().
|
void |
testDerby1368()
EOFException when reading from blob's binary stream
and calling length() twice
Test with and without lengthless insert.
|
void |
testDerby1368(boolean lengthless)
EOFException when reading from blob's binary stream
and calling length() twice
|
void |
testExceptionWhenClosed()
Test that an exception is thrown when methods are called
on a closed result set (DERBY-1060).
|
void |
testGetHoldability()
Tests that
ResultSet.getHoldability() has the
correct behaviour. |
void |
testGetNCharacterStreamIntNotImplemented() |
void |
testGetNCharaterStreamStringNotImplemented() |
void |
testGetNClobNotIntImplemented() |
void |
testGetNClobStringNotImplemented() |
void |
testGetNStringIntNotImplemented() |
void |
testGetNStringStringNotImplemented() |
void |
testGetSQLXMLIntNotImplemented() |
void |
testGetSQLXMLStringNotImplemented() |
void |
testIsClosed()
Tests that
ResultSet.isClosed() returns the
correct value in different situations. |
void |
testIsClosedOnNonHoldableResultSet()
Test that a
ResultSet is marked as closed after commit if its
holdability is CLOSE_CURSORS_AT_COMMIT (DERBY-3404). |
void |
testJDBC4_1()
Test the JDBC 4.1 extensions.
|
void |
testUpdateAsciiStream()
This methods tests the ResultSet interface method
updateAsciiStream
|
void |
testUpdateAsciiStreamLengthless() |
void |
testUpdateAsciiStreamLengthlessParameterName() |
void |
testUpdateAsciiStreamStringParameterName()
This methods tests the ResultSet interface method
updateAsciiStream
|
void |
testUpdateBinaryStream()
This methods tests the ResultSet interface method
updateBinaryStream
|
void |
testUpdateBinaryStreamLengthless()
Test
updateBinaryStream on a BINARY column, without
specifying length of inputstream. |
void |
testUpdateBinaryStreamLengthlessBlob()
Test
updateBinaryStream on a BLOB column, without
specifying length of inputstream. |
void |
testUpdateBinaryStreamLengthlessParameterName() |
void |
testUpdateBinaryStreamStringParameterName()
This methods tests the ResultSet interface method
updateBinaryStream
|
void |
testUpdateBlob()
This methods tests the ResultSet interface method
updateBlob
|
void |
testUpdateBlobLengthless() |
void |
testUpdateBlobStringParameterName()
This methods tests the ResultSet interface method
updateBlob
|
void |
testUpdateBlobStringParameterNameWithLengthofIS()
Tests the updateBlob that accepts a input stream and the length of the IS
and the parameter name String.
|
void |
testUpdateBlobWithLengthofIS()
tests the updateBlob that accepts a input stream and the length of the IS.
|
void |
testUpdateBlobWithStreamLengthlessParameterName() |
void |
testUpdateCharacterStream()
This methods tests the ResultSet interface method
updateCharacterStream
|
void |
testUpdateCharacterStreamLengthless() |
void |
testUpdateCharacterStreamLengthlessParameterName() |
void |
testUpdateCharacterStreamStringParameterName()
This methods tests the ResultSet interface method
updateCharacterStream
|
void |
testUpdateClob()
This methods tests the ResultSet interface method
updateClob
|
void |
testUpdateClobLengthless() |
void |
testUpdateClobLengthlessParameterName() |
void |
testUpdateClobStringParameterName()
This methods tests the ResultSet interface method
updateClob
|
void |
testUpdateClobStringParameterNameWithLengthofIS()
Tests the updateClob that accepts a input stream and the length of the IS
and the parameter name String.
|
void |
testUpdateClobwithLengthofIS()
Test the Clob method that accepts a Input Stream and its length
as input parameter.
|
void |
testUpdateNCharacterStreamIntLengthLessNotImplemented() |
void |
testUpdateNCharacterStreamIntNotImplemented() |
void |
testUpdateNCharacterStreamStringLengthlessNotImplemented() |
void |
testUpdateNCharacterStreamStringNotImplemented() |
void |
testUpdateNClobIntLengthlessNotImplemented() |
void |
testUpdateNClobIntNotImplemented() |
void |
testUpdateNClobStringLengthlessNotImplemented() |
void |
testUpdateNClobStringNotImplemented() |
void |
testUpdateNStringIntNotImplemented() |
void |
testUpdateNStringStringNotImplemented() |
void |
testUpdateSQLXMLIntNotImplemented() |
void |
testUpdateSQLXMLStringNotImplemented() |
void |
testWrapper()
Tests the wrapper methods isWrapperFor and unwrap.
|
static void |
threeResultSets(java.sql.ResultSet[] rs1,
java.sql.ResultSet[] rs2,
java.sql.ResultSet[] rs3)
Method that is invoked by
testIsClosed() (as a
stored procedure) to retrieve three result sets. |
private void |
vetDataTypeCount(java.sql.Connection conn) |
examineJDBC4_1extensions, prepareCall, prepareStatementassertCallError, assertCheckTable, assertCompileError, assertEquals, assertEquals, assertEquals, assertEquivalentDataType, assertErrorCode, assertGetIntError, assertNextError, assertPreparedStatementError, assertSQLExceptionEquals, assertSQLState, assertSQLState, assertStatementError, assertStatementError, assertStatementError, assertStatementError, assertStatementErrorUnordered, assertTableRowCount, assertUpdateCount, assertUpdateCount, assertWarning, checkAllConsistency, checkEstimatedRowCount, closeStatement, commit, createStatement, createStatement, createStatement, dropTable, dropTable, dropView, dropView, emptyStatementCache, getClientTransactionID, getConnection, getDatabaseProperty, getLastSQLException, initializeConnection, openConnection, openDefaultConnection, openDefaultConnection, openDefaultConnection, openUserConnection, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, rollback, runBare, runBareOverridable, runScript, runScript, runSQLCommands, setAutoCommit, usingDB2Client, usingDerbyNetClient, usingEmbeddedalarm, assertDirectoryDeleted, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertExecJavaCmdAsExpected, assertLaunchedJUnitTestMethod, assertLaunchedJUnitTestMethod, assertSecurityManager, assertThrowableEquals, currentDirectory, execJavaCmd, execJavaCmd, fail, getClassVersionMajor, getEmmaJar, getFailureFolder, getFilesWith, getJavaExecutableName, getSystemProperty, getTestConfiguration, getTestResource, hasInterruptibleIO, isCVM, isIBMJVM, isJ9Platform, isJava5, isJava7, isJava8, isPhoneME, isPlatform, isSunJVM, isWindowsPlatform, openTestResource, println, printStackTrace, readProcessOutput, removeDirectory, removeDirectory, removeFiles, removeSystemProperty, runsWithEmma, runsWithJaCoCo, setSystemProperty, sleep, sleepAtLeastOneTick, traceitassertEquals, 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, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runTest, setName, toStringprivate static final byte[] BYTES1
private static final byte[] BYTES2
private static final java.lang.String str1
private static final java.lang.String str2
private static int insertKey
requestKey to obtain it.private java.sql.Statement stmt
private java.sql.ResultSet rs
private int key
public ResultSetTest(java.lang.String name)
name - name of the test.protected void setUp()
throws java.sql.SQLException
setUp in class junit.framework.TestCasejava.sql.SQLExceptionprotected void tearDown()
throws java.lang.Exception
BaseJDBCTestCasetearDown in class BaseJDBCTestCasejava.lang.Exceptionpublic void testGetNCharacterStreamIntNotImplemented()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testGetNCharaterStreamStringNotImplemented()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testGetNClobNotIntImplemented()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testGetNClobStringNotImplemented()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testGetNStringIntNotImplemented()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testGetNStringStringNotImplemented()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testGetSQLXMLIntNotImplemented()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testGetSQLXMLStringNotImplemented()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testUpdateNCharacterStreamIntNotImplemented()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testUpdateNCharacterStreamIntLengthLessNotImplemented()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testUpdateNCharacterStreamStringNotImplemented()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testUpdateNCharacterStreamStringLengthlessNotImplemented()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testUpdateNClobIntNotImplemented()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testUpdateNClobIntLengthlessNotImplemented()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testUpdateNClobStringNotImplemented()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testUpdateNClobStringLengthlessNotImplemented()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testUpdateNStringIntNotImplemented()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testUpdateNStringStringNotImplemented()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testUpdateSQLXMLIntNotImplemented()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testUpdateSQLXMLStringNotImplemented()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testUpdateBinaryStream()
throws java.lang.Exception
java.sql.SQLException - if some error occurs while calling the methodjava.lang.Exceptionpublic void testUpdateAsciiStream()
throws java.lang.Exception
java.sql.SQLException - if some error occurs while calling the methodjava.lang.Exceptionpublic void testUpdateCharacterStream()
throws java.lang.Exception
java.sql.SQLException - if some error occurs while calling the methodjava.lang.Exceptionpublic void testUpdateBinaryStreamStringParameterName()
throws java.lang.Exception
java.sql.SQLException - if some error occurs while calling the methodjava.lang.Exceptionpublic void testUpdateBinaryStreamLengthless()
throws java.io.IOException,
java.sql.SQLException
updateBinaryStream on a BINARY column, without
specifying length of inputstream.java.io.IOExceptionjava.sql.SQLExceptionpublic void testUpdateBinaryStreamLengthlessBlob()
throws java.io.IOException,
java.sql.SQLException
updateBinaryStream on a BLOB column, without
specifying length of inputstream.java.io.IOExceptionjava.sql.SQLExceptionpublic void testUpdateBinaryStreamLengthlessParameterName()
throws java.io.IOException,
java.sql.SQLException
java.io.IOExceptionjava.sql.SQLExceptionpublic void testUpdateAsciiStreamStringParameterName()
throws java.lang.Exception
java.sql.SQLException - if some error occurs while calling the methodjava.lang.Exceptionpublic void testUpdateAsciiStreamLengthless()
throws java.io.IOException,
java.sql.SQLException
java.io.IOExceptionjava.sql.SQLExceptionpublic void testUpdateAsciiStreamLengthlessParameterName()
throws java.io.IOException,
java.sql.SQLException
java.io.IOExceptionjava.sql.SQLExceptionpublic void testUpdateCharacterStreamStringParameterName()
throws java.lang.Exception
java.sql.SQLException - if some error occurs while calling the methodjava.lang.Exceptionpublic void testUpdateCharacterStreamLengthless()
throws java.io.IOException,
java.sql.SQLException
java.io.IOExceptionjava.sql.SQLExceptionpublic void testUpdateCharacterStreamLengthlessParameterName()
throws java.io.IOException,
java.sql.SQLException
java.io.IOExceptionjava.sql.SQLExceptionpublic void testUpdateClob()
throws java.lang.Exception
java.sql.SQLException - if some error occurs while calling the methodjava.lang.Exceptionpublic void testUpdateClobLengthless()
throws java.lang.Exception
java.lang.Exceptionpublic void testUpdateClobwithLengthofIS()
throws java.lang.Exception
java.lang.Exceptionpublic void testUpdateBlob()
throws java.lang.Exception
java.sql.SQLException - if some error occurs while calling the methodjava.lang.Exceptionpublic void testUpdateBlobLengthless()
throws java.lang.Exception
java.lang.Exceptionpublic void testUpdateBlobWithLengthofIS()
throws java.lang.Exception
an - Exceptionjava.lang.Exceptionpublic void testUpdateBlobStringParameterNameWithLengthofIS()
throws java.lang.Exception
an - Exceptionjava.lang.Exceptionpublic void testUpdateClobStringParameterName()
throws java.lang.Exception
java.sql.SQLException - if some error occurs while calling the methodjava.lang.Exceptionpublic void testUpdateClobLengthlessParameterName()
throws java.lang.Exception
java.lang.Exceptionpublic void testUpdateClobStringParameterNameWithLengthofIS()
throws java.lang.Exception
an - Exceptionjava.lang.Exceptionpublic void testUpdateBlobStringParameterName()
throws java.lang.Exception
java.sql.SQLException - if some error occurs while calling the methodjava.lang.Exceptionpublic void testUpdateBlobWithStreamLengthlessParameterName()
throws java.lang.Exception
java.lang.Exceptionpublic void testGetHoldability()
throws java.sql.SQLException,
java.lang.Exception
ResultSet.getHoldability() has the
correct behaviour.java.sql.SQLException - Thrown if some unexpected error happensjava.lang.Exception - Thrown if some unexpected error happenspublic void testIsClosed()
throws java.sql.SQLException
ResultSet.isClosed() returns the
correct value in different situations.java.sql.SQLException - Thrown if some unexpected error happenspublic void testIsClosedOnNonHoldableResultSet()
throws java.sql.SQLException
ResultSet is marked as closed after commit if its
holdability is CLOSE_CURSORS_AT_COMMIT (DERBY-3404).java.sql.SQLExceptionpublic void testExceptionWhenClosed()
throws java.lang.NoSuchMethodException,
java.lang.IllegalAccessException,
java.lang.reflect.InvocationTargetException,
java.sql.SQLException
java.sql.SQLException - Thrown if some unexpected error happensjava.lang.NoSuchMethodExceptionjava.lang.IllegalAccessExceptionjava.lang.reflect.InvocationTargetExceptionpublic void testWrapper()
throws java.sql.SQLException
java.sql.SQLException - Thrown if some unexpected error happenspublic static junit.framework.Test suite()
private static junit.framework.Test decorateTestSuite(junit.framework.Test rsSuite)
private static final int requestKey()
private java.sql.PreparedStatement prep(java.lang.String colName)
throws java.sql.SQLException
colName - name of the column to insert intojava.sql.SQLExceptionprivate java.sql.ResultSet fetchUpd(java.lang.String colName,
int key)
throws java.sql.SQLException
colName - name of the column to fetchkey - identifier for row to fetchResultSet with zero or one row, depending on
the key usedjava.sql.SQLExceptionprivate java.sql.ResultSet fetch(java.lang.String colName,
int key)
throws java.sql.SQLException
colName - name of the column to fetchkey - identifier for row to fetchResultSet with zero or one row, depending on
the key usedjava.sql.SQLExceptionprivate static java.lang.String holdabilityString(int holdability)
holdability - an int value representing a holdabilityString value representing the same holdabilitypublic static void threeResultSets(java.sql.ResultSet[] rs1,
java.sql.ResultSet[] rs2,
java.sql.ResultSet[] rs3)
throws java.sql.SQLException
testIsClosed() (as a
stored procedure) to retrieve three result sets.rs1 - first result setrs2 - second result setrs3 - third result setjava.sql.SQLException - if a database error occurspublic static void getResultSetWithHoldability(int holdability,
java.sql.ResultSet[] rs)
throws java.sql.SQLException
testGetHoldability() (as a stored
procedure) to retrieve a result set with a given holdability.holdability - requested holdabilityrs - result set returned from stored procedurejava.sql.SQLException - if a database error occurspublic void testDerby1368()
throws java.sql.SQLException,
java.io.IOException
java.sql.SQLExceptionjava.io.IOExceptionpublic void testDerby1368(boolean lengthless)
throws java.sql.SQLException,
java.io.IOException
lengthless - Insert data with lengthless method.java.sql.SQLExceptionjava.io.IOExceptionpublic void testJDBC4_1()
throws java.lang.Exception
java.lang.Exceptionprivate void vetDataTypeCount(java.sql.Connection conn)
throws java.lang.Exception
java.lang.Exceptionpublic static final java.sql.Blob makeBlob()
throws java.lang.Exception
Function for making a Blob.
java.lang.ExceptionApache Derby V10.10 Internals - Copyright © 2004,2014 The Apache Software Foundation. All Rights Reserved.