📄 aspectjexpressionpointcutadvisortests.java
字号:
package org.springframework.aop.aspectj;
import org.springframework.beans.ITestBean;
import org.springframework.test.AbstractDependencyInjectionSpringContextTests;
/**
* @author robh
*/
public class AspectJExpressionPointcutAdvisorTests extends AbstractDependencyInjectionSpringContextTests {
private ITestBean testBean;
private CallCountingInterceptor interceptor;
public void setTestBean(ITestBean testBean) {
this.testBean = testBean;
}
public void setInterceptor(CallCountingInterceptor interceptor) {
this.interceptor = interceptor;
}
protected void onSetUp() throws Exception {
interceptor.reset();
}
public void testPointcutting() throws Exception {
assertEquals("Count should be 0", 0, interceptor.getCount());
testBean.getAge();
assertEquals("Count should be 1", 1, interceptor.getCount());
testBean.setAge(90);
assertEquals("Count should be 1", 1, interceptor.getCount());
}
protected String[] getConfigLocations() {
return new String[]{"org/springframework/aop/aspectj/aspectj.xml"};
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -