private static boolean isUnindexedProperty(Object obj) {
return "com.google.appengine.api.datastore.Entity$UnindexedValue".equals(obj.getClass().getName());
}
public void testInsert() throws EntityNotFoundException, IllegalAccessException {
HasUnindexedPropertiesJPA pojo = new HasUnindexedPropertiesJPA();
pojo.setUnindexedString("str");
pojo.setUnindexedList(Utils.newArrayList("a", "b", "c"));
pojo.setUnindexedText(new Text("unindexed text"));
pojo.setUnindexedBlob(new Blob("unindexed blob".getBytes()));
pojo.setText(new Text("text"));
pojo.setBlob(new Blob("blob".getBytes()));
beginTxn();
em.persist(pojo);
commitTxn();
Entity e = ds.get(KeyFactory.createKey(pojo.getClass().getSimpleName(), pojo.getId()));
assertTrue(isUnindexedProperty(getRawProperty(e, "unindexedString")));
assertTrue(isUnindexedProperty(getRawProperty(e, "unindexedList")));
assertTrue(isUnindexedProperty(getRawProperty(e, "unindexedText")));
assertTrue(isUnindexedProperty(getRawProperty(e, "unindexedBlob")));
assertTrue(isUnindexedProperty(getRawProperty(e, "text")));