public class BlobClob4BlobTest extends BaseJDBCTestCase
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
BLOB_BAD_POSITION |
private static java.lang.String |
BLOB_NONPOSITIVE_LENGTH |
private static java.lang.String |
BLOB_NULL_PATTERN_OR_SEARCH_STR |
private static java.lang.String |
BLOB_POSITION_TOO_LARGE |
private static java.lang.String |
INVALID_LOB |
private static java.lang.String |
LANG_DATA_TYPE_GET_MISMATCH |
private static java.lang.String |
LOCK_TIMEOUT |
private static java.lang.String |
NO_CURRENT_CONNECTION |
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE
Constructor and Description |
---|
BlobClob4BlobTest(java.lang.String name)
Creates a new instance of BlobClob4BlobTest
|
Modifier and Type | Method and Description |
---|---|
private static int |
addPatternPrefix(java.lang.StringBuffer sb,
char[] pattern,
int pl,
int fakeCount,
int pos) |
private static junit.framework.Test |
baseSuite(java.lang.String name) |
void |
baseTestPositionAgressive(boolean useOrderBy) |
void |
baseTestTriggersWithClobColumn(boolean useOrderBy)
Test triggers on CLOB columns.
|
private static void |
checkClob8(java.sql.Statement s,
java.sql.Clob pstr,
boolean useOrderBy) |
private static void |
checkClob8(java.sql.Statement s,
java.lang.String pstr,
boolean useOrderBy) |
private void |
checkContentsBeforeAndAfterUpdatingBlob(java.sql.ResultSet rs) |
private void |
checkContentsBeforeAndAfterUpdatingClob(java.sql.ResultSet rs) |
private void |
checkException(java.lang.String SQLState,
java.sql.SQLException se) |
private void |
checkSmallPageSize(java.sql.Statement st,
java.lang.String tblName) |
private boolean |
compareReaders(java.io.Reader origValue,
java.io.Reader newValue) |
private long |
getStreamCheckSum(java.io.InputStream in)
Get the CRC32 checksum of a stream, reading
its contents entirely and closing it.
|
private void |
insertDefaultData() |
private void |
insertLoopingAlphabetStreamData(java.sql.PreparedStatement ps,
CharAlphabet alphabet,
int lobLength) |
private void |
insertLoopingAlphabetStreamData(java.sql.PreparedStatement ps,
int lobLength) |
private void |
insertUnicodeData(java.lang.String[] unicodeString) |
private void |
runPositionClobTest() |
private void |
runPositionStringTest() |
void |
setUp()
Set up the conection to the database.
|
static junit.framework.Test |
suite() |
private static java.lang.String |
T8insert(java.sql.PreparedStatement ps,
int id,
char[] base,
int bl,
char[] pattern,
int pl,
int pos,
boolean addPattern) |
protected void |
tearDown()
Tear down this fixture, sub-classes should call
super.tearDown().
|
void |
testBlobAfterClose()
make sure blob is still around after we go to the next row,
after we close the result set, and after we close the statement
|
void |
testBlobAfterClosingConnection()
test accessing blob after closing the connection
|
void |
testBlobAfterCommit()
test accessing blob after commit
|
void |
testBlobContents(java.sql.ResultSet rs)
Test the contents of the testBlob table or ResultSet
with identical shape.
|
void |
testBlobFinalizer()
test blob finalizer closes the container
(should only release table and row locks that are read_committed)
NOTE: this test does not produce output since it needs to call the
garbage collector whose behaviour is unreliable.
|
void |
testBlobInsert()
From LobTest.java, test various inserts on a BLOB column
|
void |
testClobAfterClose()
make sure clob is still around after we go to the next row,
after we close the result set, and after we close the statement
|
void |
testClobAfterClosingConnection()
test accessing clob after closing the connection
|
void |
testClobAfterCommit()
test accessing clob after commit
|
void |
testClobAfterCommitWithSecondClob()
Make sure we get an error attempting to access the
lob after commit.
|
void |
testClobFinalizer()
test clob finalizer closes the container (should only release table and
row locks that are read_committed)
NOTE: this test does not produce output since it needs to call the
garbage collector whose behaviour is unreliable.
|
void |
testDerby5113()
Test that Blob.truncate() resets the position before copying the first
N bytes into a new holder object.
|
void |
testGetAsciiStream()
basic test of getAsciiStream also tests length
|
void |
testGetBinaryStream()
basic test of getBinaryStream also tests length
|
void |
testGetBlobBeforeAndAfterUpdate()
Test fix for derby-1382.
|
void |
testGetBlobBeforeAndAfterUpdateStream()
Test fix for derby-1421.
|
void |
testGetBlobFromIntColumn()
make sure cannot get a blob from an int column
|
void |
testGetBytes()
test getBytes
|
void |
testGetCharacterStream()
basic test of getCharacterStream also tests length
|
void |
testGetCharacterStreamWithUnicode()
test of getCharacterStream on a table containing unicode characters
|
void |
testGetClobBeforeAndAfterUpdate()
Test fix for derby-1382.
|
void |
testGetClobBeforeAndAfterUpdateStream()
Test fix for derby-1421.
|
void |
testGetClobFromIntColumn()
make sure cannot get a clob from an int column
|
void |
testGetSubString()
test Clob.getSubString() method
|
void |
testGetSubStringWithUnicode()
test getSubString with unicode
|
void |
testIsolationLevelChangeAfterRead()
Test that it is possible to change the isolation level after reading a
BLOB (DERBY-3427).
|
void |
testLockingBlob()
test locking
|
void |
testLockingClob()
test locking
|
void |
testLockingWithLongRowBlob()
test locking with a long row + long column
|
void |
testLockingWithLongRowClob()
test locking with a long row + long column
|
void |
testNegativeTestDerby265Blob()
Test fix for derby-265.
|
void |
testNegativeTestDerby265Clob()
Test fix for derby-265.
|
void |
testPositionAgressiveDoNotUseOrderBy() |
void |
testPositionAgressiveUseOrderBy()
Test Clob.position()
|
void |
testPositionBlob()
Test Blob.position() with blob argument
|
void |
testPositionBlobDeterministic()
Tests the
Blob.position using a deterministic sequence of
actions and arguments. |
void |
testPositionBytes()
test position with a byte[] argument
|
void |
testPositionClob()
test position with a Clob argument
|
void |
testPositionClobWithUnicode()
test position with a Clob argument containing unicode characters
|
void |
testPositionString()
test position with a String argument
|
void |
testPositionStringWithUnicode()
test position with a String argument and unicode data.
|
void |
testRaisingOfExceptionsBlob()
test raising of exceptions
|
void |
testRaisingOfExceptionsClob()
test raising of exceptions
|
void |
testRetrieveMoreThan32KLobs()
DERBY-3243 Fix ArrayIndexOutOfBounds Exception
if we retrieve more than 32K lobs
|
void |
testSelfDestructiveClob()
test behaviour of system with self destructive user
update a long column underneath a clob
|
void |
testSelfDestructiveClob2()
test behaviour of system with self destructive user
drop table and see what happens to the clob
expect an IOException when moving to a new page of the long column
|
void |
testSetBlob()
test setBlob
|
void |
testSetBlobOnIntColumn()
make sure setBlob doesn't work for an int column
|
void |
testSetCharacterStream()
Tests PreparedStatement.setCharacterStream
|
void |
testSetClob()
test setClob
|
void |
testSetClobToIntColumn()
make sure setClob doesn't work on an int column
|
void |
testSmallClobFields()
make sure clobs work for small CLOB fields also test length method
|
void |
testTriggersWithClobColumn()
Test triggers on CLOB columns.
|
void |
testTriggersWithClobColumnOrderBy()
Test triggers on CLOB columns.
|
void |
testTriggerWithBlobColumn()
Test triggers on BLOB columns.
|
void |
testUnconsumedParameter()
DERBY-3085.
|
void |
testVarbinary()
tests small blob abd length method
|
private void |
updateBlobWithUpdateBinaryStream(java.sql.ResultSet rs) |
private void |
updateClobWithUpdateCharacterStream(java.sql.ResultSet rs) |
private void |
verifyInterval(java.sql.Blob blob,
long pos,
int length,
int testNum,
int blobLength)
Verifies the value returned by the method Blob.getBytes()
|
private void |
verifyInterval(java.sql.Clob clob,
long pos,
int length,
int testNum,
int clobLength)
Verifies the value returned by the method Clob.getSubstring()
|
assertCallError, assertCheckTable, assertCommitError, assertCompileError, assertEquals, assertEquals, assertEquals, assertEquivalentDataType, assertErrorCode, assertGetIntError, assertNextError, assertPreparedStatementError, assertResults, assertResults, assertSQLExceptionEquals, assertSQLState, assertSQLState, assertStatementError, assertStatementError, assertStatementError, assertStatementError, assertStatementErrorUnordered, assertTableRowCount, assertUpdateCount, assertUpdateCount, assertWarning, chattyPrepare, chattyPrepareCall, checkAllConsistency, checkEstimatedRowCount, closeStatement, commit, createStatement, createStatement, createStatement, dropTable, dropTable, dropView, dropView, dumpRs, dumpRs, emptyStatementCache, executeQuery, expectCompilationError, expectCompilationError, expectExecutionError, getClientTransactionID, getConnection, getDatabaseProperty, getLastSQLException, goodStatement, goodUpdate, initializeConnection, openConnection, openDefaultConnection, openDefaultConnection, openDefaultConnection, openUserConnection, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, rollback, runBare, runBareOverridable, runScript, runScript, runSQLCommands, setAutoCommit, usingDB2Client, usingDerbyNetClient, usingEmbedded
alarm, assertDirectoryDeleted, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertExecJavaCmdAsExpected, assertLaunchedJUnitTestMethod, assertLaunchedJUnitTestMethod, assertSameNullness, assertSecurityManager, assertThrowableEquals, currentDirectory, execJavaCmd, execJavaCmd, execJavaCmd, fail, getClassVersionMajor, getEmmaJar, getFailureFolder, getFilesWith, getJavaExecutableName, getSystemProperty, getTestConfiguration, getTestResource, hasInterruptibleIO, isCVM, isIBMJVM, isJ9Platform, isJava5, isJava7, isPhoneME, isPlatform, isSunJVM, isWindowsPlatform, newAssertionFailedError, openTestResource, println, printStackTrace, readProcessOutput, removeDirectory, removeDirectory, removeFiles, removeSystemProperty, runsWithEmma, runsWithJaCoCo, setSystemErr, setSystemOut, setSystemProperty, sleep, sleepAtLeastOneTick, traceit, vmAtLeast
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, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runTest, setName, toString
private static final java.lang.String BLOB_BAD_POSITION
private static final java.lang.String BLOB_NONPOSITIVE_LENGTH
private static final java.lang.String BLOB_POSITION_TOO_LARGE
private static final java.lang.String LANG_DATA_TYPE_GET_MISMATCH
private static final java.lang.String BLOB_NULL_PATTERN_OR_SEARCH_STR
private static final java.lang.String LOCK_TIMEOUT
private static final java.lang.String NO_CURRENT_CONNECTION
private static final java.lang.String INVALID_LOB
public BlobClob4BlobTest(java.lang.String name)
public void setUp() throws java.lang.Exception
setUp
in class junit.framework.TestCase
java.lang.Exception
protected void tearDown() throws java.lang.Exception
BaseJDBCTestCase
tearDown
in class BaseJDBCTestCase
java.lang.Exception
public void testUnconsumedParameter() throws java.sql.SQLException
java.sql.SQLException
public void testIsolationLevelChangeAfterRead() throws java.sql.SQLException
java.sql.SQLException
public void testSetCharacterStream() throws java.lang.Exception
java.lang.Exception
public void testGetAsciiStream() throws java.lang.Exception
java.lang.Exception
public void testGetCharacterStream() throws java.lang.Exception
java.lang.Exception
public void testGetCharacterStreamWithUnicode() throws java.lang.Exception
java.lang.Exception
public void baseTestTriggersWithClobColumn(boolean useOrderBy) throws java.lang.Exception
java.lang.Exception
public void testTriggersWithClobColumnOrderBy() throws java.lang.Exception
Call with order by in the query, this causes a path through the sorter.
java.lang.Exception
public void testTriggersWithClobColumn() throws java.lang.Exception
Call with no order by in the query, thus a code path not through the sorter.
java.lang.Exception
public void testGetSubString() throws java.lang.Exception
java.lang.Exception
public void testGetSubStringWithUnicode() throws java.lang.Exception
java.lang.Exception
public void testPositionString() throws java.lang.Exception
java.lang.Exception
public void testPositionStringWithUnicode() throws java.lang.Exception
java.lang.Exception
private void runPositionStringTest() throws java.lang.Exception
java.lang.Exception
public void testPositionClob() throws java.lang.Exception
java.lang.Exception
public void testPositionClobWithUnicode() throws java.lang.Exception
java.lang.Exception
private void runPositionClobTest() throws java.lang.Exception
java.lang.Exception
public void testSmallClobFields() throws java.lang.Exception
java.lang.Exception
public void testGetClobFromIntColumn() throws java.lang.Exception
java.lang.Exception
public void testSetClobToIntColumn() throws java.lang.Exception
java.lang.Exception
public void testRaisingOfExceptionsClob() throws java.lang.Exception
java.lang.Exception
public void testSetClob() throws java.lang.Exception
java.lang.Exception
public void testPositionAgressiveUseOrderBy() throws java.lang.Exception
java.lang.Exception
public void testPositionAgressiveDoNotUseOrderBy() throws java.lang.Exception
java.lang.Exception
public void baseTestPositionAgressive(boolean useOrderBy) throws java.lang.Exception
java.lang.Exception
private static java.lang.String T8insert(java.sql.PreparedStatement ps, int id, char[] base, int bl, char[] pattern, int pl, int pos, boolean addPattern) throws java.sql.SQLException
java.sql.SQLException
private static int addPatternPrefix(java.lang.StringBuffer sb, char[] pattern, int pl, int fakeCount, int pos)
private static void checkClob8(java.sql.Statement s, java.lang.String pstr, boolean useOrderBy) throws java.sql.SQLException
java.sql.SQLException
private static void checkClob8(java.sql.Statement s, java.sql.Clob pstr, boolean useOrderBy) throws java.sql.SQLException
java.sql.SQLException
public void testClobAfterClose() throws java.lang.Exception
java.lang.Exception
public void testLockingClob() throws java.lang.Exception
java.lang.Exception
public void testLockingWithLongRowClob() throws java.lang.Exception
java.lang.Exception
public void testClobAfterCommit() throws java.lang.Exception
java.lang.Exception
public void testClobAfterClosingConnection() throws java.lang.Exception
java.lang.Exception
public void testClobAfterCommitWithSecondClob() throws java.sql.SQLException
java.sql.SQLException
public void testGetClobBeforeAndAfterUpdate() throws java.sql.SQLException
java.sql.SQLException
private void checkContentsBeforeAndAfterUpdatingClob(java.sql.ResultSet rs) throws java.sql.SQLException
java.sql.SQLException
public void testGetClobBeforeAndAfterUpdateStream() throws java.sql.SQLException
java.sql.SQLException
private void updateClobWithUpdateCharacterStream(java.sql.ResultSet rs) throws java.sql.SQLException
java.sql.SQLException
public void testClobFinalizer() throws java.lang.Exception
java.lang.Exception
public void testGetBinaryStream() throws java.lang.Exception
java.lang.Exception
public void testGetBytes() throws java.lang.Exception
java.lang.Exception
public void testPositionBytes() throws java.lang.Exception
java.lang.Exception
public void testPositionBlobDeterministic() throws java.io.IOException, java.sql.SQLException
Blob.position
using a deterministic sequence of
actions and arguments.java.io.IOException
java.sql.SQLException
public void testPositionBlob() throws java.lang.Exception
java.lang.Exception
public void testTriggerWithBlobColumn() throws java.lang.Exception
java.lang.Exception
public void testVarbinary() throws java.lang.Exception
java.lang.Exception
public void testGetBlobFromIntColumn() throws java.lang.Exception
java.lang.Exception
public void testSetBlobOnIntColumn() throws java.lang.Exception
java.lang.Exception
public void testRaisingOfExceptionsBlob() throws java.lang.Exception
java.lang.Exception
public void testSetBlob() throws java.lang.Exception
java.lang.Exception
public void testBlobAfterClose() throws java.lang.Exception
java.lang.Exception
public void testLockingBlob() throws java.lang.Exception
java.lang.Exception
public void testLockingWithLongRowBlob() throws java.lang.Exception
java.lang.Exception
public void testBlobAfterCommit() throws java.lang.Exception
java.lang.Exception
public void testBlobAfterClosingConnection() throws java.lang.Exception
java.lang.Exception
public void testBlobFinalizer() throws java.lang.Exception
java.lang.Exception
public void testGetBlobBeforeAndAfterUpdate() throws java.lang.Exception
java.lang.Exception
private void checkContentsBeforeAndAfterUpdatingBlob(java.sql.ResultSet rs) throws java.sql.SQLException, java.io.UnsupportedEncodingException
java.sql.SQLException
java.io.UnsupportedEncodingException
public void testGetBlobBeforeAndAfterUpdateStream() throws java.lang.Exception
java.lang.Exception
private void updateBlobWithUpdateBinaryStream(java.sql.ResultSet rs) throws java.sql.SQLException, java.io.UnsupportedEncodingException
java.sql.SQLException
java.io.UnsupportedEncodingException
public void testSelfDestructiveClob() throws java.lang.Exception
java.lang.Exception
public void testSelfDestructiveClob2() throws java.lang.Exception
java.lang.Exception
public void testNegativeTestDerby265Blob() throws java.lang.Exception
java.lang.Exception
FileNotFoundException
java.io.IOException
public void testNegativeTestDerby265Clob() throws java.lang.Exception
java.lang.Exception
public static junit.framework.Test suite()
private static junit.framework.Test baseSuite(java.lang.String name)
private void insertDefaultData() throws java.lang.Exception
java.lang.Exception
private void insertUnicodeData(java.lang.String[] unicodeString) throws java.lang.Exception
java.lang.Exception
private void insertLoopingAlphabetStreamData(java.sql.PreparedStatement ps, int lobLength) throws java.lang.Exception
java.lang.Exception
private void insertLoopingAlphabetStreamData(java.sql.PreparedStatement ps, CharAlphabet alphabet, int lobLength) throws java.lang.Exception
java.lang.Exception
private boolean compareReaders(java.io.Reader origValue, java.io.Reader newValue) throws java.lang.Exception
java.lang.Exception
private long getStreamCheckSum(java.io.InputStream in) throws java.lang.Exception
java.lang.Exception
private void verifyInterval(java.sql.Clob clob, long pos, int length, int testNum, int clobLength) throws java.lang.Exception
java.lang.Exception
private void verifyInterval(java.sql.Blob blob, long pos, int length, int testNum, int blobLength) throws java.lang.Exception
java.lang.Exception
public void testBlobContents(java.sql.ResultSet rs) throws java.lang.Exception
rs
- java.lang.Exception
public void testBlobInsert() throws java.sql.SQLException
java.sql.SQLException
private void checkException(java.lang.String SQLState, java.sql.SQLException se) throws java.lang.Exception
java.lang.Exception
public void testRetrieveMoreThan32KLobs() throws java.sql.SQLException
java.sql.SQLException
public void testDerby5113() throws java.lang.Exception
java.lang.Exception
private void checkSmallPageSize(java.sql.Statement st, java.lang.String tblName) throws java.sql.SQLException
java.sql.SQLException
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.