Issue: SPR-9439
This commit is contained in:
Chris Beams
2012-05-26 14:04:36 +03:00
parent 5327a7a37d
commit 5874383ef0
5 changed files with 45 additions and 35 deletions

View File

@@ -1,4 +1,21 @@
/*
* Copyright 2002-2012 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.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.web.context;
import java.util.Locale;
import org.springframework.beans.TestBean;
@@ -136,6 +153,7 @@ public abstract class AbstractApplicationContextTests extends AbstractListableBe
}
@SuppressWarnings("serial")
public static class MyEvent extends ApplicationEvent {
public MyEvent(Object source) {

View File

@@ -16,9 +16,6 @@
package org.springframework.web.context;
import static org.hamcrest.CoreMatchers.sameInstance;
import static org.junit.Assert.assertThat;
import java.util.Locale;
import javax.servlet.ServletException;
@@ -36,6 +33,10 @@ import org.springframework.context.TestListener;
import org.springframework.mock.web.MockServletContext;
import org.springframework.web.context.support.XmlWebApplicationContext;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
/**
* @author Rod Johnson
* @author Juergen Hoeller
@@ -53,6 +54,7 @@ public class XmlWebApplicationContextTests extends AbstractApplicationContextTes
root.addBeanFactoryPostProcessor(new BeanFactoryPostProcessor() {
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) {
beanFactory.addBeanPostProcessor(new BeanPostProcessor() {
@SuppressWarnings("unchecked")
public Object postProcessBeforeInitialization(Object bean, String name) throws BeansException {
if (bean instanceof TestBean) {
((TestBean) bean).getFriends().add("myFriend");