Use Gradle test fixture support for spring-core

See gh-23550
This commit is contained in:
Sam Brannen
2019-12-28 11:44:40 +01:00
parent 75fd391fc7
commit 5718bf424b
224 changed files with 552 additions and 453 deletions

View File

@@ -50,10 +50,10 @@ import org.springframework.core.NestedRuntimeException;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.test.fixtures.Assume;
import org.springframework.core.test.fixtures.EnabledForTestGroups;
import org.springframework.core.test.fixtures.TestGroup;
import org.springframework.lang.Nullable;
import org.springframework.tests.Assume;
import org.springframework.tests.EnabledForTestGroups;
import org.springframework.tests.TestGroup;
import org.springframework.tests.sample.beans.INestedTestBean;
import org.springframework.tests.sample.beans.ITestBean;
import org.springframework.tests.sample.beans.NestedTestBean;

View File

@@ -57,10 +57,11 @@ import org.springframework.aop.support.Pointcuts;
import org.springframework.aop.support.StaticMethodMatcherPointcutAdvisor;
import org.springframework.aop.target.HotSwappableTargetSource;
import org.springframework.aop.target.SingletonTargetSource;
import org.springframework.core.test.fixtures.EnabledForTestGroups;
import org.springframework.core.test.fixtures.TestGroup;
import org.springframework.core.test.fixtures.TimeStamped;
import org.springframework.core.test.fixtures.io.SerializationTestUtils;
import org.springframework.lang.Nullable;
import org.springframework.tests.EnabledForTestGroups;
import org.springframework.tests.TestGroup;
import org.springframework.tests.TimeStamped;
import org.springframework.tests.aop.advice.CountingAfterReturningAdvice;
import org.springframework.tests.aop.advice.CountingBeforeAdvice;
import org.springframework.tests.aop.advice.MethodCounter;
@@ -73,7 +74,6 @@ import org.springframework.tests.sample.beans.ITestBean;
import org.springframework.tests.sample.beans.Person;
import org.springframework.tests.sample.beans.SerializablePerson;
import org.springframework.tests.sample.beans.TestBean;
import org.springframework.util.SerializationTestUtils;
import org.springframework.util.StopWatch;
import static org.assertj.core.api.Assertions.assertThat;
@@ -765,7 +765,7 @@ public abstract class AbstractAopProxyTests {
@SuppressWarnings("serial")
class MyDi extends DelegatingIntroductionInterceptor implements TimeStamped {
/**
* @see test.util.TimeStamped#getTimeStamp()
* @see org.springframework.core.test.fixtures.util.TimeStamped#getTimeStamp()
*/
@Override
public long getTimeStamp() {

View File

@@ -48,8 +48,9 @@ import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
import org.springframework.context.ApplicationListener;
import org.springframework.context.TestListener;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.test.fixtures.TimeStamped;
import org.springframework.core.test.fixtures.io.SerializationTestUtils;
import org.springframework.lang.Nullable;
import org.springframework.tests.TimeStamped;
import org.springframework.tests.aop.advice.CountingBeforeAdvice;
import org.springframework.tests.aop.advice.MyThrowsHandler;
import org.springframework.tests.aop.interceptor.NopInterceptor;
@@ -58,7 +59,6 @@ import org.springframework.tests.sample.beans.ITestBean;
import org.springframework.tests.sample.beans.Person;
import org.springframework.tests.sample.beans.SideEffectBean;
import org.springframework.tests.sample.beans.TestBean;
import org.springframework.util.SerializationTestUtils;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;

View File

@@ -26,7 +26,7 @@ import org.springframework.aop.support.AopUtils;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.tests.TimeStamped;
import org.springframework.core.test.fixtures.TimeStamped;
import org.springframework.tests.aop.advice.CountingBeforeAdvice;
import org.springframework.tests.aop.interceptor.NopInterceptor;
import org.springframework.tests.sample.beans.ITestBean;

View File

@@ -27,10 +27,10 @@ import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
import org.springframework.context.support.GenericApplicationContext;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.test.fixtures.io.SerializationTestUtils;
import org.springframework.tests.context.SimpleMapScope;
import org.springframework.tests.sample.beans.ITestBean;
import org.springframework.tests.sample.beans.TestBean;
import org.springframework.util.SerializationTestUtils;
import static org.assertj.core.api.Assertions.assertThat;

View File

@@ -27,10 +27,10 @@ import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
import org.springframework.context.support.StaticApplicationContext;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.test.fixtures.io.SerializationTestUtils;
import org.springframework.tests.sample.beans.Person;
import org.springframework.tests.sample.beans.SerializablePerson;
import org.springframework.tests.sample.beans.SideEffectBean;
import org.springframework.util.SerializationTestUtils;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;

View File

@@ -55,6 +55,7 @@ import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.io.UrlResource;
import org.springframework.core.io.support.EncodedResource;
import org.springframework.core.test.fixtures.io.SerializationTestUtils;
import org.springframework.tests.sample.beans.DependenciesBean;
import org.springframework.tests.sample.beans.DerivedTestBean;
import org.springframework.tests.sample.beans.ITestBean;
@@ -64,7 +65,6 @@ import org.springframework.tests.sample.beans.TestBean;
import org.springframework.tests.sample.beans.factory.DummyFactory;
import org.springframework.util.ClassUtils;
import org.springframework.util.FileCopyUtils;
import org.springframework.util.SerializationTestUtils;
import org.springframework.util.StopWatch;
import static org.assertj.core.api.Assertions.assertThat;

View File

@@ -34,13 +34,13 @@ import org.springframework.beans.factory.config.RuntimeBeanReference;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.context.support.GenericApplicationContext;
import org.springframework.tests.Assume;
import org.springframework.tests.EnabledForTestGroups;
import org.springframework.core.test.fixtures.Assume;
import org.springframework.core.test.fixtures.EnabledForTestGroups;
import org.springframework.tests.sample.beans.ITestBean;
import org.springframework.tests.sample.beans.TestBean;
import static org.assertj.core.api.Assertions.assertThat;
import static org.springframework.tests.TestGroup.PERFORMANCE;
import static org.springframework.core.test.fixtures.TestGroup.PERFORMANCE;
/**
* @author Juergen Hoeller

View File

@@ -37,13 +37,13 @@ import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.context.support.GenericApplicationContext;
import org.springframework.core.test.fixtures.io.SerializationTestUtils;
import org.springframework.jndi.support.SimpleJndiBeanFactory;
import org.springframework.tests.mock.jndi.ExpectedLookupTemplate;
import org.springframework.tests.sample.beans.INestedTestBean;
import org.springframework.tests.sample.beans.ITestBean;
import org.springframework.tests.sample.beans.NestedTestBean;
import org.springframework.tests.sample.beans.TestBean;
import org.springframework.util.SerializationTestUtils;
import static org.assertj.core.api.Assertions.assertThat;

View File

@@ -55,11 +55,11 @@ import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.core.env.Environment;
import org.springframework.core.env.Profiles;
import org.springframework.core.io.ResourceLoader;
import org.springframework.core.test.fixtures.io.SerializationTestUtils;
import org.springframework.core.type.classreading.MetadataReader;
import org.springframework.core.type.classreading.MetadataReaderFactory;
import org.springframework.core.type.filter.TypeFilter;
import org.springframework.tests.context.SimpleMapScope;
import org.springframework.util.SerializationTestUtils;
import static org.assertj.core.api.Assertions.assertThat;
import static org.springframework.beans.factory.support.BeanDefinitionBuilder.genericBeanDefinition;

View File

@@ -23,8 +23,8 @@ import org.junit.jupiter.api.Test;
import org.springframework.aop.support.AopUtils;
import org.springframework.beans.factory.parsing.BeanDefinitionParsingException;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.core.test.fixtures.io.SerializationTestUtils;
import org.springframework.tests.context.SimpleMapScope;
import org.springframework.util.SerializationTestUtils;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;

View File

@@ -51,15 +51,15 @@ import org.springframework.core.convert.support.GenericConversionService;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.core.io.support.EncodedResource;
import org.springframework.tests.Assume;
import org.springframework.tests.EnabledForTestGroups;
import org.springframework.core.test.fixtures.Assume;
import org.springframework.core.test.fixtures.EnabledForTestGroups;
import org.springframework.core.test.fixtures.io.SerializationTestUtils;
import org.springframework.tests.sample.beans.TestBean;
import org.springframework.util.FileCopyUtils;
import org.springframework.util.SerializationTestUtils;
import org.springframework.util.StopWatch;
import static org.assertj.core.api.Assertions.assertThat;
import static org.springframework.tests.TestGroup.PERFORMANCE;
import static org.springframework.core.test.fixtures.TestGroup.PERFORMANCE;
/**
* @author Juergen Hoeller

View File

@@ -21,7 +21,7 @@ import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.GenericApplicationContext;
import org.springframework.mock.env.MockPropertySource;
import org.springframework.core.test.fixtures.env.MockPropertySource;
import org.springframework.tests.sample.beans.TestBean;
import static org.assertj.core.api.Assertions.assertThat;

View File

@@ -27,10 +27,10 @@ import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.context.Lifecycle;
import org.springframework.context.LifecycleProcessor;
import org.springframework.context.SmartLifecycle;
import org.springframework.tests.EnabledForTestGroups;
import org.springframework.core.test.fixtures.EnabledForTestGroups;
import static org.assertj.core.api.Assertions.assertThat;
import static org.springframework.tests.TestGroup.PERFORMANCE;
import static org.springframework.core.test.fixtures.TestGroup.PERFORMANCE;
/**
* @author Mark Fisher

View File

@@ -28,13 +28,12 @@ import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.context.annotation.AnnotatedBeanDefinitionReader;
import org.springframework.context.annotation.Profile;
import org.springframework.core.env.AbstractEnvironment;
import org.springframework.core.env.StandardEnvironmentTests;
import org.springframework.core.test.fixtures.env.EnvironmentTestUtils;
import org.springframework.stereotype.Component;
import static java.lang.String.format;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Tests integration between Environment and SecurityManagers. See SPR-9970.
*
@@ -50,7 +49,7 @@ public class EnvironmentSecurityManagerIntegrationTests {
@BeforeEach
public void setUp() {
originalSecurityManager = System.getSecurityManager();
env = StandardEnvironmentTests.getModifiableSystemEnvironment();
env = EnvironmentTestUtils.getModifiableSystemEnvironment();
env.put(AbstractEnvironment.ACTIVE_PROFILES_PROPERTY_NAME, "p1");
}

View File

@@ -29,8 +29,8 @@ import org.springframework.core.env.PropertySource;
import org.springframework.core.env.StandardEnvironment;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.core.test.fixtures.env.MockPropertySource;
import org.springframework.mock.env.MockEnvironment;
import org.springframework.mock.env.MockPropertySource;
import org.springframework.tests.sample.beans.TestBean;
import static org.assertj.core.api.Assertions.assertThat;

View File

@@ -18,6 +18,7 @@ package org.springframework.mock.env;
import org.springframework.core.env.AbstractEnvironment;
import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.core.test.fixtures.env.MockPropertySource;
/**
* Simple {@link ConfigurableEnvironment} implementation exposing

View File

@@ -26,16 +26,16 @@ import org.junit.jupiter.api.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.test.fixtures.EnabledForTestGroups;
import org.springframework.scheduling.TaskScheduler;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
import org.springframework.scheduling.config.IntervalTask;
import org.springframework.scheduling.config.ScheduledTaskHolder;
import org.springframework.scheduling.config.ScheduledTaskRegistrar;
import org.springframework.scheduling.config.TaskManagementConfigUtils;
import org.springframework.tests.EnabledForTestGroups;
import static org.assertj.core.api.Assertions.assertThat;
import static org.springframework.tests.TestGroup.PERFORMANCE;
import static org.springframework.core.test.fixtures.TestGroup.PERFORMANCE;
/**
* Tests use of @EnableScheduling on @Configuration classes.

View File

@@ -23,7 +23,7 @@ import java.util.concurrent.ThreadFactory;
import org.junit.jupiter.api.Test;
import org.springframework.core.task.NoOpRunnable;
import org.springframework.tests.EnabledForTestGroups;
import org.springframework.core.test.fixtures.EnabledForTestGroups;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
@@ -32,7 +32,7 @@ import static org.mockito.Mockito.atLeast;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.springframework.tests.TestGroup.PERFORMANCE;
import static org.springframework.core.test.fixtures.TestGroup.PERFORMANCE;
/**
* @author Rick Evans

View File

@@ -24,16 +24,16 @@ import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.context.support.GenericApplicationContext;
import org.springframework.core.test.fixtures.EnabledForTestGroups;
import org.springframework.scripting.Messenger;
import org.springframework.scripting.ScriptCompilationException;
import org.springframework.scripting.groovy.GroovyScriptFactory;
import org.springframework.tests.EnabledForTestGroups;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
import static org.mockito.Mockito.mock;
import static org.springframework.tests.TestGroup.PERFORMANCE;
import static org.springframework.core.test.fixtures.TestGroup.PERFORMANCE;
/**
* @author Rick Evans

View File

@@ -50,8 +50,8 @@ import org.junit.jupiter.api.Test;
import org.springframework.beans.BeanWrapper;
import org.springframework.beans.BeanWrapperImpl;
import org.springframework.context.support.StaticMessageSource;
import org.springframework.core.test.fixtures.io.SerializationTestUtils;
import org.springframework.util.ObjectUtils;
import org.springframework.util.SerializationTestUtils;
import org.springframework.validation.BeanPropertyBindingResult;
import org.springframework.validation.FieldError;