|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.ObjectTestCase
org.objectweb.cjdbc.driver.BlobTest
Blob test class.
Blob,
PreparedStatement,
Serialized Form| Field Summary | |
(package private) java.lang.String |
cjdbcDriver
|
(package private) java.lang.String |
cjdbcUrl
|
(package private) java.sql.Connection |
con
The connection to be used to the database for the test |
(package private) java.lang.String |
configFile
|
| Constructor Summary | |
BlobTest()
|
|
| Method Summary | |
void |
displayResults(java.lang.String iamtested,
boolean copy,
boolean swithblob,
boolean swithbytes)
Display basic results on testing |
static void |
main(java.lang.String[] args)
The main program for the BlobTest class |
boolean |
pTestBigBlobStorage(java.lang.String storeFile)
Send a file to database and retrieve it as a Blob object |
private boolean |
pTestBlobBytes(java.lang.String storeFile,
boolean callBlobMethods)
This is called by the methods above since contains very similar code. |
boolean |
pTestBlobWithBytes(java.lang.String storeFile)
Test implementation of blobs without having to use the code specific to cjdbc. |
boolean |
pTestCopy(java.lang.String storeFile)
Just copy a file to see if no data is lost. |
(package private) static byte[] |
readBinary(java.io.File file)
ReadBinary data from the file. |
protected void |
setUp()
Load cjdbc driver and retrieve connection from database |
static Test |
suite()
A unit test suite for JUnit |
void |
testBlobCreation()
Basic test to retrieve a blob and validate its content |
void |
testBlobs()
Test a number of files to be copied and transfer and retrieved to the database. |
void |
testClob()
Test method for clobs. |
void |
testHexMethods()
Test Hexa methods conversion in the blob data |
(package private) static void |
writeBinary(byte[] data,
java.io.File file)
WriteBinary data to the file. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
final java.lang.String cjdbcUrl
final java.lang.String configFile
final java.lang.String cjdbcDriver
java.sql.Connection con
| Constructor Detail |
public BlobTest()
| Method Detail |
public static Test suite()
public static void main(java.lang.String[] args)
args - The command line argumentsprotected void setUp()
junit.framework.TestCase#setUp()public void testHexMethods()
public void testClob()
public void testBlobCreation()
public void testBlobs()
pTestCopy,
pTestBibBlobStorage,
displayResults
public void displayResults(java.lang.String iamtested,
boolean copy,
boolean swithblob,
boolean swithbytes)
iamtested - is the file that was testedcopy - isSuccessswithblob - result of test with blobswithbytes - result of test with bytes
public boolean pTestCopy(java.lang.String storeFile)
throws java.io.IOException
storeFile - target file to copy
java.io.IOException - if read or write fails on targer storeFile
public boolean pTestBigBlobStorage(java.lang.String storeFile)
throws java.io.IOException,
java.sql.SQLException
storeFile - target file to manipulate as a Blob
java.io.IOException - if write or read fails from target files
java.sql.SQLException - when talking to the database
public boolean pTestBlobWithBytes(java.lang.String storeFile)
throws java.io.IOException,
java.sql.SQLException
new
instance method.
storeFile - the file to test
java.io.IOException - if problems reading blob
java.sql.SQLException - if sql problem on the server side
private boolean pTestBlobBytes(java.lang.String storeFile,
boolean callBlobMethods)
throws java.io.IOException,
java.sql.SQLException
storeFile - callBlobMethods -
java.io.IOException
java.sql.SQLException
static byte[] readBinary(java.io.File file)
throws java.io.IOException
java.io.IOException - if read fails from target
static void writeBinary(byte[] data,
java.io.File file)
throws java.io.IOException
data - to be written to the filefile - destination target
java.io.IOException - if write fails on target
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||