Package org.springframework.transaction.interceptor

Examples of org.springframework.transaction.interceptor.RuleBasedTransactionAttribute.rollbackOn()


  public void testNonDefaultRollbackRules() throws Exception {
    TransactionAttributeEditor editor = new TransactionAttributeEditor();
    editor.setAsText("+RuntimeException,+SkippableException");
    RuleBasedTransactionAttribute attr = (RuleBasedTransactionAttribute) editor.getValue();
    attr.getRollbackRules().add(new RollbackRuleAttribute(Exception.class));
    assertTrue(attr.rollbackOn(new Exception("")));
    assertFalse(attr.rollbackOn(new RuntimeException("")));
    assertFalse(attr.rollbackOn(new SkippableException("")));
  }

  /**
 
View Full Code Here


    TransactionAttributeEditor editor = new TransactionAttributeEditor();
    editor.setAsText("+RuntimeException,+SkippableException");
    RuleBasedTransactionAttribute attr = (RuleBasedTransactionAttribute) editor.getValue();
    attr.getRollbackRules().add(new RollbackRuleAttribute(Exception.class));
    assertTrue(attr.rollbackOn(new Exception("")));
    assertFalse(attr.rollbackOn(new RuntimeException("")));
    assertFalse(attr.rollbackOn(new SkippableException("")));
  }

  /**
   * Scenario: Exception in reader that should not cause rollback
View Full Code Here

    editor.setAsText("+RuntimeException,+SkippableException");
    RuleBasedTransactionAttribute attr = (RuleBasedTransactionAttribute) editor.getValue();
    attr.getRollbackRules().add(new RollbackRuleAttribute(Exception.class));
    assertTrue(attr.rollbackOn(new Exception("")));
    assertFalse(attr.rollbackOn(new RuntimeException("")));
    assertFalse(attr.rollbackOn(new SkippableException("")));
  }

  /**
   * Scenario: Exception in reader that should not cause rollback
   */
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.