|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
org.apache.derbyTesting.junit.BaseTestCase
org.apache.derbyTesting.junit.BaseJDBCTestCase
org.apache.derbyTesting.functionTests.tests.jdbcapi.BlobClob4BlobTest
public class BlobClob4BlobTest
Test of JDBC blob and clob
| Field Summary | |
|---|---|
private static java.lang.String |
BLOB_ACCESSED_AFTER_COMMIT
|
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 |
INVALID_LOCATOR
|
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
|
| Fields inherited from class org.apache.derbyTesting.junit.BaseTestCase |
|---|
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE |
| Constructor Summary | |
|---|---|
BlobClob4BlobTest(java.lang.String name)
Creates a new instance of BlobClob4BlobTest |
|
| Method Summary | |
|---|---|
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.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 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 |
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() |
| 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 |
|---|
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 BLOB_ACCESSED_AFTER_COMMIT
private static final java.lang.String NO_CURRENT_CONNECTION
private static final java.lang.String INVALID_LOB
private static final java.lang.String INVALID_LOCATOR
| Constructor Detail |
|---|
public BlobClob4BlobTest(java.lang.String name)
| Method Detail |
|---|
public void setUp()
throws java.lang.Exception
setUp in class junit.framework.TestCasejava.lang.Exception
protected void tearDown()
throws java.lang.Exception
BaseJDBCTestCase
tearDown in class BaseJDBCTestCasejava.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 testTriggersWithClobColumn()
throws java.lang.Exception
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 testPositionAgressive()
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)
throws java.sql.SQLException
java.sql.SQLException
private static void checkClob8(java.sql.Statement s,
java.sql.Clob pstr)
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.Exceptionpublic static junit.framework.Test suite()
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
|
Built on Wed 2009-11-25 18:43:31-0800, from revision 884373 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||