/tests_bugs/com/google/appengine/datanucleus/bugs/jpa/Issue198Test.java

http://datanucleus-appengine.googlecode.com/ · Java · 21 lines · 19 code · 2 blank · 0 comment · 0 complexity · 473a28893fe4dc6b5f7ff24e9f18a4ba MD5 · raw file

  1. package com.google.appengine.datanucleus.bugs.jpa;
  2. import com.google.appengine.api.datastore.EntityNotFoundException;
  3. import com.google.appengine.api.datastore.KeyFactory;
  4. import com.google.appengine.datanucleus.bugs.test.Foo;
  5. public class Issue198Test extends JPABugTestCase {
  6. public void testRun() {
  7. beginTxn();
  8. Foo pojo = new Foo();
  9. em.persist(pojo);
  10. commitTxn();
  11. try {
  12. com.google.appengine.api.datastore.Entity e =
  13. ds.get(KeyFactory.createKey("BugsJPA$Foo", pojo.getId()));
  14. assertTrue(e.hasProperty("barKey"));
  15. } catch (EntityNotFoundException enfe) {
  16. fail("Entity wasn't found");
  17. }
  18. }
  19. }