* @author Max Ross <maxr@google.com>
*/
public class JPALobTest extends JPATestCase {
public void testInsert() throws EntityNotFoundException {
HasLob pojo = new HasLob();
pojo.setBigString("a really big string");
pojo.setBigByteArray("a really big byte array".getBytes());
Date now = new Date();
pojo.setDateList(Utils.newArrayList(now));
beginTxn();
em.persist(pojo);
commitTxn();
Entity e = ds.get(KeyFactory.createKey(HasLob.class.getSimpleName(), pojo.getId()));
assertEquals(new Text("a really big string"), e.getProperty("bigString"));
assertEquals(new Blob("a really big byte array".getBytes()), e.getProperty("bigByteArray"));
assertEquals(new Blob(SerializationManager.DEFAULT_SERIALIZATION_STRATEGY.serialize(
Utils.newArrayList(now)).getBytes()), e.getProperty("dateList"));
}