Package com.google.appengine.datanucleus.test.jdo

Examples of com.google.appengine.datanucleus.test.jdo.HasUnindexedPropertiesJDO


  private static boolean isUnindexedProperty(Object obj) {
    return "com.google.appengine.api.datastore.Entity$UnindexedValue".equals(obj.getClass().getName());
  }

  public void testInsert() throws EntityNotFoundException, IllegalAccessException {
    HasUnindexedPropertiesJDO pojo = new HasUnindexedPropertiesJDO();
    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();
    pm.makePersistent(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")));
View Full Code Here

TOP

Related Classes of com.google.appengine.datanucleus.test.jdo.HasUnindexedPropertiesJDO

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.