DaoManager { public short startTransaction( EntityManager em ) { if ( em != null ) { em.getTransaction().begin(); } return 1; } DaoManager(); void init(); void destroy(); EntityManager getEntityManager(); EntityManager getEntityManagerFromFactory(); void setEntityManager( final EntityManager entityManager ); EntityManagerFactory getEntityManagerFactory(); void setEntityManagerFactory( final EntityManagerFactory entityManagerFactory ); short rollBackTransaction( EntityManager em ); short startTransaction( EntityManager em ); short commitTransaction( EntityManager em ); short closeEntityManager( EntityManager em ); synchronized short mergeExt( EntityManager em, Object obj ); synchronized short persistExt( EntityManager em, Object obj ); synchronized short removeExt( EntityManager em, Object obj ); boolean isAutoCommit(); void setAutoCommit( final boolean autoCommit );  }
@Test public void testStartTransaction() throws Exception { assertEquals( 1, daoManager.startTransaction( entityManager ) ); }