Polishing

This commit is contained in:
Juergen Hoeller
2014-02-06 20:35:59 +01:00
parent 8c4e372558
commit 426f52b393
6 changed files with 80 additions and 80 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,6 +21,8 @@ import java.io.Serializable;
import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
import org.junit.Test;
import test.mixin.LockMixinAdvisor;
import org.springframework.aop.ClassFilter;
import org.springframework.aop.MethodMatcher;
import org.springframework.aop.Pointcut;
@@ -34,7 +36,6 @@ import org.springframework.tests.aop.interceptor.NopInterceptor;
import org.springframework.tests.sample.beans.ITestBean;
import org.springframework.tests.sample.beans.TestBean;
import test.mixin.LockMixinAdvisor;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
@@ -140,9 +141,7 @@ public final class CglibProxyTests extends AbstractAopProxyTests implements Seri
AopProxy aop = new CglibAopProxy(as);
CglibTestBean proxy = (CglibTestBean) aop.getProxy();
assertEquals("The name property has been overwritten by the constructor",
"Rob Harrop", proxy.getName());
assertEquals("The name property has been overwritten by the constructor", "Rob Harrop", proxy.getName());
}
@Test
@@ -155,9 +154,7 @@ public final class CglibProxyTests extends AbstractAopProxyTests implements Seri
pc.setTarget(target);
CglibAopProxy aop = new CglibAopProxy(pc);
CglibTestBean proxy = (CglibTestBean) aop.getProxy();
assertNotNull("Proxy should not be null", proxy);
assertEquals("Constructor overrode the value of name", "Rob Harrop", proxy.getName());
@@ -187,21 +184,18 @@ public final class CglibProxyTests extends AbstractAopProxyTests implements Seri
public ClassFilter getClassFilter() {
return ClassFilter.TRUE;
}
@Override
public MethodMatcher getMethodMatcher() {
return MethodMatcher.TRUE;
}
@Override
public int hashCode() {
return 0;
}
@Override
public boolean equals(Object obj) {
return true;
}
@Override
public int hashCode() {
return 0;
}
};
pf.addAdvisor(new DefaultPointcutAdvisor(pointcut, advice));
@@ -225,7 +219,7 @@ public final class CglibProxyTests extends AbstractAopProxyTests implements Seri
}
private ITestBean getIntroductionAdvisorProxy(TestBean target) {
ProxyFactory pf = new ProxyFactory(new Class<?>[]{ITestBean.class});
ProxyFactory pf = new ProxyFactory(new Class<?>[] {ITestBean.class});
pf.setProxyTargetClass(true);
pf.addAdvisor(new LockMixinAdvisor());
@@ -245,8 +239,7 @@ public final class CglibProxyTests extends AbstractAopProxyTests implements Seri
AdvisedSupport pc = new AdvisedSupport(new Class<?>[]{});
pc.setTargetSource(mockTargetSource);
CglibAopProxy aop = new CglibAopProxy(pc);
aop.setConstructorArguments(new Object[] {"Rob Harrop", new Integer(22)},
new Class<?>[] {String.class, int.class});
aop.setConstructorArguments(new Object[] {"Rob Harrop", 22}, new Class<?>[] {String.class, int.class});
NoArgCtorTestBean proxy = (NoArgCtorTestBean) aop.getProxy();
proxy = (NoArgCtorTestBean) aop.getProxy();