コード例 #1
0
 public void testAlwaysTrueForThrowable() {
   RollbackRuleAttribute rr = new RollbackRuleAttribute("java.lang.Throwable");
   assertTrue(rr.getDepth(new MailSendException("")) > 0);
   assertTrue(rr.getDepth(new ServletException()) > 0);
   assertTrue(rr.getDepth(new FatalBeanException(null, null)) > 0);
   assertTrue(rr.getDepth(new RuntimeException()) > 0);
 }
コード例 #2
0
 public void testAlwaysTrueForThrowable() {
   RollbackRuleAttribute rr = new RollbackRuleAttribute(java.lang.Throwable.class.getName());
   assertTrue(rr.getDepth(new MyRuntimeException("")) > 0);
   assertTrue(rr.getDepth(new IOException()) > 0);
   assertTrue(rr.getDepth(new FatalBeanException(null, null)) > 0);
   assertTrue(rr.getDepth(new RuntimeException()) > 0);
 }
コード例 #3
0
 public void testAncestry() {
   RollbackRuleAttribute rr = new RollbackRuleAttribute("java.lang.Exception");
   // Exception -> Runtime -> NestedRuntime -> MailException -> MailSendException
   assertTrue(rr.getDepth(new MailSendException("")) == 4);
 }
コード例 #4
0
 public void testNotFound() {
   RollbackRuleAttribute rr = new RollbackRuleAttribute("javax.servlet.ServletException");
   assertTrue(rr.getDepth(new MailSendException("")) == -1);
 }
コード例 #5
0
 public void testFoundImmediatelyWithClass() {
   RollbackRuleAttribute rr = new RollbackRuleAttribute(Exception.class);
   assertTrue(rr.getDepth(new Exception()) == 0);
 }
コード例 #6
0
 public void testFoundImmediatelyWithString() {
   RollbackRuleAttribute rr = new RollbackRuleAttribute("java.lang.Exception");
   assertTrue(rr.getDepth(new Exception()) == 0);
 }
コード例 #7
0
 public void testAncestry() {
   RollbackRuleAttribute rr = new RollbackRuleAttribute(java.lang.Exception.class.getName());
   // Exception -> Runtime -> NestedRuntime -> MyRuntimeException
   assertThat(rr.getDepth(new MyRuntimeException("")), equalTo(3));
 }
コード例 #8
0
 public void testNotFound() {
   RollbackRuleAttribute rr = new RollbackRuleAttribute(java.io.IOException.class.getName());
   assertTrue(rr.getDepth(new MyRuntimeException("")) == -1);
 }