@Test(expectedExceptions = {javax.persistence.PersistenceException.class})

public void nonexistentEntityManagerName() {
    JPASessionUtil.getEntityManager("nonexistent");
    fail("We shouldn't be able to acquire an EntityManager here");
}