List of usage examples for org.springframework.transaction.interceptor RuleBasedTransactionAttribute rollbackOn
@Override public boolean rollbackOn(Throwable ex)
From source file:org.springframework.batch.core.step.item.FaultTolerantStepFactoryBeanRollbackTests.java
@Test 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(""))); }