PageRenderTime 8ms CodeModel.GetById 1ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

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