PageRenderTime 11ms CodeModel.GetById 2ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 1ms

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

http://datanucleus-appengine.googlecode.com/
Java | 21 lines | 17 code | 4 blank | 0 comment | 0 complexity | 880fa81718938ca3217511fb69711f5a MD5 | raw file
 1package com.google.appengine.datanucleus.bugs.jpa;
 2
 3import javax.persistence.TypedQuery;
 4
 5import com.google.appengine.datanucleus.bugs.test.Bar;
 6
 7public class Issue256Test extends JPABugTestCase {
 8  public void testRun() {
 9    beginTxn();
10    Bar pojo = new Bar();
11    em.persist(pojo);
12    commitTxn();
13    em.clear();
14
15    beginTxn();
16    TypedQuery<Long> q = em.createQuery("SELECT COUNT(b) FROM " + Bar.class.getName() + " b", Long.class);
17    Long result = q.getSingleResult();
18    assertEquals(1, result.longValue());
19    commitTxn();
20  }
21}