*/
@Test
public void testBlobClob() throws Exception
{
PersistenceManager persist = new PersistenceManager(driver, database, login, password);
BlobClobObject bco = new BlobClobObject();
bco.setBytes(new byte[] { 3, 54, 1, 9 });
bco.setChars(new char[] { 'a', 'b', 'c' });
persist.saveObject(bco);
// re-open the persistence object
persist.close();
persist = new PersistenceManager(driver, database, login, password);
// make sure countworks for CLOB/BLOB objects
long clobCount = persist.getCount(new BlobClobObject());
assertEquals(1, clobCount);
// get the one and only bco object
List<BlobClobObject> all = persist.getObjectsMatching(new BlobClobObject());
assertEquals(1, all.size());
BlobClobObject first = all.get(0);
assertEquals(bco.getBytes().length, first.getBytes().length);
assertEquals(bco.getChars().length, first.getChars().length);
for (int x = 0; x < bco.getChars().length; x++)
{
assertEquals(bco.getChars()[x], first.getChars()[x]);
}
for (int x = 0; x < bco.getBytes().length; x++)
{
assertEquals(bco.getBytes()[x], first.getBytes()[x]);
}
persist.close();
}