コード例 #1
1
 @Test
 public void testIsActive_3() throws Exception {
   expect(tx.getStatus()).andThrow(new SystemException("bad"));
   replay(tx);
   try {
     jut.isActive();
   } catch (DoceException e) {
     assertEquals("bad", e.getCause().getMessage());
   }
 }
コード例 #2
1
 @Test
 public void testBegin_2() throws Exception {
   tx.begin();
   expectLastCall().andThrow(new SystemException("bad"));
   replay(tx);
   try {
     jut.begin();
   } catch (DoceException e) {
     assertEquals("bad", e.getCause().getMessage());
   }
 }
コード例 #3
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());
   }
 }