public void testEmbeddedBinary() {
database = ODatabaseObjectPool.global().acquire(url, "admin", "admin");
database.getMetadata().getSchema().reload();
Account a = new Account(0, "Chris", "Martin");
a.setThumbnail(new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 });
database.save(a);
database.close();
database = ODatabaseObjectPool.global().acquire(url, "admin", "admin");
Account aa = (Account) database.load((ORID) a.getRid());
Assert.assertNotNull(a.getThumbnail());
byte[] b = aa.getThumbnail();
for (int i = 0; i < 10; ++i)
Assert.assertEquals(b[i], i);
Assert.assertNotNull(aa.getPhoto());
b = aa.getPhoto();
for (int i = 0; i < 10; ++i)
Assert.assertEquals(b[i], i);
database.close();
}