Polishing (typo fixes etc, aligned with 5.0.x)

This commit is contained in:
Juergen Hoeller
2018-08-09 13:04:57 +02:00
parent 45598ca53a
commit 5a66a339a6
34 changed files with 159 additions and 156 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 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.
@@ -69,7 +69,7 @@ import static org.junit.Assert.*;
* @author Juergen Hoeller
* @author Chris Beams
*/
public final class ProxyFactoryBeanTests {
public class ProxyFactoryBeanTests {
private static final Class<?> CLASS = ProxyFactoryBeanTests.class;
private static final String CLASSNAME = CLASS.getSimpleName();
@@ -259,22 +259,22 @@ public final class ProxyFactoryBeanTests {
// Check it works without AOP
SideEffectBean raw = (SideEffectBean) bf.getBean("prototypeTarget");
assertEquals(INITIAL_COUNT, raw.getCount() );
assertEquals(INITIAL_COUNT, raw.getCount());
raw.doWork();
assertEquals(INITIAL_COUNT+1, raw.getCount() );
assertEquals(INITIAL_COUNT+1, raw.getCount());
raw = (SideEffectBean) bf.getBean("prototypeTarget");
assertEquals(INITIAL_COUNT, raw.getCount() );
assertEquals(INITIAL_COUNT, raw.getCount());
// Now try with advised instances
SideEffectBean prototype2FirstInstance = (SideEffectBean) bf.getBean(beanName);
assertEquals(INITIAL_COUNT, prototype2FirstInstance.getCount() );
assertEquals(INITIAL_COUNT, prototype2FirstInstance.getCount());
prototype2FirstInstance.doWork();
assertEquals(INITIAL_COUNT + 1, prototype2FirstInstance.getCount() );
assertEquals(INITIAL_COUNT + 1, prototype2FirstInstance.getCount());
SideEffectBean prototype2SecondInstance = (SideEffectBean) bf.getBean(beanName);
assertFalse("Prototypes are not ==", prototype2FirstInstance == prototype2SecondInstance);
assertEquals(INITIAL_COUNT, prototype2SecondInstance.getCount() );
assertEquals(INITIAL_COUNT + 1, prototype2FirstInstance.getCount() );
assertEquals(INITIAL_COUNT, prototype2SecondInstance.getCount());
assertEquals(INITIAL_COUNT + 1, prototype2FirstInstance.getCount());
return prototype2FirstInstance;
}
@@ -397,7 +397,7 @@ public final class ProxyFactoryBeanTests {
config.removeAdvice(debugInterceptor);
it.getSpouse();
// Still invoked wiht old reference
// Still invoked with old reference
assertEquals(2, debugInterceptor.getCount());
// not invoked with new object
@@ -714,7 +714,7 @@ public final class ProxyFactoryBeanTests {
@SuppressWarnings("serial")
public static class PointcutForVoid extends DefaultPointcutAdvisor {
public static List<String> methodNames = new LinkedList<String>();
public static List<String> methodNames = new LinkedList<>();
public static void reset() {
methodNames.clear();

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.
@@ -97,7 +97,6 @@ public class EnableAsyncTests {
fail("Should have thrown UnsatisfiedDependencyException");
}
catch (UnsatisfiedDependencyException ex) {
ex.printStackTrace();
assertTrue(ex.getCause() instanceof BeanNotOfRequiredTypeException);
}
}
@@ -112,7 +111,6 @@ public class EnableAsyncTests {
fail("Should have thrown UnsatisfiedDependencyException");
}
catch (UnsatisfiedDependencyException ex) {
ex.printStackTrace();
assertTrue(ex.getCause() instanceof BeanNotOfRequiredTypeException);
}
}
@@ -219,8 +217,8 @@ public class EnableAsyncTests {
ctx.close();
}
@Test
public void spr14949FindsOnInterfaceWithInterfaceProxy() throws InterruptedException {
@Test // SPR-14949
public void findOnInterfaceWithInterfaceProxy() throws InterruptedException {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(Spr14949ConfigA.class);
AsyncInterface asyncBean = ctx.getBean(AsyncInterface.class);
@@ -231,8 +229,8 @@ public class EnableAsyncTests {
ctx.close();
}
@Test @Ignore // TODO
public void spr14949FindsOnInterfaceWithCglibProxy() throws InterruptedException {
@Test @Ignore // SPR-14949
public void findOnInterfaceWithCglibProxy() throws InterruptedException {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(Spr14949ConfigB.class);
AsyncInterface asyncBean = ctx.getBean(AsyncInterface.class);

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.
@@ -57,7 +57,6 @@ import static org.junit.Assert.*;
/**
* @author Kazuki Shimizu
* @author Juergen Hoeller
* @since 4.3
*/
public class SpringValidatorAdapterTests {
@@ -162,7 +161,7 @@ public class SpringValidatorAdapterTests {
@Test // SPR-16177
public void testWithSet() {
Parent parent = new Parent();
parent.setName("Parent whith set");
parent.setName("Parent with set");
parent.getChildSet().addAll(createChildren(parent));
BeanPropertyBindingResult errors = new BeanPropertyBindingResult(parent, "parent");
@@ -185,6 +184,7 @@ public class SpringValidatorAdapterTests {
return Arrays.asList(child1, child2);
}
@Same(field = "password", comparingField = "confirmPassword")
@Same(field = "email", comparingField = "confirmEmail")
static class TestBean {