@Test public void testCommit_3() throws Exception { expect(tx.getStatus()).andReturn(Status.STATUS_ACTIVE); tx.commit(); expectLastCall().andThrow(new SystemException("bad")); replay(tx); try { jut.commit(); } catch (DoceException e) { assertEquals("bad", e.getCause().getMessage()); } }
@Test public void testCommit() throws Exception { expect(tx.getStatus()).andReturn(Status.STATUS_ACTIVE); tx.commit(); expectLastCall(); replay(tx); jut.commit(); }
@Test public void testCommit_2() throws Exception { expect(tx.getStatus()).andReturn(Status.STATUS_NO_TRANSACTION); replay(tx); jut.commit(); }