}
@Test
public void testTransactionAttributeOnMethod() throws Exception {
BeanFactory bf = getBeanFactory();
ITestBean test = (ITestBean) bf.getBean("test");
CallCountingTransactionManager txMan = (CallCountingTransactionManager) bf.getBean(TXMANAGER_BEAN_NAME);
OrderedTxCheckAdvisor txc = (OrderedTxCheckAdvisor) bf.getBean("orderedBeforeTransaction");
assertEquals(0, txc.getCountingBeforeAdvice().getCalls());
assertEquals(0, txMan.commits);
assertEquals("Initial value was correct", 4, test.getAge());
int newAge = 5;
test.setAge(newAge);
assertEquals(1, txc.getCountingBeforeAdvice().getCalls());
assertEquals("New value set correctly", newAge, test.getAge());
assertEquals("Transaction counts match", 1, txMan.commits);
}