Migrate rest of test suite from JUnit 4 to JUnit Jupiter

This commit migrates the rest of Spring's test suite to JUnit Jupiter,
except spring-test which will be migrated in a separate commit.

See gh-23451
This commit is contained in:
Sam Brannen
2019-08-13 12:57:37 +02:00
parent 3df85c783f
commit 3f3e41923f
1487 changed files with 5428 additions and 4782 deletions

View File

@@ -36,7 +36,7 @@ import java.util.TreeMap;
import java.util.TreeSet;
import org.apache.commons.logging.LogFactory;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowire;
import org.springframework.beans.propertyeditors.CustomNumberEditor;
@@ -76,14 +76,12 @@ import static org.assertj.core.api.Assertions.within;
*/
public abstract class AbstractPropertyAccessorTests {
protected abstract AbstractPropertyAccessor createAccessor(Object target);
@Test
public void createWithNullTarget() {
assertThatIllegalArgumentException().isThrownBy(() ->
createAccessor(null));
assertThatIllegalArgumentException().isThrownBy(() -> createAccessor(null));
}
@Test
@@ -114,8 +112,7 @@ public abstract class AbstractPropertyAccessorTests {
public void isReadablePropertyNull() {
AbstractPropertyAccessor accessor = createAccessor(new NoRead());
assertThatIllegalArgumentException().isThrownBy(() ->
accessor.isReadableProperty(null));
assertThatIllegalArgumentException().isThrownBy(() -> accessor.isReadableProperty(null));
}
@Test
@@ -129,8 +126,7 @@ public abstract class AbstractPropertyAccessorTests {
public void isWritablePropertyNull() {
AbstractPropertyAccessor accessor = createAccessor(new NoRead());
assertThatIllegalArgumentException().isThrownBy(() ->
accessor.isWritableProperty(null));
assertThatIllegalArgumentException().isThrownBy(() -> accessor.isWritableProperty(null));
}
@Test
@@ -519,7 +515,6 @@ public abstract class AbstractPropertyAccessorTests {
assertThat(target.getSpouse() == null).as("spouse is now null").isTrue();
}
@Test
public void setIndexedPropertyIgnored() {
MutablePropertyValues values = new MutablePropertyValues();
@@ -692,7 +687,6 @@ public abstract class AbstractPropertyAccessorTests {
assertThat(target.getMyPrimitiveDouble()).isCloseTo(Double.MAX_VALUE, within(0.001));
assertThat(target.getMyDouble().doubleValue()).isCloseTo(Double.MAX_VALUE, within(0.001));
}
@Test
@@ -1105,7 +1099,6 @@ public abstract class AbstractPropertyAccessorTests {
assertThat(target.getObject()).isEqualTo(array);
}
@Test
public void setCollectionProperty() {
IndexedTestBean target = new IndexedTestBean();
@@ -1918,7 +1911,6 @@ public abstract class AbstractPropertyAccessorTests {
// class to test naming of beans in a error message
}
@SuppressWarnings("unused")
private static class NumberPropertyBean {

View File

@@ -22,7 +22,7 @@ import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.util.List;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.propertyeditors.CustomDateEditor;

View File

@@ -19,8 +19,8 @@ package org.springframework.beans;
import java.util.List;
import java.util.Map;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
@@ -36,7 +36,7 @@ public class BeanWrapperAutoGrowingTests {
private final BeanWrapperImpl wrapper = new BeanWrapperImpl(bean);
@Before
@BeforeEach
public void setUp() {
wrapper.setAutoGrowNestedPaths(true);
}

View File

@@ -19,7 +19,7 @@ package org.springframework.beans;
import java.util.LinkedHashMap;
import java.util.Map;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.core.convert.support.DefaultConversionService;
import org.springframework.tests.sample.beans.CustomEnum;

View File

@@ -29,7 +29,7 @@ import java.util.Map;
import java.util.Properties;
import java.util.Set;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.beans.propertyeditors.CustomNumberEditor;
import org.springframework.beans.propertyeditors.StringTrimmerEditor;

View File

@@ -20,7 +20,7 @@ import java.util.Collections;
import java.util.Map;
import java.util.Optional;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.tests.sample.beans.TestBean;

View File

@@ -20,7 +20,7 @@ import java.beans.BeanInfo;
import java.beans.PropertyDescriptor;
import java.util.ArrayList;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.core.OverridingClassLoader;
import org.springframework.tests.sample.beans.TestBean;

View File

@@ -26,7 +26,7 @@ import java.util.Set;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;

View File

@@ -16,7 +16,7 @@
package org.springframework.beans;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.tests.sample.beans.TestBean;

View File

@@ -18,7 +18,7 @@ package org.springframework.beans;
import java.beans.IntrospectionException;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;

View File

@@ -23,7 +23,7 @@ import java.beans.Introspector;
import java.beans.PropertyDescriptor;
import java.math.BigDecimal;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.tests.sample.beans.TestBean;

View File

@@ -18,7 +18,7 @@ package org.springframework.beans;
import java.util.Iterator;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;

View File

@@ -16,7 +16,7 @@
package org.springframework.beans;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;

View File

@@ -16,7 +16,7 @@
package org.springframework.beans;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;

View File

@@ -21,7 +21,7 @@ import java.beans.IntrospectionException;
import java.beans.PropertyDescriptor;
import java.lang.reflect.Method;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;

View File

@@ -20,8 +20,8 @@ import java.util.Arrays;
import java.util.List;
import java.util.Map;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.support.StaticListableBeanFactory;
@@ -58,7 +58,7 @@ public class BeanFactoryUtilsTests {
private DefaultListableBeanFactory dependentBeansFactory;
@Before
@BeforeEach
public void setUp() {
// Interesting hierarchical factory to test counts.
// Slow to read so we cache it.

View File

@@ -27,8 +27,8 @@ import java.util.Set;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
@@ -71,7 +71,7 @@ public class ConcurrentBeanFactoryTests {
private Throwable ex;
@Before
@BeforeEach
public void setup() throws Exception {
Assume.group(TestGroup.PERFORMANCE);

View File

@@ -43,8 +43,9 @@ import javax.security.auth.Subject;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Timeout;
import org.springframework.beans.BeansException;
import org.springframework.beans.MutablePropertyValues;
@@ -2329,7 +2330,7 @@ public class DefaultListableBeanFactoryTests {
}
@Test
@Ignore // TODO re-enable when ConstructorResolver TODO sorted out
@Disabled // TODO re-enable when ConstructorResolver TODO sorted out
public void testPrototypeCreationWithConstructorArgumentsIsFastEnough() {
Assume.group(TestGroup.PERFORMANCE);
Assume.notLogging(factoryLog);
@@ -2794,7 +2795,8 @@ public class DefaultListableBeanFactoryTests {
* under the 1000 ms timeout, usually ~= 300ms. With caching removed and on the same
* hardware the method will take ~13000 ms. See SPR-6870.
*/
@Test(timeout = 1000)
@Test
@Timeout(1)
public void testByTypeLookupIsFastEnough() {
Assume.group(TestGroup.PERFORMANCE);
@@ -2810,7 +2812,8 @@ public class DefaultListableBeanFactoryTests {
}
}
@Test(timeout = 1000)
@Test
@Timeout(1)
public void testRegistrationOfManyBeanDefinitionsIsFastEnough() {
Assume.group(TestGroup.PERFORMANCE);
lbf.registerBeanDefinition("b", new RootBeanDefinition(B.class));
@@ -2821,7 +2824,8 @@ public class DefaultListableBeanFactoryTests {
}
}
@Test(timeout = 1000)
@Test
@Timeout(1)
public void testRegistrationOfManySingletonsIsFastEnough() {
Assume.group(TestGroup.PERFORMANCE);
lbf.registerBeanDefinition("b", new RootBeanDefinition(B.class));

View File

@@ -16,8 +16,8 @@
package org.springframework.beans.factory;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.config.AbstractFactoryBean;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
@@ -35,7 +35,7 @@ import static org.assertj.core.api.Assertions.assertThat;
public class FactoryBeanLookupTests {
private BeanFactory beanFactory;
@Before
@BeforeEach
public void setUp() {
beanFactory = new DefaultListableBeanFactory();
new XmlBeanDefinitionReader((BeanDefinitionRegistry) beanFactory).loadBeanDefinitions(

View File

@@ -20,7 +20,7 @@ import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.BeanPostProcessor;

View File

@@ -16,7 +16,7 @@
package org.springframework.beans.factory;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.ConstructorArgumentValues;

View File

@@ -16,7 +16,7 @@
package org.springframework.beans.factory.annotation;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.wiring.BeanWiringInfo;

View File

@@ -40,10 +40,10 @@ import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
import org.springframework.beans.factory.BeanCreationException;
@@ -92,7 +92,7 @@ public class AutowiredAnnotationBeanPostProcessorTests {
private AutowiredAnnotationBeanPostProcessor bpp;
@Before
@BeforeEach
public void setup() {
bf = new DefaultListableBeanFactory();
bf.registerResolvableDependency(BeanFactory.class, bf);
@@ -103,7 +103,7 @@ public class AutowiredAnnotationBeanPostProcessorTests {
bf.setDependencyComparator(AnnotationAwareOrderComparator.INSTANCE);
}
@After
@AfterEach
public void close() {
bf.destroySingletons();
}
@@ -2052,7 +2052,7 @@ public class AutowiredAnnotationBeanPostProcessorTests {
}
@Test
@Ignore // SPR-11521
@Disabled // SPR-11521
@SuppressWarnings("rawtypes")
public void testGenericsBasedInjectionIntoTypeVariableSelectingBestMatchAgainstFactoryMethodSignature() {
RootBeanDefinition bd = new RootBeanDefinition(GenericInterface1Impl.class);

View File

@@ -16,7 +16,7 @@
package org.springframework.beans.factory.annotation;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.config.BeanDefinitionHolder;
import org.springframework.beans.factory.config.DependencyDescriptor;

View File

@@ -26,9 +26,9 @@ import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Provider;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.BeanCreationException;
import org.springframework.beans.factory.BeanFactory;
@@ -62,7 +62,7 @@ public class InjectAnnotationBeanPostProcessorTests {
private AutowiredAnnotationBeanPostProcessor bpp;
@Before
@BeforeEach
public void setup() {
bf = new DefaultListableBeanFactory();
bf.registerResolvableDependency(BeanFactory.class, bf);
@@ -72,7 +72,7 @@ public class InjectAnnotationBeanPostProcessorTests {
bf.setAutowireCandidateResolver(new QualifierAnnotationAutowireCandidateResolver());
}
@After
@AfterEach
public void close() {
bf.destroySingletons();
}

View File

@@ -16,8 +16,8 @@
package org.springframework.beans.factory.annotation;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.support.RootBeanDefinition;
@@ -35,7 +35,7 @@ public class LookupAnnotationTests {
private DefaultListableBeanFactory beanFactory;
@Before
@BeforeEach
public void setUp() {
beanFactory = new DefaultListableBeanFactory();
AutowiredAnnotationBeanPostProcessor aabpp = new AutowiredAnnotationBeanPostProcessor();

View File

@@ -21,7 +21,7 @@ import java.lang.reflect.Executable;
import java.lang.reflect.Method;
import java.lang.reflect.Parameter;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
import org.springframework.beans.factory.config.DependencyDescriptor;

View File

@@ -21,7 +21,7 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.BeanCreationException;
import org.springframework.beans.factory.BeanFactory;

View File

@@ -25,7 +25,7 @@ import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.beans.MutablePropertyValues;
import org.springframework.beans.PropertyEditorRegistrar;

View File

@@ -19,7 +19,7 @@ package org.springframework.beans.factory.config;
import java.util.HashMap;
import java.util.Map;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;

View File

@@ -16,7 +16,7 @@
package org.springframework.beans.factory.config;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.support.RootBeanDefinition;

View File

@@ -18,7 +18,7 @@ package org.springframework.beans.factory.config;
import java.sql.Connection;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;

View File

@@ -20,7 +20,7 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.beans.propertyeditors.StringTrimmerEditor;
import org.springframework.beans.support.ArgumentConvertingMethodInvoker;

View File

@@ -19,9 +19,9 @@ package org.springframework.beans.factory.config;
import java.util.Date;
import javax.inject.Provider;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.ObjectFactory;
@@ -46,7 +46,7 @@ public class ObjectFactoryCreatingFactoryBeanTests {
private DefaultListableBeanFactory beanFactory;
@Before
@BeforeEach
public void setup() {
this.beanFactory = new DefaultListableBeanFactory();
new XmlBeanDefinitionReader(this.beanFactory).loadBeanDefinitions(
@@ -54,7 +54,7 @@ public class ObjectFactoryCreatingFactoryBeanTests {
this.beanFactory.setSerializationId("test");
}
@After
@AfterEach
public void close() {
this.beanFactory.setSerializationId(null);
}

View File

@@ -18,7 +18,7 @@ package org.springframework.beans.factory.config;
import java.util.Properties;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.core.io.Resource;

View File

@@ -16,7 +16,7 @@
package org.springframework.beans.factory.config;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;

View File

@@ -18,9 +18,9 @@ package org.springframework.beans.factory.config;
import java.util.Properties;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.support.AbstractBeanDefinition;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
@@ -52,7 +52,7 @@ public class PropertyPlaceholderConfigurerTests {
private AbstractBeanDefinition p1BeanDef;
@Before
@BeforeEach
public void setup() {
p1BeanDef = rootBeanDefinition(TestBean.class)
.addPropertyValue("name", "${" + P1 + "}")
@@ -68,7 +68,7 @@ public class PropertyPlaceholderConfigurerTests {
}
@After
@AfterEach
public void cleanup() {
System.clearProperty(P1);
}

View File

@@ -27,7 +27,7 @@ import java.util.prefs.BackingStoreException;
import java.util.prefs.Preferences;
import java.util.prefs.PreferencesFactory;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.beans.MutablePropertyValues;
import org.springframework.beans.factory.BeanDefinitionStoreException;

View File

@@ -16,9 +16,9 @@
package org.springframework.beans.factory.config;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.springframework.beans.FatalBeanException;
import org.springframework.beans.factory.BeanFactory;
@@ -44,7 +44,7 @@ public class ServiceLocatorFactoryBeanTests {
private DefaultListableBeanFactory bf;
@Before
@BeforeEach
public void setUp() {
bf = new DefaultListableBeanFactory();
}
@@ -135,7 +135,7 @@ public class ServiceLocatorFactoryBeanTests {
factory.getTestService("bogusTestService"));
}
@Ignore @Test // worked when using an ApplicationContext (see commented), fails when using BeanFactory
@Disabled @Test // worked when using an ApplicationContext (see commented), fails when using BeanFactory
public void testCombinedLocatorInterface() {
bf.registerBeanDefinition("testService", genericBeanDefinition(TestService.class).getBeanDefinition());
bf.registerAlias("testService", "1");
@@ -168,7 +168,7 @@ public class ServiceLocatorFactoryBeanTests {
assertThat(factory.toString().contains("TestServiceLocator3")).isTrue();
}
@Ignore @Test // worked when using an ApplicationContext (see commented), fails when using BeanFactory
@Disabled @Test // worked when using an ApplicationContext (see commented), fails when using BeanFactory
public void testServiceMappings() {
bf.registerBeanDefinition("testService1", genericBeanDefinition(TestService.class).getBeanDefinition());
bf.registerBeanDefinition("testService2", genericBeanDefinition(ExtendedTestService.class).getBeanDefinition());

View File

@@ -19,8 +19,8 @@ package org.springframework.beans.factory.config;
import java.util.LinkedList;
import java.util.List;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.ObjectFactory;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
@@ -42,7 +42,7 @@ public class SimpleScopeTests {
private DefaultListableBeanFactory beanFactory;
@Before
@BeforeEach
public void setup() {
beanFactory = new DefaultListableBeanFactory();
Scope scope = new NoOpScope() {

View File

@@ -21,7 +21,7 @@ import java.io.InputStream;
import java.util.LinkedHashMap;
import java.util.Map;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.yaml.snakeyaml.constructor.DuplicateKeyException;
import org.springframework.core.io.AbstractResource;

View File

@@ -20,7 +20,7 @@ import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.yaml.snakeyaml.parser.ParserException;
import org.yaml.snakeyaml.scanner.ScannerException;

View File

@@ -19,7 +19,7 @@ package org.springframework.beans.factory.config;
import java.util.Map;
import java.util.Properties;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.constructor.DuplicateKeyException;
import org.yaml.snakeyaml.scanner.ScannerException;

View File

@@ -16,7 +16,7 @@
package org.springframework.beans.factory.parsing;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;

View File

@@ -19,8 +19,8 @@ package org.springframework.beans.factory.parsing;
import java.util.ArrayList;
import java.util.List;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
@@ -43,7 +43,7 @@ public class CustomProblemReporterTests {
private XmlBeanDefinitionReader reader;
@Before
@BeforeEach
public void setup() {
this.problemReporter = new CollatingProblemReporter();
this.beanFactory = new DefaultListableBeanFactory();

View File

@@ -17,7 +17,7 @@
package org.springframework.beans.factory.parsing;
import org.apache.commons.logging.Log;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.core.io.DescriptiveResource;

View File

@@ -16,7 +16,7 @@
package org.springframework.beans.factory.parsing;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;

View File

@@ -16,7 +16,7 @@
package org.springframework.beans.factory.parsing;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;

View File

@@ -16,7 +16,7 @@
package org.springframework.beans.factory.parsing;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;

View File

@@ -16,7 +16,7 @@
package org.springframework.beans.factory.parsing;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;

View File

@@ -20,7 +20,7 @@ import java.util.List;
import java.util.ServiceLoader;
import javax.xml.parsers.DocumentBuilderFactory;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.support.RootBeanDefinition;

View File

@@ -20,7 +20,7 @@ import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.util.ReflectionUtils;

View File

@@ -18,7 +18,7 @@ package org.springframework.beans.factory.support;
import java.util.Arrays;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.tests.sample.beans.TestBean;

View File

@@ -16,7 +16,7 @@
package org.springframework.beans.factory.support;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.config.BeanDefinitionHolder;
import org.springframework.tests.sample.beans.TestBean;

View File

@@ -32,7 +32,7 @@ import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
import org.springframework.beans.PropertyEditorRegistrar;

View File

@@ -16,7 +16,7 @@
package org.springframework.beans.factory.support;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.ObjectFactory;

View File

@@ -16,7 +16,7 @@
package org.springframework.beans.factory.support;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.RuntimeBeanReference;

View File

@@ -16,8 +16,8 @@
package org.springframework.beans.factory.support;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
import org.springframework.core.io.ClassPathResource;
@@ -35,7 +35,7 @@ public class LookupMethodTests {
private DefaultListableBeanFactory beanFactory;
@Before
@BeforeEach
public void setUp() {
beanFactory = new DefaultListableBeanFactory();
XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(beanFactory);

View File

@@ -18,7 +18,7 @@ package org.springframework.beans.factory.support;
import java.util.List;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;

View File

@@ -18,7 +18,7 @@ package org.springframework.beans.factory.support;
import java.util.Map;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;

View File

@@ -18,7 +18,7 @@ package org.springframework.beans.factory.support;
import java.util.Map;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;

View File

@@ -18,7 +18,7 @@ package org.springframework.beans.factory.support;
import java.util.Set;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;

View File

@@ -16,7 +16,7 @@
package org.springframework.beans.factory.support;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.core.io.ClassPathResource;
import org.springframework.tests.sample.beans.TestBean;

View File

@@ -21,8 +21,8 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.config.ConstructorArgumentValues;
@@ -73,7 +73,7 @@ public class QualifierAnnotationAutowireBeanFactoryTests {
new DependencyDescriptor(Person.class.getDeclaredField("name"), true))).isFalse();
}
@Ignore
@Disabled
@Test
public void testAutowireCandidateWithFieldDescriptor() throws Exception {
DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
@@ -133,7 +133,7 @@ public class QualifierAnnotationAutowireBeanFactoryTests {
assertThat(lbf.isAutowireCandidate(JUERGEN, qualifiedDescriptor)).isTrue();
}
@Ignore
@Disabled
@Test
public void testAutowireCandidateWithConstructorDescriptor() throws Exception {
DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
@@ -155,7 +155,7 @@ public class QualifierAnnotationAutowireBeanFactoryTests {
assertThat(lbf.isAutowireCandidate(MARK, qualifiedDescriptor)).isFalse();
}
@Ignore
@Disabled
@Test
public void testAutowireCandidateWithMethodDescriptor() throws Exception {
DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();

View File

@@ -19,8 +19,8 @@ package org.springframework.beans.factory.support;
import java.util.Arrays;
import java.util.Map;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessor;
@@ -44,7 +44,7 @@ public class Spr8954Tests {
private DefaultListableBeanFactory bf;
@Before
@BeforeEach
public void setUp() {
bf = new DefaultListableBeanFactory();
bf.registerBeanDefinition("foo", new RootBeanDefinition(FooFactoryBean.class));

View File

@@ -32,8 +32,8 @@ import java.util.function.Consumer;
import javax.security.auth.AuthPermission;
import javax.security.auth.Subject;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanClassLoaderAware;
@@ -297,7 +297,7 @@ public class CallbacksSecurityTests {
}
}
@Before
@BeforeEach
public void setUp() throws Exception {
final ProtectionDomain empty = new ProtectionDomain(null,

View File

@@ -16,7 +16,7 @@
package org.springframework.beans.factory.wiring;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;

View File

@@ -16,7 +16,7 @@
package org.springframework.beans.factory.wiring;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;

View File

@@ -16,7 +16,7 @@
package org.springframework.beans.factory.wiring;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;

View File

@@ -19,7 +19,7 @@ package org.springframework.beans.factory.xml;
import java.beans.PropertyEditorSupport;
import java.util.StringTokenizer;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.beans.BeansException;
import org.springframework.beans.PropertyBatchUpdateException;

View File

@@ -16,7 +16,7 @@
package org.springframework.beans.factory.xml;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.FactoryBean;

View File

@@ -16,7 +16,7 @@
package org.springframework.beans.factory.xml;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.config.PropertiesFactoryBean;
import org.springframework.beans.factory.config.RuntimeBeanReference;

View File

@@ -16,8 +16,8 @@
package org.springframework.beans.factory.xml;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.support.BeanDefinitionReaderUtils;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
@@ -34,7 +34,7 @@ public class BeanNameGenerationTests {
private DefaultListableBeanFactory beanFactory;
@Before
@BeforeEach
public void setUp() {
this.beanFactory = new DefaultListableBeanFactory();
XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(this.beanFactory);

View File

@@ -22,8 +22,8 @@ import java.util.Map;
import java.util.Properties;
import java.util.Set;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.support.BeanDefinitionReader;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
@@ -44,7 +44,7 @@ public class CollectionMergingTests {
private final DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory();
@Before
@BeforeEach
public void setUp() throws Exception {
BeanDefinitionReader reader = new XmlBeanDefinitionReader(this.beanFactory);
reader.loadBeanDefinitions(new ClassPathResource("collectionMerging.xml", getClass()));

View File

@@ -19,7 +19,7 @@ package org.springframework.beans.factory.xml;
import java.util.List;
import java.util.Map;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.core.io.ClassPathResource;

View File

@@ -16,8 +16,8 @@
package org.springframework.beans.factory.xml;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.core.io.ClassPathResource;
@@ -33,7 +33,7 @@ public class DefaultLifecycleMethodsTests {
private final DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory();
@Before
@BeforeEach
public void setup() throws Exception {
new XmlBeanDefinitionReader(this.beanFactory).loadBeanDefinitions(
new ClassPathResource("defaultLifecycleMethods.xml", getClass()));

View File

@@ -16,7 +16,7 @@
package org.springframework.beans.factory.xml;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;

View File

@@ -16,7 +16,7 @@
package org.springframework.beans.factory.xml;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.core.io.ClassPathResource;

View File

@@ -18,8 +18,8 @@ package org.springframework.beans.factory.xml;
import java.util.List;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.w3c.dom.Element;
import org.springframework.beans.factory.config.BeanDefinition;
@@ -48,7 +48,7 @@ public class EventPublicationTests {
@Before
@BeforeEach
public void setUp() throws Exception {
XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(this.beanFactory);
reader.setEventListener(this.eventListener);

View File

@@ -21,7 +21,7 @@ import java.util.Collections;
import java.util.List;
import java.util.Properties;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.BeanCreationException;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;

View File

@@ -16,8 +16,8 @@
package org.springframework.beans.factory.xml;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.PropertyValue;
import org.springframework.beans.factory.config.BeanDefinition;
@@ -34,7 +34,7 @@ public class MetadataAttachmentTests {
private DefaultListableBeanFactory beanFactory;
@Before
@BeforeEach
public void setUp() throws Exception {
this.beanFactory = new DefaultListableBeanFactory();
new XmlBeanDefinitionReader(this.beanFactory).loadBeanDefinitions(

View File

@@ -16,7 +16,7 @@
package org.springframework.beans.factory.xml;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;

View File

@@ -16,7 +16,7 @@
package org.springframework.beans.factory.xml;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.core.env.ConfigurableEnvironment;

View File

@@ -17,7 +17,7 @@
package org.springframework.beans.factory.xml;
import org.assertj.core.api.Condition;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;

View File

@@ -16,7 +16,7 @@
package org.springframework.beans.factory.xml;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.xml.sax.SAXParseException;
import org.springframework.beans.BeansException;

View File

@@ -16,7 +16,7 @@
package org.springframework.beans.factory.xml;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.BeanDefinitionStoreException;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;

View File

@@ -16,7 +16,7 @@
package org.springframework.beans.factory.xml;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.BeanDefinitionStoreException;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;

View File

@@ -24,8 +24,8 @@ import java.util.Properties;
import java.util.Set;
import java.util.TreeMap;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.config.FieldRetrievingFactoryBean;
import org.springframework.beans.factory.config.PropertiesFactoryBean;
@@ -53,7 +53,7 @@ public class UtilNamespaceHandlerTests {
private CollectingReaderEventListener listener = new CollectingReaderEventListener();
@Before
@BeforeEach
public void setUp() {
this.beanFactory = new DefaultListableBeanFactory();
XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(this.beanFactory);

View File

@@ -29,8 +29,8 @@ import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.BeanCreationException;
import org.springframework.beans.factory.BeanDefinitionStoreException;
@@ -58,7 +58,7 @@ public class XmlBeanCollectionTests {
private final DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory();
@Before
@BeforeEach
public void loadBeans() {
new XmlBeanDefinitionReader(this.beanFactory).loadBeanDefinitions(
new ClassPathResource("collections.xml", getClass()));

View File

@@ -18,7 +18,7 @@ package org.springframework.beans.factory.xml;
import java.util.Arrays;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.xml.sax.InputSource;
import org.springframework.beans.factory.BeanDefinitionStoreException;

View File

@@ -21,8 +21,8 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.BeansException;
import org.springframework.beans.MutablePropertyValues;
@@ -50,7 +50,7 @@ public class XmlListableBeanFactoryTests extends AbstractListableBeanFactoryTest
private DefaultListableBeanFactory factory;
@Before
@BeforeEach
public void setup() {
parent = new DefaultListableBeanFactory();

View File

@@ -16,7 +16,7 @@
package org.springframework.beans.factory.xml.support;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver;
import org.springframework.beans.factory.xml.NamespaceHandler;

View File

@@ -20,7 +20,7 @@ import java.beans.IntrospectionException;
import java.beans.PropertyDescriptor;
import java.beans.SimpleBeanInfo;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.beans.BeanWrapper;
import org.springframework.beans.BeanWrapperImpl;

View File

@@ -18,7 +18,7 @@ package org.springframework.beans.propertyeditors;
import java.beans.PropertyEditor;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;

View File

@@ -18,7 +18,7 @@ package org.springframework.beans.propertyeditors;
import java.beans.PropertyEditor;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;

View File

@@ -20,7 +20,7 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;

View File

@@ -36,7 +36,7 @@ import java.util.StringTokenizer;
import java.util.Vector;
import java.util.regex.Pattern;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.beans.BeanWrapper;
import org.springframework.beans.BeanWrapperImpl;

View File

@@ -19,7 +19,7 @@ package org.springframework.beans.propertyeditors;
import java.beans.PropertyEditor;
import java.io.File;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.util.ClassUtils;

View File

@@ -18,7 +18,7 @@ package org.springframework.beans.propertyeditors;
import java.io.InputStream;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.util.ClassUtils;

View File

@@ -20,7 +20,7 @@ import java.beans.PropertyEditor;
import java.io.File;
import java.nio.file.Path;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.util.ClassUtils;

Some files were not shown because too many files have changed in this diff Show More