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) |
private static void |
checkClob8(java.sql.Statement s,
java.sql.Clob pstr) |
private static void |
checkClob8(java.sql.Statement s,
java.lang.String pstr) |
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 |
testPositionAgressive()
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 |
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, 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 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.TestCasejava.lang.Exceptionprotected void tearDown()
throws java.lang.Exception
BaseJDBCTestCasetearDown in class BaseJDBCTestCasejava.lang.Exceptionpublic void testUnconsumedParameter()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testIsolationLevelChangeAfterRead()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testSetCharacterStream()
throws java.lang.Exception
java.lang.Exceptionpublic void testGetAsciiStream()
throws java.lang.Exception
java.lang.Exceptionpublic void testGetCharacterStream()
throws java.lang.Exception
java.lang.Exceptionpublic void testGetCharacterStreamWithUnicode()
throws java.lang.Exception
java.lang.Exceptionpublic void testTriggersWithClobColumn()
throws java.lang.Exception
java.lang.Exceptionpublic void testGetSubString()
throws java.lang.Exception
java.lang.Exceptionpublic void testGetSubStringWithUnicode()
throws java.lang.Exception
java.lang.Exceptionpublic void testPositionString()
throws java.lang.Exception
java.lang.Exceptionpublic void testPositionStringWithUnicode()
throws java.lang.Exception
java.lang.Exceptionprivate void runPositionStringTest()
throws java.lang.Exception
java.lang.Exceptionpublic void testPositionClob()
throws java.lang.Exception
java.lang.Exceptionpublic void testPositionClobWithUnicode()
throws java.lang.Exception
java.lang.Exceptionprivate void runPositionClobTest()
throws java.lang.Exception
java.lang.Exceptionpublic void testSmallClobFields()
throws java.lang.Exception
java.lang.Exceptionpublic void testGetClobFromIntColumn()
throws java.lang.Exception
java.lang.Exceptionpublic void testSetClobToIntColumn()
throws java.lang.Exception
java.lang.Exceptionpublic void testRaisingOfExceptionsClob()
throws java.lang.Exception
java.lang.Exceptionpublic void testSetClob()
throws java.lang.Exception
java.lang.Exceptionpublic void testPositionAgressive()
throws java.lang.Exception
java.lang.Exceptionprivate 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.SQLExceptionprivate 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)
throws java.sql.SQLException
java.sql.SQLExceptionprivate static void checkClob8(java.sql.Statement s,
java.sql.Clob pstr)
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testClobAfterClose()
throws java.lang.Exception
java.lang.Exceptionpublic void testLockingClob()
throws java.lang.Exception
java.lang.Exceptionpublic void testLockingWithLongRowClob()
throws java.lang.Exception
java.lang.Exceptionpublic void testClobAfterCommit()
throws java.lang.Exception
java.lang.Exceptionpublic void testClobAfterClosingConnection()
throws java.lang.Exception
java.lang.Exceptionpublic void testClobAfterCommitWithSecondClob()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testGetClobBeforeAndAfterUpdate()
throws java.sql.SQLException
java.sql.SQLExceptionprivate void checkContentsBeforeAndAfterUpdatingClob(java.sql.ResultSet rs)
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testGetClobBeforeAndAfterUpdateStream()
throws java.sql.SQLException
java.sql.SQLExceptionprivate void updateClobWithUpdateCharacterStream(java.sql.ResultSet rs)
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testClobFinalizer()
throws java.lang.Exception
java.lang.Exceptionpublic void testGetBinaryStream()
throws java.lang.Exception
java.lang.Exceptionpublic void testGetBytes()
throws java.lang.Exception
java.lang.Exceptionpublic void testPositionBytes()
throws java.lang.Exception
java.lang.Exceptionpublic void testPositionBlobDeterministic()
throws java.io.IOException,
java.sql.SQLException
Blob.position using a deterministic sequence of
actions and arguments.java.io.IOExceptionjava.sql.SQLExceptionpublic void testPositionBlob()
throws java.lang.Exception
java.lang.Exceptionpublic void testTriggerWithBlobColumn()
throws java.lang.Exception
java.lang.Exceptionpublic void testVarbinary()
throws java.lang.Exception
java.lang.Exceptionpublic void testGetBlobFromIntColumn()
throws java.lang.Exception
java.lang.Exceptionpublic void testSetBlobOnIntColumn()
throws java.lang.Exception
java.lang.Exceptionpublic void testRaisingOfExceptionsBlob()
throws java.lang.Exception
java.lang.Exceptionpublic void testSetBlob()
throws java.lang.Exception
java.lang.Exceptionpublic void testBlobAfterClose()
throws java.lang.Exception
java.lang.Exceptionpublic void testLockingBlob()
throws java.lang.Exception
java.lang.Exceptionpublic void testLockingWithLongRowBlob()
throws java.lang.Exception
java.lang.Exceptionpublic void testBlobAfterCommit()
throws java.lang.Exception
java.lang.Exceptionpublic void testBlobAfterClosingConnection()
throws java.lang.Exception
java.lang.Exceptionpublic void testBlobFinalizer()
throws java.lang.Exception
java.lang.Exceptionpublic void testGetBlobBeforeAndAfterUpdate()
throws java.lang.Exception
java.lang.Exceptionprivate void checkContentsBeforeAndAfterUpdatingBlob(java.sql.ResultSet rs)
throws java.sql.SQLException,
java.io.UnsupportedEncodingException
java.sql.SQLExceptionjava.io.UnsupportedEncodingExceptionpublic void testGetBlobBeforeAndAfterUpdateStream()
throws java.lang.Exception
java.lang.Exceptionprivate void updateBlobWithUpdateBinaryStream(java.sql.ResultSet rs)
throws java.sql.SQLException,
java.io.UnsupportedEncodingException
java.sql.SQLExceptionjava.io.UnsupportedEncodingExceptionpublic void testSelfDestructiveClob()
throws java.lang.Exception
java.lang.Exceptionpublic void testSelfDestructiveClob2()
throws java.lang.Exception
java.lang.Exceptionpublic void testNegativeTestDerby265Blob()
throws java.lang.Exception
java.lang.ExceptionFileNotFoundExceptionjava.io.IOExceptionpublic void testNegativeTestDerby265Clob()
throws java.lang.Exception
java.lang.Exceptionpublic static junit.framework.Test suite()
private static junit.framework.Test baseSuite(java.lang.String name)
private void insertDefaultData()
throws java.lang.Exception
java.lang.Exceptionprivate void insertUnicodeData(java.lang.String[] unicodeString)
throws java.lang.Exception
java.lang.Exceptionprivate void insertLoopingAlphabetStreamData(java.sql.PreparedStatement ps,
int lobLength)
throws java.lang.Exception
java.lang.Exceptionprivate void insertLoopingAlphabetStreamData(java.sql.PreparedStatement ps,
CharAlphabet alphabet,
int lobLength)
throws java.lang.Exception
java.lang.Exceptionprivate boolean compareReaders(java.io.Reader origValue,
java.io.Reader newValue)
throws java.lang.Exception
java.lang.Exceptionprivate long getStreamCheckSum(java.io.InputStream in)
throws java.lang.Exception
java.lang.Exceptionprivate void verifyInterval(java.sql.Clob clob,
long pos,
int length,
int testNum,
int clobLength)
throws java.lang.Exception
java.lang.Exceptionprivate void verifyInterval(java.sql.Blob blob,
long pos,
int length,
int testNum,
int blobLength)
throws java.lang.Exception
java.lang.Exceptionpublic void testBlobContents(java.sql.ResultSet rs)
throws java.lang.Exception
rs - java.lang.Exceptionpublic void testBlobInsert()
throws java.sql.SQLException
java.sql.SQLExceptionprivate void checkException(java.lang.String SQLState,
java.sql.SQLException se)
throws java.lang.Exception
java.lang.Exceptionpublic void testRetrieveMoreThan32KLobs()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testDerby5113()
throws java.lang.Exception
java.lang.Exceptionprivate void checkSmallPageSize(java.sql.Statement st,
java.lang.String tblName)
throws java.sql.SQLException
java.sql.SQLExceptionApache Derby V10.10 Internals - Copyright © 2004,2014 The Apache Software Foundation. All Rights Reserved.