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:
dsyer
2009-05-30 09:34:18 +00:00
parent a7f8988422
commit db1f7fc35b
4 changed files with 40 additions and 10 deletions

View File

@@ -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() {