RESOLVED - issue BATCH-1255: Proxy with no target cannot be analysed for listener interfaces
http://jira.springframework.org/browse/BATCH-1255
This commit is contained in:
@@ -27,6 +27,10 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import org.aopalliance.intercept.MethodInterceptor;
|
||||
import org.aopalliance.intercept.MethodInvocation;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.springframework.aop.framework.ProxyFactory;
|
||||
@@ -229,6 +233,19 @@ public class StepListenerFactoryBeanTests {
|
||||
}));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testProxyWithNoTarget() throws Exception {
|
||||
ProxyFactory factory = new ProxyFactory();
|
||||
factory.addInterface(DataSource.class);
|
||||
factory.addAdvice(new MethodInterceptor() {
|
||||
public Object invoke(MethodInvocation invocation) throws Throwable {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
Object proxy = factory.getProxy();
|
||||
assertFalse(StepListenerFactoryBean.isListener(proxy));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testProxiedAnnotationsIsListener() throws Exception {
|
||||
Object delegate = new InitializingBean() {
|
||||
|
||||
Reference in New Issue
Block a user