Esempio n. 1
1
 @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());
   }
 }
Esempio n. 2
0
 @Test
 public void testCommit() throws Exception {
   expect(tx.getStatus()).andReturn(Status.STATUS_ACTIVE);
   tx.commit();
   expectLastCall();
   replay(tx);
   jut.commit();
 }
Esempio n. 3
0
 @Test
 public void testCommit_2() throws Exception {
   expect(tx.getStatus()).andReturn(Status.STATUS_NO_TRANSACTION);
   replay(tx);
   jut.commit();
 }