/**
* @author xkf
*/
public class SpringTestCase extends TestCase {
DomainObjDAO test=null;
protected void setUp() throws Exception {
super.setUp();
ApplicationContext ctx=new FileSystemXmlApplicationContext("test/Bean.xml");
test = (DomainObjDAO) ctx.getBean("myAOPProxy");
}
protected void tearDown() throws Exception {
super.tearDown();
}
public void testSave(){
test.save();
}
}
运行结果如下:
信息: Creating shared instance of singleton bean 'MyInterceptor'
2004-12-7 23:50:11 test.aop.spring.LockInterceptor lock
信息: lock domain object...
saving domain object......
2004-12-7 23:50:11 test.aop.spring.LockInterceptor unlock