DaoManager { public synchronized short removeExt( EntityManager em, Object obj ) { try { if ( em != null ) { em.remove( obj ); } else { return 0; } } catch ( Exception e ) { LOG.error( e.getMessage() ); return 0; } 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 testRemoveExt() throws Exception { assertEquals( 1, daoManager.removeExt( entityManager, object ) ); }
@Test public void testRemoveExt2() throws Exception { assertEquals( 0, daoManager.removeExt( null, object ) ); }