|
|||||||||
| 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.BLOBTest
public final class BLOBTest
Tests reading and updating binary large objects (BLOBs).
| Field Summary |
|---|
| Fields inherited from class org.apache.derbyTesting.junit.BaseTestCase |
|---|
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE |
| Constructor Summary | |
|---|---|
BLOBTest(java.lang.String name)
Constructor |
|
| Method Summary | |
|---|---|
void |
setUp()
The setup creates a Connection to the database. |
static junit.framework.Test |
suite()
The suite decorates the tests of this class with a setup which creates and populates the data model. |
void |
testBlobCastInValuesClause()
Tests that a stream value in a values clause can be cast to a BLOB. |
void |
testUpdateBlobFromForwardOnlyResultSetUsingPositionedUpdates()
Tests updating a Blob from a forward only resultset, using methods. |
void |
testUpdateBlobFromForwardOnlyResultSetUsingResultSetMethods()
Tests updating a Blob from a forward only resultset, using result set update methods. |
void |
testUpdateBlobFromForwardOnlyResultSetWithProjectUsingPositionedUpdates()
Tests updating a Blob from a forward only resultset, produced by a select query with projection. |
void |
testUpdateBlobFromForwardOnlyResultSetWithProjectUsingResultSetMethods()
Tests updating a Blob from a forward only resultset, produced by a select query with projection. |
void |
testUpdateBlobFromScrollableResultSetUsingPositionedUpdates()
Tests updating a Blob from a scollable resultset, using positioned updates. |
void |
testUpdateBlobFromScrollableResultSetUsingResultSetMethods()
Tests updating a Blob from a scollable resultset, using result set update methods. |
void |
testUpdateBlobFromScrollableResultSetWithProjectUsingPositionedUpdates()
Tests updating a Blob from a scollable resultset, produced by a select query with projection. |
void |
testUpdateBlobFromScrollableResultSetWithProjectUsingResultSetMethods()
Tests updating a Blob from a scollable resultset produced by a select query with projection. |
private void |
testUpdateBlobWithPositionedUpdate(java.sql.ResultSet rs,
int newVal,
int newSize)
Tests updating the Blob using positioned updates |
private void |
testUpdateBlobWithResultSetMethods(java.sql.ResultSet rs,
int newVal,
int newSize)
Tests updating the Blob using result set update methods. |
private void |
verifyBlob(int expectedVal,
int expectedSize,
java.sql.Blob blob)
Verifies that the blob is consistent |
private void |
verifyNewValueInTable(int newVal,
int newSize)
Verifies that the table has row with column val=newVal and that it its data and size columns are consistent. |
| 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 |
| Constructor Detail |
|---|
public BLOBTest(java.lang.String name)
name - name of test case (method).| Method Detail |
|---|
public void testUpdateBlobFromScrollableResultSetUsingResultSetMethods()
throws java.sql.SQLException,
java.io.IOException
java.sql.SQLException - causes test to fail with error
java.io.IOException - causes test to fail with error
public void testUpdateBlobFromForwardOnlyResultSetUsingResultSetMethods()
throws java.sql.SQLException,
java.io.IOException
java.sql.SQLException - causes test to fail with error
java.io.IOException - causes test to fail with error
public void testUpdateBlobFromScrollableResultSetUsingPositionedUpdates()
throws java.sql.SQLException,
java.io.IOException
java.sql.SQLException - causes test to fail with error
java.io.IOException - causes test to fail with error
public void testUpdateBlobFromForwardOnlyResultSetUsingPositionedUpdates()
throws java.sql.SQLException,
java.io.IOException
java.sql.SQLException - causes test to fail with error
java.io.IOException - causes test to fail with error
public void testUpdateBlobFromScrollableResultSetWithProjectUsingResultSetMethods()
throws java.sql.SQLException,
java.io.IOException
java.sql.SQLException - causes test to fail with error
java.io.IOException - causes test to fail with error
public void testUpdateBlobFromForwardOnlyResultSetWithProjectUsingResultSetMethods()
throws java.sql.SQLException,
java.io.IOException
java.sql.SQLException - causes test to fail with error
java.io.IOException - causes test to fail with error
public void testUpdateBlobFromScrollableResultSetWithProjectUsingPositionedUpdates()
throws java.sql.SQLException,
java.io.IOException
java.sql.SQLException - causes test to fail with error
java.io.IOException - causes test to fail with error
public void testUpdateBlobFromForwardOnlyResultSetWithProjectUsingPositionedUpdates()
throws java.sql.SQLException,
java.io.IOException
java.sql.SQLException - causes test to fail with error
java.io.IOException - causes test to fail with error
private void testUpdateBlobWithResultSetMethods(java.sql.ResultSet rs,
int newVal,
int newSize)
throws java.sql.SQLException,
java.io.IOException
rs - result set, currently positioned on row to be updatednewVal - new value in val column and blob datanewSize - new size of Blob
java.sql.SQLException - causes test to fail with error
java.io.IOException - causes test to fail with error
private void testUpdateBlobWithPositionedUpdate(java.sql.ResultSet rs,
int newVal,
int newSize)
throws java.sql.SQLException,
java.io.IOException
rs - result set, currently positioned on row to be updatednewVal - new value in val column and blob datanewSize - new size of Blob
java.sql.SQLException - causes test to fail with error
java.io.IOException - causes test to fail with error
public void testBlobCastInValuesClause()
throws java.io.IOException,
java.sql.SQLException
See DERBY-4102 (test case resulted in a ClassCastException earlier).
java.io.IOException - if something goes wrong
java.sql.SQLException - if something goes wrong
private void verifyNewValueInTable(int newVal,
int newSize)
throws java.io.IOException,
java.sql.SQLException
newVal - value expected to be found in the val column of a rownewSize - expected size of size column and size of blob
java.sql.SQLException - causes test to fail with error
java.io.IOException - causes test to fail with error
private void verifyBlob(int expectedVal,
int expectedSize,
java.sql.Blob blob)
throws java.io.IOException,
java.sql.SQLException
expectedVal - the InputStream for the Blob should return this value
for every byteexpectedSize - the BLOB should have this sizeblob - the BLOB to check
java.sql.SQLException - causes test to fail with error
java.io.IOException - causes test to fail with errorpublic static junit.framework.Test suite()
public final void setUp()
throws java.lang.Exception
setUp in class junit.framework.TestCasejava.lang.Exception - any exception will cause test to fail with error.
|
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 | ||||||||