}
public void testRollbackRulesAreApplied() throws Exception {
Method method = TestBean.class.getMethod("getAge", (Class[]) null);
MapAttributes ma = new MapAttributes();
TransactionAttribute txAtt = new RuleBasedTransactionAttribute();
RollbackRuleAttribute rr = new RollbackRuleAttribute("java.lang.Exception");
RollbackRuleAttribute nrr = new NoRollbackRuleAttribute("ServletException");
AttributesTransactionAttributeSource atas = new AttributesTransactionAttributeSource(ma);
ma.register(method, new Object[]{new Object(), "", txAtt, rr, nrr, "er"});
TransactionAttribute actual = atas.getTransactionAttribute(method, method.getDeclaringClass());
assertEquals(txAtt, actual);
assertTrue(txAtt.rollbackOn(new Exception()));
assertFalse(txAtt.rollbackOn(new ServletException()));