From b70af3bf5784040128091aacad7516533b1ad5af Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Tue, 1 Dec 2015 14:10:46 +0100 Subject: [PATCH] Polishing --- .../DefaultListableBeanFactoryTests.java | 54 +------------------ 1 file changed, 1 insertion(+), 53 deletions(-) diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/DefaultListableBeanFactoryTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/DefaultListableBeanFactoryTests.java index c7c5876585..e3f877d373 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/DefaultListableBeanFactoryTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/DefaultListableBeanFactoryTests.java @@ -725,7 +725,7 @@ public class DefaultListableBeanFactoryTests { RootBeanDefinition parentDefinition = new RootBeanDefinition(TestBean.class); parentDefinition.setAbstract(true); parentDefinition.getPropertyValues().add("name", EXPECTED_NAME); - parentDefinition.getPropertyValues().add("age", new Integer(EXPECTED_AGE)); + parentDefinition.getPropertyValues().add("age", EXPECTED_AGE); ChildBeanDefinition childDefinition = new ChildBeanDefinition("alias"); @@ -2335,32 +2335,6 @@ public class DefaultListableBeanFactoryTests { assertTrue("Prototype creation took too long: " + sw.getTotalTimeMillis(), sw.getTotalTimeMillis() < 3000); } - /** - * @Test - * public void testPrototypeCreationWithConstructorArgumentsIsFastEnough2() throws Exception { - * if (factoryLog.isTraceEnabled() || factoryLog.isDebugEnabled()) { - * // Skip this test: Trace logging blows the time limit. - * return; - * } - * DefaultListableBeanFactory lbf = new DefaultListableBeanFactory(); - * Constructor ctor = TestBean.class.getConstructor(String.class, int.class); - * Method setBeanNameMethod = TestBean.class.getMethod("setBeanName", String.class); - * Method setBeanFactoryMethod = TestBean.class.getMethod("setBeanFactory", BeanFactory.class); - * StopWatch sw = new StopWatch(); - * sw.start("prototype"); - * for (int i = 0; i < 100000; i++) { - * TestBean tb = ctor.newInstance("juergen", 99); - * setBeanNameMethod.invoke(tb, "test"); - * setBeanFactoryMethod.invoke(tb, lbf); - * assertEquals("juergen", tb.getName()); - * assertEquals(99, tb.getAge()); - * } - * sw.stop(); - * // System.out.println(sw.getTotalTimeMillis()); - * assertTrue("Prototype creation took too long: " + sw.getTotalTimeMillis(), sw.getTotalTimeMillis() < 1500); - * } - */ - @Test public void testPrototypeCreationWithResolvedConstructorArgumentsIsFastEnough() { Assume.group(TestGroup.PERFORMANCE); @@ -2405,31 +2379,6 @@ public class DefaultListableBeanFactoryTests { assertTrue("Prototype creation took too long: " + sw.getTotalTimeMillis(), sw.getTotalTimeMillis() < 3000); } - /** - * public void testPrototypeCreationWithPropertiesIsFastEnough2() throws Exception { - * if (factoryLog.isTraceEnabled() || factoryLog.isDebugEnabled()) { - * // Skip this test: Trace logging blows the time limit. - * return; - * } - * DefaultListableBeanFactory lbf = new DefaultListableBeanFactory(); - * StopWatch sw = new StopWatch(); - * Method setBeanNameMethod = TestBean.class.getMethod("setBeanName", String.class); - * Method setBeanFactoryMethod = TestBean.class.getMethod("setBeanFactory", BeanFactory.class); - * Method setNameMethod = TestBean.class.getMethod("setName", String.class); - * Method setAgeMethod = TestBean.class.getMethod("setAge", int.class); - * sw.start("prototype"); - * for (int i = 0; i < 100000; i++) { - * TestBean tb = TestBean.class.newInstance(); - * setBeanNameMethod.invoke(tb, "test"); - * setBeanFactoryMethod.invoke(tb, lbf); - * setNameMethod.invoke(tb, "juergen"); - * setAgeMethod.invoke(tb, 99); - * } - * sw.stop(); - * // System.out.println(sw.getTotalTimeMillis()); - * assertTrue("Prototype creation took too long: " + sw.getTotalTimeMillis(), sw.getTotalTimeMillis() < 750); - * } - */ @Test public void testPrototypeCreationWithResolvedPropertiesIsFastEnough() { Assume.group(TestGroup.PERFORMANCE); @@ -2462,7 +2411,6 @@ public class DefaultListableBeanFactoryTests { public Object postProcessBeforeInitialization(Object bean, String beanName) { return new TestBean(); } - @Override public Object postProcessAfterInitialization(Object bean, String beanName) { return bean;