Polishing

This commit is contained in:
Juergen Hoeller
2018-04-11 13:29:15 +02:00
parent 433877e5cb
commit de8c4179fb
7 changed files with 113 additions and 209 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2018 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.
@@ -212,7 +212,7 @@ public abstract class AbstractAopProxyTests {
}
@Test
public void testSerializationSerializableTargetAndAdvice() throws Throwable {
public void testSerializableTargetAndAdvice() throws Throwable {
SerializablePerson personTarget = new SerializablePerson();
personTarget.setName("jim");
personTarget.setAge(26);
@@ -435,7 +435,7 @@ public abstract class AbstractAopProxyTests {
TestBean raw = new OwnSpouse();
ProxyCreatorSupport pc = new ProxyCreatorSupport();
pc.setInterfaces(new Class<?>[] {ITestBean.class});
pc.setInterfaces(ITestBean.class);
pc.setTarget(raw);
ITestBean tb = (ITestBean) createProxy(pc);
@@ -457,7 +457,7 @@ public abstract class AbstractAopProxyTests {
pc.addAdvice(mi);
// We don't care about the object
mockTargetSource.setTarget(new Object());
mockTargetSource.setTarget(new TestBean());
pc.setTargetSource(mockTargetSource);
AopProxy aop = createAopProxy(pc);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -174,7 +174,7 @@ public class CglibProxyTests extends AbstractAopProxyTests implements Serializab
}
@Test
public void testUnadvisedProxyCreationWithCallDuringConstructor() throws Exception {
public void testUnadvisedProxyCreationWithCallDuringConstructor() {
CglibTestBean target = new CglibTestBean();
target.setName("Rob Harrop");
@@ -370,7 +370,7 @@ public class CglibProxyTests extends AbstractAopProxyTests implements Serializab
}
@Test
public void testProxyProtectedMethod() throws Exception {
public void testProxyProtectedMethod() {
CountingBeforeAdvice advice = new CountingBeforeAdvice();
ProxyFactory proxyFactory = new ProxyFactory(new MyBean());
proxyFactory.addAdvice(advice);
@@ -382,14 +382,14 @@ public class CglibProxyTests extends AbstractAopProxyTests implements Serializab
}
@Test
public void testProxyTargetClassInCaseOfNoInterfaces() throws Exception {
public void testProxyTargetClassInCaseOfNoInterfaces() {
ProxyFactory proxyFactory = new ProxyFactory(new MyBean());
MyBean proxy = (MyBean) proxyFactory.getProxy();
assertEquals(4, proxy.add(1, 3));
}
@Test // SPR-13328
public void testVarargsWithEnumArray() throws Exception {
public void testVarargsWithEnumArray() {
ProxyFactory proxyFactory = new ProxyFactory(new MyBean());
MyBean proxy = (MyBean) proxyFactory.getProxy();
assertTrue(proxy.doWithVarargs(MyEnum.A, MyOtherEnum.C));

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2018 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.
@@ -35,13 +35,13 @@ import static org.junit.Assert.*;
public class BeanNameAutoProxyCreatorInitTests {
@Test(expected = IllegalArgumentException.class)
public void testIgnoreAdvisorThatIsCurrentlyCreation() {
public void testIgnoreAdvisorThatIsCurrentlyInCreation() {
ClassPathXmlApplicationContext ctx =
new ClassPathXmlApplicationContext(getClass().getSimpleName() + "-context.xml", getClass());
new ClassPathXmlApplicationContext(getClass().getSimpleName() + "-context.xml", getClass());
TestBean bean = (TestBean) ctx.getBean("bean");
bean.setName("foo");
assertEquals("foo", bean.getName());
bean.setName(null); // should throw
bean.setName(null); // should throw
}
}