Use Gradle test fixture support for spring-beans and spring-context
See gh-23550
This commit is contained in:
@@ -1,49 +0,0 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
* https://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.context;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public class ACATester implements ApplicationContextAware {
|
||||
|
||||
private ApplicationContext ac;
|
||||
|
||||
@Override
|
||||
public void setApplicationContext(ApplicationContext ctx) throws ApplicationContextException {
|
||||
// check reinitialization
|
||||
if (this.ac != null) {
|
||||
throw new IllegalStateException("Already initialized");
|
||||
}
|
||||
|
||||
// check message source availability
|
||||
if (ctx != null) {
|
||||
try {
|
||||
ctx.getMessage("code1", null, Locale.getDefault());
|
||||
}
|
||||
catch (NoSuchMessageException ex) {
|
||||
// expected
|
||||
}
|
||||
}
|
||||
|
||||
this.ac = ctx;
|
||||
}
|
||||
|
||||
public ApplicationContext getApplicationContext() {
|
||||
return ac;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
* https://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.context;
|
||||
|
||||
/**
|
||||
* @author Juergen Hoeller
|
||||
*/
|
||||
public class BeanThatBroadcasts implements ApplicationContextAware {
|
||||
|
||||
public ApplicationContext applicationContext;
|
||||
|
||||
public int receivedCount;
|
||||
|
||||
|
||||
@Override
|
||||
public void setApplicationContext(ApplicationContext applicationContext) {
|
||||
this.applicationContext = applicationContext;
|
||||
if (applicationContext.getDisplayName().contains("listener")) {
|
||||
applicationContext.getBean("listener");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
/*
|
||||
* 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://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.context;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* A stub {@link ApplicationListener}.
|
||||
*
|
||||
* @author Thomas Risberg
|
||||
* @author Juergen Hoeller
|
||||
*/
|
||||
public class BeanThatListens implements ApplicationListener<ApplicationEvent> {
|
||||
|
||||
private BeanThatBroadcasts beanThatBroadcasts;
|
||||
|
||||
private int eventCount;
|
||||
|
||||
|
||||
public BeanThatListens() {
|
||||
}
|
||||
|
||||
public BeanThatListens(BeanThatBroadcasts beanThatBroadcasts) {
|
||||
this.beanThatBroadcasts = beanThatBroadcasts;
|
||||
Map<String, BeanThatListens> beans = beanThatBroadcasts.applicationContext.getBeansOfType(BeanThatListens.class);
|
||||
if (!beans.isEmpty()) {
|
||||
throw new IllegalStateException("Shouldn't have found any BeanThatListens instances");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onApplicationEvent(ApplicationEvent event) {
|
||||
eventCount++;
|
||||
if (beanThatBroadcasts != null) {
|
||||
beanThatBroadcasts.receivedCount++;
|
||||
}
|
||||
}
|
||||
|
||||
public int getEventCount() {
|
||||
return eventCount;
|
||||
}
|
||||
|
||||
public void zero() {
|
||||
eventCount = 0;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -16,10 +16,9 @@
|
||||
|
||||
package org.springframework.context;
|
||||
|
||||
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.BeanFactory;
|
||||
import org.springframework.tests.sample.beans.LifecycleBean;
|
||||
import org.springframework.beans.test.fixtures.beans.LifecycleBean;
|
||||
|
||||
/**
|
||||
* Simple bean to test ApplicationContext lifecycle methods for beans
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
/*
|
||||
* Copyright 2002-2019 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
|
||||
*
|
||||
* https://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.context;
|
||||
|
||||
/**
|
||||
* Listener that maintains a global count of events.
|
||||
*
|
||||
* @author Rod Johnson
|
||||
* @since January 21, 2001
|
||||
*/
|
||||
public class TestListener implements ApplicationListener<ApplicationEvent> {
|
||||
|
||||
private int eventCount;
|
||||
|
||||
public int getEventCount() {
|
||||
return eventCount;
|
||||
}
|
||||
|
||||
public void zeroCounter() {
|
||||
eventCount = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onApplicationEvent(ApplicationEvent e) {
|
||||
++eventCount;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -29,6 +29,8 @@ import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.BeanCreationException;
|
||||
import org.springframework.beans.factory.BeanDefinitionStoreException;
|
||||
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
||||
import org.springframework.beans.test.fixtures.beans.LifecycleBean;
|
||||
import org.springframework.beans.test.fixtures.beans.TestBean;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextException;
|
||||
import org.springframework.context.ApplicationContextInitializer;
|
||||
@@ -38,8 +40,6 @@ import org.springframework.core.env.ConfigurableEnvironment;
|
||||
import org.springframework.core.env.PropertySource;
|
||||
import org.springframework.mock.web.test.MockServletConfig;
|
||||
import org.springframework.mock.web.test.MockServletContext;
|
||||
import org.springframework.tests.sample.beans.LifecycleBean;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.context.support.WebApplicationContextUtils;
|
||||
import org.springframework.web.context.support.XmlWebApplicationContext;
|
||||
|
||||
@@ -28,12 +28,12 @@ import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
|
||||
import org.springframework.beans.factory.config.BeanPostProcessor;
|
||||
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
|
||||
import org.springframework.context.AbstractApplicationContextTests;
|
||||
import org.springframework.beans.test.fixtures.beans.TestBean;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.context.NoSuchMessageException;
|
||||
import org.springframework.context.TestListener;
|
||||
import org.springframework.context.test.fixtures.AbstractApplicationContextTests;
|
||||
import org.springframework.context.test.fixtures.beans.TestApplicationListener;
|
||||
import org.springframework.mock.web.test.MockServletContext;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.web.context.support.XmlWebApplicationContext;
|
||||
|
||||
@@ -96,13 +96,13 @@ public class XmlWebApplicationContextTests extends AbstractApplicationContextTes
|
||||
|
||||
/**
|
||||
* Overridden as we can't trust superclass method
|
||||
* @see org.springframework.context.AbstractApplicationContextTests#testEvents()
|
||||
* @see org.springframework.context.test.fixtures.AbstractApplicationContextTests#testEvents()
|
||||
*/
|
||||
@Override
|
||||
protected void doTestEvents(TestListener listener, TestListener parentListener,
|
||||
protected void doTestEvents(TestApplicationListener listener, TestApplicationListener parentListener,
|
||||
MyEvent event) {
|
||||
TestListener listenerBean = (TestListener) this.applicationContext.getBean("testListener");
|
||||
TestListener parentListenerBean = (TestListener) this.applicationContext.getParent().getBean("parentListener");
|
||||
TestApplicationListener listenerBean = (TestApplicationListener) this.applicationContext.getBean("testListener");
|
||||
TestApplicationListener parentListenerBean = (TestApplicationListener) this.applicationContext.getParent().getBean("parentListener");
|
||||
super.doTestEvents(listenerBean, parentListenerBean, event);
|
||||
}
|
||||
|
||||
|
||||
@@ -27,9 +27,9 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.beans.MutablePropertyValues;
|
||||
import org.springframework.beans.factory.BeanCreationException;
|
||||
import org.springframework.beans.test.fixtures.beans.TestBean;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.mock.web.test.MockServletContext;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||
|
||||
@@ -32,6 +32,7 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.beans.MutablePropertyValues;
|
||||
import org.springframework.beans.PropertyValue;
|
||||
import org.springframework.beans.test.fixtures.beans.TestBean;
|
||||
import org.springframework.context.ApplicationContextInitializer;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.core.env.ConfigurableEnvironment;
|
||||
@@ -40,7 +41,6 @@ import org.springframework.mock.web.test.MockHttpServletRequest;
|
||||
import org.springframework.mock.web.test.MockHttpServletResponse;
|
||||
import org.springframework.mock.web.test.MockServletConfig;
|
||||
import org.springframework.mock.web.test.MockServletContext;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.web.context.ConfigurableWebApplicationContext;
|
||||
import org.springframework.web.context.ConfigurableWebEnvironment;
|
||||
import org.springframework.web.context.ContextLoader;
|
||||
|
||||
@@ -27,6 +27,7 @@ import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.beans.DirectFieldAccessor;
|
||||
import org.springframework.beans.test.fixtures.beans.TestBean;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.core.convert.converter.Converter;
|
||||
import org.springframework.core.io.FileSystemResourceLoader;
|
||||
@@ -41,7 +42,6 @@ import org.springframework.mock.web.test.MockHttpServletRequest;
|
||||
import org.springframework.mock.web.test.MockServletContext;
|
||||
import org.springframework.scheduling.concurrent.ConcurrentTaskExecutor;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.util.AntPathMatcher;
|
||||
import org.springframework.validation.BeanPropertyBindingResult;
|
||||
import org.springframework.validation.DefaultMessageCodesResolver;
|
||||
|
||||
@@ -24,13 +24,13 @@ import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.beans.TypeMismatchException;
|
||||
import org.springframework.beans.test.fixtures.beans.ITestBean;
|
||||
import org.springframework.context.i18n.LocaleContextHolder;
|
||||
import org.springframework.context.support.StaticMessageSource;
|
||||
import org.springframework.core.annotation.AliasFor;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
||||
import org.springframework.mock.web.test.MockHttpServletResponse;
|
||||
import org.springframework.tests.sample.beans.ITestBean;
|
||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||
import org.springframework.web.server.ResponseStatusException;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
@@ -22,8 +22,8 @@ import java.util.Map;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.beans.test.fixtures.beans.TestBean;
|
||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.web.bind.ServletRequestDataBinder;
|
||||
import org.springframework.web.bind.WebDataBinder;
|
||||
import org.springframework.web.servlet.HandlerMapping;
|
||||
|
||||
@@ -23,9 +23,9 @@ import java.util.List;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.beans.test.fixtures.beans.TestBean;
|
||||
import org.springframework.core.MethodParameter;
|
||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.ui.ExtendedModelMap;
|
||||
import org.springframework.web.context.request.NativeWebRequest;
|
||||
import org.springframework.web.context.request.ServletWebRequest;
|
||||
|
||||
@@ -41,6 +41,7 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.beans.propertyeditors.CustomDateEditor;
|
||||
import org.springframework.beans.test.fixtures.beans.TestBean;
|
||||
import org.springframework.core.MethodParameter;
|
||||
import org.springframework.http.CacheControl;
|
||||
import org.springframework.http.HttpEntity;
|
||||
@@ -51,7 +52,6 @@ import org.springframework.mock.web.test.MockHttpServletRequest;
|
||||
import org.springframework.mock.web.test.MockHttpServletResponse;
|
||||
import org.springframework.mock.web.test.MockMultipartFile;
|
||||
import org.springframework.mock.web.test.MockMultipartHttpServletRequest;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.validation.BindingResult;
|
||||
|
||||
@@ -70,6 +70,10 @@ import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
import org.springframework.beans.factory.support.RootBeanDefinition;
|
||||
import org.springframework.beans.propertyeditors.CustomDateEditor;
|
||||
import org.springframework.beans.test.fixtures.beans.DerivedTestBean;
|
||||
import org.springframework.beans.test.fixtures.beans.GenericBean;
|
||||
import org.springframework.beans.test.fixtures.beans.ITestBean;
|
||||
import org.springframework.beans.test.fixtures.beans.TestBean;
|
||||
import org.springframework.context.annotation.AnnotationConfigUtils;
|
||||
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
|
||||
import org.springframework.core.MethodParameter;
|
||||
@@ -102,10 +106,6 @@ import org.springframework.mock.web.test.MockServletConfig;
|
||||
import org.springframework.mock.web.test.MockServletContext;
|
||||
import org.springframework.oxm.jaxb.Jaxb2Marshaller;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.tests.sample.beans.DerivedTestBean;
|
||||
import org.springframework.tests.sample.beans.GenericBean;
|
||||
import org.springframework.tests.sample.beans.ITestBean;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.ui.ExtendedModelMap;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.ui.ModelMap;
|
||||
@@ -288,7 +288,7 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl
|
||||
request.addParameter("testBeanSet", "1", "2");
|
||||
MockHttpServletResponse response = new MockHttpServletResponse();
|
||||
getServlet().service(request, response);
|
||||
assertThat(response.getContentAsString()).isEqualTo("[1, 2]-org.springframework.tests.sample.beans.TestBean");
|
||||
assertThat(response.getContentAsString()).isEqualTo("[1, 2]-org.springframework.beans.test.fixtures.beans.TestBean");
|
||||
}
|
||||
|
||||
@Test // SPR-12903
|
||||
|
||||
@@ -24,10 +24,10 @@ import java.util.Optional;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.beans.test.fixtures.beans.TestBean;
|
||||
import org.springframework.core.MethodParameter;
|
||||
import org.springframework.core.convert.support.DefaultConversionService;
|
||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.support.ConfigurableWebBindingInitializer;
|
||||
import org.springframework.web.bind.support.WebDataBinderFactory;
|
||||
|
||||
@@ -24,6 +24,7 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.beans.ConversionNotSupportedException;
|
||||
import org.springframework.beans.TypeMismatchException;
|
||||
import org.springframework.beans.test.fixtures.beans.TestBean;
|
||||
import org.springframework.core.MethodParameter;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.converter.HttpMessageNotReadableException;
|
||||
@@ -31,7 +32,6 @@ import org.springframework.http.converter.HttpMessageNotWritableException;
|
||||
import org.springframework.http.server.ServletServerHttpRequest;
|
||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
||||
import org.springframework.mock.web.test.MockHttpServletResponse;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.validation.BeanPropertyBindingResult;
|
||||
import org.springframework.validation.BindException;
|
||||
import org.springframework.web.HttpMediaTypeNotSupportedException;
|
||||
|
||||
@@ -23,10 +23,10 @@ import java.util.Map;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.beans.test.fixtures.beans.TestBean;
|
||||
import org.springframework.core.convert.converter.Converter;
|
||||
import org.springframework.format.support.DefaultFormattingConversionService;
|
||||
import org.springframework.format.support.FormattingConversionService;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.validation.DataBinder;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@@ -30,9 +30,9 @@ import javax.servlet.jsp.tagext.Tag;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.beans.propertyeditors.CustomDateEditor;
|
||||
import org.springframework.tests.sample.beans.IndexedTestBean;
|
||||
import org.springframework.tests.sample.beans.NestedTestBean;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.beans.test.fixtures.beans.IndexedTestBean;
|
||||
import org.springframework.beans.test.fixtures.beans.NestedTestBean;
|
||||
import org.springframework.beans.test.fixtures.beans.TestBean;
|
||||
import org.springframework.validation.BindException;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.validation.DataBinder;
|
||||
|
||||
@@ -18,9 +18,9 @@ package org.springframework.web.servlet.tags.form;
|
||||
|
||||
import javax.servlet.jsp.JspException;
|
||||
|
||||
import org.springframework.beans.test.fixtures.beans.TestBean;
|
||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
||||
import org.springframework.mock.web.test.MockPageContext;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
|
||||
/**
|
||||
* @author Rob Harrop
|
||||
|
||||
@@ -22,7 +22,7 @@ import javax.servlet.jsp.tagext.Tag;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.beans.test.fixtures.beans.TestBean;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
|
||||
@@ -34,9 +34,9 @@ import org.dom4j.io.SAXReader;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.beans.propertyeditors.StringTrimmerEditor;
|
||||
import org.springframework.tests.sample.beans.Colour;
|
||||
import org.springframework.tests.sample.beans.Pet;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.beans.test.fixtures.beans.Colour;
|
||||
import org.springframework.beans.test.fixtures.beans.Pet;
|
||||
import org.springframework.beans.test.fixtures.beans.TestBean;
|
||||
import org.springframework.validation.BeanPropertyBindingResult;
|
||||
import org.springframework.validation.BindingResult;
|
||||
|
||||
|
||||
@@ -38,11 +38,11 @@ import org.dom4j.io.SAXReader;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.beans.propertyeditors.StringTrimmerEditor;
|
||||
import org.springframework.beans.test.fixtures.beans.Colour;
|
||||
import org.springframework.beans.test.fixtures.beans.Pet;
|
||||
import org.springframework.beans.test.fixtures.beans.TestBean;
|
||||
import org.springframework.format.Formatter;
|
||||
import org.springframework.format.support.FormattingConversionService;
|
||||
import org.springframework.tests.sample.beans.Colour;
|
||||
import org.springframework.tests.sample.beans.Pet;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
import org.springframework.validation.BeanPropertyBindingResult;
|
||||
import org.springframework.validation.BindingResult;
|
||||
|
||||
@@ -28,9 +28,9 @@ import javax.servlet.jsp.tagext.Tag;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.beans.test.fixtures.beans.TestBean;
|
||||
import org.springframework.mock.web.test.MockBodyContent;
|
||||
import org.springframework.mock.web.test.MockPageContext;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.validation.BeanPropertyBindingResult;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.validation.Errors;
|
||||
|
||||
@@ -21,7 +21,7 @@ import javax.servlet.jsp.tagext.Tag;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.beans.test.fixtures.beans.TestBean;
|
||||
import org.springframework.validation.BeanPropertyBindingResult;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@@ -23,7 +23,7 @@ import javax.servlet.jsp.tagext.Tag;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.beans.test.fixtures.beans.TestBean;
|
||||
import org.springframework.validation.BeanPropertyBindingResult;
|
||||
import org.springframework.web.servlet.support.BindStatus;
|
||||
import org.springframework.web.servlet.tags.BindTag;
|
||||
|
||||
@@ -21,8 +21,8 @@ import javax.servlet.jsp.tagext.Tag;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.beans.test.fixtures.beans.TestBean;
|
||||
import org.springframework.mock.web.test.MockPageContext;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.web.servlet.tags.NestedPathTag;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@@ -21,8 +21,8 @@ import javax.servlet.jsp.tagext.Tag;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.tests.sample.beans.CustomEnum;
|
||||
import org.springframework.tests.sample.beans.GenericBean;
|
||||
import org.springframework.beans.test.fixtures.beans.CustomEnum;
|
||||
import org.springframework.beans.test.fixtures.beans.GenericBean;
|
||||
import org.springframework.web.servlet.support.BindStatus;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@@ -28,10 +28,10 @@ import javax.servlet.jsp.tagext.Tag;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.beans.propertyeditors.StringArrayPropertyEditor;
|
||||
import org.springframework.beans.test.fixtures.beans.Colour;
|
||||
import org.springframework.beans.test.fixtures.beans.TestBean;
|
||||
import org.springframework.mock.web.test.MockBodyContent;
|
||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
||||
import org.springframework.tests.sample.beans.Colour;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.validation.BeanPropertyBindingResult;
|
||||
import org.springframework.web.servlet.support.BindStatus;
|
||||
|
||||
@@ -34,9 +34,9 @@ import org.dom4j.Node;
|
||||
import org.dom4j.io.SAXReader;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.beans.test.fixtures.beans.TestBean;
|
||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
||||
import org.springframework.mock.web.test.MockPageContext;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.validation.BeanPropertyBindingResult;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.validation.Errors;
|
||||
|
||||
@@ -28,8 +28,8 @@ import org.dom4j.Element;
|
||||
import org.dom4j.io.SAXReader;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.tests.sample.beans.Pet;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.beans.test.fixtures.beans.Pet;
|
||||
import org.springframework.beans.test.fixtures.beans.TestBean;
|
||||
import org.springframework.validation.BeanPropertyBindingResult;
|
||||
import org.springframework.validation.BindingResult;
|
||||
|
||||
|
||||
@@ -37,9 +37,9 @@ import org.dom4j.io.SAXReader;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.beans.propertyeditors.StringTrimmerEditor;
|
||||
import org.springframework.tests.sample.beans.Colour;
|
||||
import org.springframework.tests.sample.beans.Pet;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.beans.test.fixtures.beans.Colour;
|
||||
import org.springframework.beans.test.fixtures.beans.Pet;
|
||||
import org.springframework.beans.test.fixtures.beans.TestBean;
|
||||
import org.springframework.validation.BeanPropertyBindingResult;
|
||||
import org.springframework.validation.BindingResult;
|
||||
|
||||
|
||||
@@ -41,9 +41,9 @@ import org.dom4j.io.SAXReader;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.beans.propertyeditors.CustomCollectionEditor;
|
||||
import org.springframework.beans.test.fixtures.beans.TestBean;
|
||||
import org.springframework.format.Formatter;
|
||||
import org.springframework.format.support.FormattingConversionService;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.validation.BeanPropertyBindingResult;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.servlet.support.BindStatus;
|
||||
@@ -351,7 +351,7 @@ public class SelectTagTests extends AbstractFormTagTests {
|
||||
assertThatExceptionOfType(JspException.class).as("use a non-Collection typed value as the value of 'items'").isThrownBy(
|
||||
this.tag::doStartTag)
|
||||
.withMessageContaining("items")
|
||||
.withMessageContaining("org.springframework.tests.sample.beans.TestBean");
|
||||
.withMessageContaining("org.springframework.beans.test.fixtures.beans.TestBean");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.springframework.web.servlet.tags.form;
|
||||
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.beans.test.fixtures.beans.TestBean;
|
||||
|
||||
/**
|
||||
* @author Juergen Hoeller
|
||||
|
||||
@@ -20,7 +20,7 @@ import javax.servlet.jsp.tagext.Tag;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.beans.test.fixtures.beans.TestBean;
|
||||
import org.springframework.validation.BeanPropertyBindingResult;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@@ -26,11 +26,11 @@ import java.util.Map;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.beans.test.fixtures.beans.TestBean;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
||||
import org.springframework.mock.web.test.MockHttpServletResponse;
|
||||
import org.springframework.mock.web.test.MockServletContext;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.context.ContextLoader;
|
||||
import org.springframework.web.context.support.StaticWebApplicationContext;
|
||||
|
||||
@@ -36,13 +36,13 @@ import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.MutablePropertyValues;
|
||||
import org.springframework.beans.PropertyValue;
|
||||
import org.springframework.beans.factory.BeanDefinitionStoreException;
|
||||
import org.springframework.beans.test.fixtures.beans.TestBean;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
||||
import org.springframework.mock.web.test.MockHttpServletResponse;
|
||||
import org.springframework.mock.web.test.MockRequestDispatcher;
|
||||
import org.springframework.mock.web.test.MockServletContext;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.web.context.support.ServletContextResource;
|
||||
import org.springframework.web.context.support.StaticWebApplicationContext;
|
||||
import org.springframework.web.servlet.DispatcherServlet;
|
||||
|
||||
@@ -32,12 +32,12 @@ import freemarker.template.TemplateException;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.beans.test.fixtures.beans.TestBean;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.core.io.FileSystemResource;
|
||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
||||
import org.springframework.mock.web.test.MockHttpServletResponse;
|
||||
import org.springframework.mock.web.test.MockServletContext;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.util.FileCopyUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.context.support.StaticWebApplicationContext;
|
||||
|
||||
Reference in New Issue
Block a user