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

@@ -16,8 +16,8 @@
package org.springframework.aop.aspectj;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.aop.aspectj.AdviceBindingTestAspect.AdviceBindingCollaborator;
import org.springframework.aop.framework.Advised;
@@ -46,7 +46,7 @@ public class AfterAdviceBindingTests {
private TestBean testBeanTarget;
@Before
@BeforeEach
public void setup() throws Exception {
ClassPathXmlApplicationContext ctx =
new ClassPathXmlApplicationContext(getClass().getSimpleName() + ".xml", getClass());

View File

@@ -16,8 +16,8 @@
package org.springframework.aop.aspectj;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.aop.aspectj.AfterReturningAdviceBindingTestAspect.AfterReturningAdviceBindingCollaborator;
import org.springframework.aop.framework.Advised;
@@ -50,7 +50,7 @@ public class AfterReturningAdviceBindingTests {
private AfterReturningAdviceBindingCollaborator mockCollaborator;
@Before
@BeforeEach
public void setup() throws Exception {
ClassPathXmlApplicationContext ctx =
new ClassPathXmlApplicationContext(getClass().getSimpleName() + ".xml", getClass());

View File

@@ -16,8 +16,8 @@
package org.springframework.aop.aspectj;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.aop.aspectj.AfterThrowingAdviceBindingTestAspect.AfterThrowingAdviceBindingCollaborator;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -42,7 +42,7 @@ public class AfterThrowingAdviceBindingTests {
private AfterThrowingAdviceBindingCollaborator mockCollaborator;
@Before
@BeforeEach
public void setup() {
ClassPathXmlApplicationContext ctx =
new ClassPathXmlApplicationContext(getClass().getSimpleName() + ".xml", getClass());

View File

@@ -17,8 +17,8 @@
package org.springframework.aop.aspectj;
import org.aspectj.lang.ProceedingJoinPoint;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.aop.aspectj.AroundAdviceBindingTestAspect.AroundAdviceBindingCollaborator;
import org.springframework.aop.framework.Advised;
@@ -48,7 +48,7 @@ public class AroundAdviceBindingTests {
protected ApplicationContext ctx;
@Before
@BeforeEach
public void onSetUp() throws Exception {
ctx = new ClassPathXmlApplicationContext(getClass().getSimpleName() + ".xml", getClass());

View File

@@ -16,7 +16,7 @@
package org.springframework.aop.aspectj;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.aop.support.AopUtils;

View File

@@ -19,8 +19,8 @@ package org.springframework.aop.aspectj;
import java.lang.reflect.Method;
import org.aspectj.lang.ProceedingJoinPoint;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.aop.MethodBeforeAdvice;
import org.springframework.beans.factory.BeanNameAware;
@@ -46,7 +46,7 @@ public class AspectAndAdvicePrecedenceTests {
private ITestBean testBean;
@Before
@BeforeEach
public void setup() {
ClassPathXmlApplicationContext ctx =
new ClassPathXmlApplicationContext(getClass().getSimpleName() + ".xml", getClass());

View File

@@ -18,8 +18,8 @@ package org.springframework.aop.aspectj;
import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.tests.sample.beans.ITestBean;
@@ -38,7 +38,7 @@ public class AspectJExpressionPointcutAdvisorTests {
private CallCountingInterceptor interceptor;
@Before
@BeforeEach
public void setup() {
ClassPathXmlApplicationContext ctx =
new ClassPathXmlApplicationContext(getClass().getSimpleName() + ".xml", getClass());

View File

@@ -18,7 +18,7 @@ package org.springframework.aop.aspectj;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.aop.aspectj.annotation.AspectJProxyFactory;
import org.springframework.aop.framework.Advised;
@@ -44,7 +44,7 @@ public class BeanNamePointcutAtAspectTests {
private CounterAspect counterAspect;
@org.junit.Before
@org.junit.jupiter.api.BeforeEach
public void setup() {
ClassPathXmlApplicationContext ctx =
new ClassPathXmlApplicationContext(getClass().getSimpleName() + ".xml", getClass());

View File

@@ -19,8 +19,8 @@ package org.springframework.aop.aspectj;
import java.lang.reflect.Method;
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.aop.MethodBeforeAdvice;
import org.springframework.aop.framework.Advised;
@@ -54,7 +54,7 @@ public class BeanNamePointcutTests {
private ClassPathXmlApplicationContext ctx;
@Before
@BeforeEach
public void setup() {
ctx = new ClassPathXmlApplicationContext(getClass().getSimpleName() + ".xml", getClass());
testBean1 = (ITestBean) ctx.getBean("testBean1");

View File

@@ -16,8 +16,8 @@
package org.springframework.aop.aspectj;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.aop.aspectj.AdviceBindingTestAspect.AdviceBindingCollaborator;
import org.springframework.aop.framework.Advised;
@@ -46,7 +46,7 @@ public class BeforeAdviceBindingTests {
private TestBean testBeanTarget;
@Before
@BeforeEach
public void setup() throws Exception {
ClassPathXmlApplicationContext ctx =
new ClassPathXmlApplicationContext(getClass().getSimpleName() + ".xml", getClass());

View File

@@ -19,8 +19,8 @@ package org.springframework.aop.aspectj;
import java.io.Serializable;
import org.aspectj.lang.ProceedingJoinPoint;
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.BeanNameAware;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -38,7 +38,7 @@ public class DeclarationOrderIndependenceTests {
private TopsyTurvyTarget target;
@Before
@BeforeEach
public void setup() {
ClassPathXmlApplicationContext ctx =
new ClassPathXmlApplicationContext(getClass().getSimpleName() + ".xml", getClass());

View File

@@ -16,8 +16,8 @@
package org.springframework.aop.aspectj;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -34,7 +34,7 @@ public class DeclareParentsDelegateRefTests {
protected Counter counter;
@Before
@BeforeEach
public void setup() {
ClassPathXmlApplicationContext ctx =
new ClassPathXmlApplicationContext(getClass().getSimpleName() + ".xml", getClass());

View File

@@ -16,8 +16,8 @@
package org.springframework.aop.aspectj;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import test.mixin.Lockable;
import org.springframework.aop.support.AopUtils;
@@ -38,7 +38,7 @@ public class DeclareParentsTests {
private Object introductionObject;
@Before
@BeforeEach
public void setup() {
ClassPathXmlApplicationContext ctx =
new ClassPathXmlApplicationContext(getClass().getSimpleName() + ".xml", getClass());

View File

@@ -18,7 +18,7 @@ package org.springframework.aop.aspectj;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.tests.sample.beans.TestBean;

View File

@@ -16,7 +16,7 @@
package org.springframework.aop.aspectj;
import org.aspectj.lang.ProceedingJoinPoint;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;

View File

@@ -16,7 +16,7 @@
package org.springframework.aop.aspectj;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.BeanCreationException;
import org.springframework.context.support.ClassPathXmlApplicationContext;

View File

@@ -18,8 +18,8 @@ package org.springframework.aop.aspectj;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.core.Ordered;
@@ -42,7 +42,7 @@ public class ProceedTests {
private ProceedTestingAspect secondTestAspect;
@Before
@BeforeEach
public void setup() {
ClassPathXmlApplicationContext ctx =
new ClassPathXmlApplicationContext(getClass().getSimpleName() + ".xml", getClass());

View File

@@ -20,7 +20,7 @@ import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.aop.framework.Advised;
import org.springframework.context.ApplicationContext;

View File

@@ -16,8 +16,8 @@
package org.springframework.aop.aspectj;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -32,7 +32,7 @@ public class SharedPointcutWithArgsMismatchTests {
private ToBeAdvised toBeAdvised;
@Before
@BeforeEach
public void setup() {
ClassPathXmlApplicationContext ctx =
new ClassPathXmlApplicationContext(getClass().getSimpleName() + ".xml", getClass());

View File

@@ -18,8 +18,8 @@ package org.springframework.aop.aspectj;
import java.io.Serializable;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.aop.framework.Advised;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -39,7 +39,7 @@ public class SubtypeSensitiveMatchingTests {
private Bar bar;
@Before
@BeforeEach
public void setup() {
ClassPathXmlApplicationContext ctx =
new ClassPathXmlApplicationContext(getClass().getSimpleName() + ".xml", getClass());

View File

@@ -18,8 +18,8 @@ package org.springframework.aop.aspectj;
import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -45,7 +45,7 @@ public class TargetPointcutSelectionTests {
public TestInterceptor testInterceptor;
@Before
@BeforeEach
public void setup() {
ClassPathXmlApplicationContext ctx =
new ClassPathXmlApplicationContext(getClass().getSimpleName() + ".xml", getClass());

View File

@@ -21,7 +21,7 @@ import java.lang.annotation.RetentionPolicy;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -42,7 +42,7 @@ public class ThisAndTargetSelectionOnlyPointcutsAtAspectJTests {
private Counter counter;
@org.junit.Before
@org.junit.jupiter.api.BeforeEach
public void setup() {
ClassPathXmlApplicationContext ctx =
new ClassPathXmlApplicationContext(getClass().getSimpleName() + ".xml", getClass());

View File

@@ -16,8 +16,8 @@
package org.springframework.aop.aspectj;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -40,7 +40,7 @@ public class ThisAndTargetSelectionOnlyPointcutsTests {
private Counter thisAsInterfaceAndTargetAsClassCounter;
@Before
@BeforeEach
public void setup() {
ClassPathXmlApplicationContext ctx =
new ClassPathXmlApplicationContext(getClass().getSimpleName() + ".xml", getClass());

View File

@@ -16,8 +16,8 @@
package org.springframework.aop.aspectj.autoproxy;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -32,7 +32,7 @@ public class AnnotationBindingTests {
private AnnotatedTestBean testBean;
@Before
@BeforeEach
public void setup() {
ClassPathXmlApplicationContext ctx =
new ClassPathXmlApplicationContext(getClass().getSimpleName() + "-context.xml", getClass());

View File

@@ -18,8 +18,8 @@ package org.springframework.aop.aspectj.autoproxy;
import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -34,7 +34,7 @@ public class AnnotationPointcutTests {
private AnnotatedTestBean testBean;
@Before
@BeforeEach
public void setup() {
ClassPathXmlApplicationContext ctx =
new ClassPathXmlApplicationContext(getClass().getSimpleName() + "-context.xml", getClass());

View File

@@ -17,7 +17,7 @@
package org.springframework.aop.aspectj.autoproxy;
import org.aspectj.lang.ProceedingJoinPoint;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.aop.framework.Advised;
import org.springframework.context.support.ClassPathXmlApplicationContext;

View File

@@ -16,7 +16,7 @@
package org.springframework.aop.aspectj.autoproxy;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.tests.sample.beans.ITestBean;

View File

@@ -28,7 +28,7 @@ import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.aop.MethodBeforeAdvice;
import org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator;

View File

@@ -20,7 +20,7 @@ import java.io.IOException;
import org.aspectj.lang.annotation.AfterThrowing;
import org.aspectj.lang.annotation.Aspect;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.aop.support.AopUtils;
import org.springframework.context.support.ClassPathXmlApplicationContext;

View File

@@ -19,8 +19,8 @@ package org.springframework.aop.aspectj.autoproxy;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
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.context.support.ClassPathXmlApplicationContext;
@@ -39,7 +39,7 @@ public class AtAspectJAnnotationBindingTests {
private ClassPathXmlApplicationContext ctx;
@Before
@BeforeEach
public void setup() {
ctx = new ClassPathXmlApplicationContext(getClass().getSimpleName() + "-context.xml", getClass());
testBean = (AnnotatedTestBean) ctx.getBean("testBean");

View File

@@ -23,7 +23,7 @@ import org.aopalliance.intercept.MethodInvocation;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.aop.Advisor;
import org.springframework.aop.AfterReturningAdvice;

View File

@@ -22,7 +22,7 @@ import java.lang.annotation.RetentionPolicy;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;

View File

@@ -22,8 +22,8 @@ import java.util.Collection;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.tests.sample.beans.Employee;
@@ -47,7 +47,7 @@ public class AfterReturningGenericTypeMatchingTests {
private CounterAspect counterAspect;
@Before
@BeforeEach
public void setup() {
ClassPathXmlApplicationContext ctx =
new ClassPathXmlApplicationContext(getClass().getSimpleName() + "-context.xml", getClass());

View File

@@ -16,7 +16,7 @@
package org.springframework.aop.aspectj.generic;
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.aop.aspectj.generic;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -47,7 +47,7 @@ public class GenericBridgeMethodMatchingTests {
@SuppressWarnings("unchecked")
@org.junit.Before
@org.junit.jupiter.api.BeforeEach
public void setup() {
ClassPathXmlApplicationContext ctx =
new ClassPathXmlApplicationContext(getClass().getSimpleName() + "-context.xml", getClass());

View File

@@ -21,7 +21,7 @@ import java.util.Collection;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -42,7 +42,7 @@ public class GenericParameterMatchingTests {
@SuppressWarnings("unchecked")
@org.junit.Before
@org.junit.jupiter.api.BeforeEach
public void setup() {
ClassPathXmlApplicationContext ctx =
new ClassPathXmlApplicationContext(getClass().getSimpleName() + "-context.xml", getClass());

View File

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

View File

@@ -16,7 +16,7 @@
package org.springframework.aop.config;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.BeanCreationException;
import org.springframework.context.support.ClassPathXmlApplicationContext;

View File

@@ -16,7 +16,7 @@
package org.springframework.aop.config;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.aop.framework.Advised;
import org.springframework.aop.support.AopUtils;

View File

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

View File

@@ -17,8 +17,8 @@
package org.springframework.aop.config;
import org.aspectj.lang.ProceedingJoinPoint;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.aop.Advisor;
import org.springframework.aop.framework.Advised;
@@ -42,7 +42,7 @@ public class AopNamespaceHandlerTests {
private ApplicationContext context;
@Before
@BeforeEach
public void setup() {
this.context = new ClassPathXmlApplicationContext(getClass().getSimpleName() + "-context.xml", getClass());
}

View File

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

View File

@@ -18,8 +18,8 @@ package org.springframework.aop.config;
import java.lang.reflect.Method;
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.BeanFactory;
@@ -39,7 +39,7 @@ public class MethodLocatingFactoryBeanTests {
private MethodLocatingFactoryBean factory;
private BeanFactory beanFactory;
@Before
@BeforeEach
public void setUp() {
factory = new MethodLocatingFactoryBean();
beanFactory = mock(BeanFactory.class);

View File

@@ -16,7 +16,7 @@
package org.springframework.aop.config;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;

View File

@@ -31,9 +31,9 @@ import java.util.Map;
import org.aopalliance.aop.Advice;
import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
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 test.mixin.LockMixin;
import test.mixin.LockMixinAdvisor;
import test.mixin.Lockable;
@@ -97,12 +97,12 @@ public abstract class AbstractAopProxyTests {
* The target must be set. Verification will be automatic in tearDown
* to ensure that it was used appropriately by code.
*/
@Before
@BeforeEach
public void setUp() {
mockTargetSource.reset();
}
@After
@AfterEach
public void tearDown() {
mockTargetSource.verify();
}

View File

@@ -20,7 +20,7 @@ import java.io.Serializable;
import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import test.mixin.LockMixinAdvisor;
import org.springframework.aop.ClassFilter;

View File

@@ -20,7 +20,7 @@ import java.io.Serializable;
import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.aop.interceptor.ExposeInvocationInterceptor;
import org.springframework.aop.support.AopUtils;

View File

@@ -16,7 +16,7 @@
package org.springframework.aop.framework;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.aop.interceptor.DebugInterceptor;
import org.springframework.context.ApplicationContext;

View File

@@ -25,8 +25,8 @@ import java.util.List;
import org.aopalliance.aop.Advice;
import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import test.mixin.Lockable;
import test.mixin.LockedException;
@@ -90,7 +90,7 @@ public class ProxyFactoryBeanTests {
private BeanFactory factory;
@Before
@BeforeEach
public void setUp() throws Exception {
DefaultListableBeanFactory parent = new DefaultListableBeanFactory();
parent.registerBeanDefinition("target2", new RootBeanDefinition(TestListener.class));

View File

@@ -21,9 +21,9 @@ import java.io.Serializable;
import org.aopalliance.aop.Advice;
import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
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.aop.Advisor;
import org.springframework.aop.BeforeAdvice;
@@ -42,8 +42,8 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
*/
public class AdvisorAdapterRegistrationTests {
@Before
@After
@BeforeEach
@AfterEach
public void resetGlobalAdvisorAdapterRegistry() {
GlobalAdvisorAdapterRegistry.reset();
}

View File

@@ -18,7 +18,7 @@ package org.springframework.aop.framework.autoproxy;
import java.io.IOException;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import test.mixin.Lockable;
import org.springframework.aop.Advisor;

View File

@@ -23,7 +23,7 @@ import java.lang.reflect.Proxy;
import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.aop.TargetSource;
import org.springframework.aop.framework.ProxyFactory;

View File

@@ -18,7 +18,7 @@ package org.springframework.aop.framework.autoproxy;
import java.lang.reflect.Method;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.aop.MethodBeforeAdvice;
import org.springframework.context.support.ClassPathXmlApplicationContext;

View File

@@ -16,8 +16,8 @@
package org.springframework.aop.framework.autoproxy;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import test.mixin.Lockable;
import test.mixin.LockedException;
@@ -45,7 +45,7 @@ public class BeanNameAutoProxyCreatorTests {
private BeanFactory beanFactory;
@Before
@BeforeEach
public void setup() {
// Note that we need an ApplicationContext, not just a BeanFactory,
// for post-processing and hence auto-proxying to work.

View File

@@ -20,7 +20,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.aop.support.AopUtils;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;

View File

@@ -18,9 +18,9 @@ package org.springframework.aop.target;
import java.util.NoSuchElementException;
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.aop.framework.Advised;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
@@ -54,7 +54,7 @@ public class CommonsPool2TargetSourceTests {
private DefaultListableBeanFactory beanFactory;
@Before
@BeforeEach
public void setUp() throws Exception {
this.beanFactory = new DefaultListableBeanFactory();
new XmlBeanDefinitionReader(this.beanFactory).loadBeanDefinitions(
@@ -64,7 +64,7 @@ public class CommonsPool2TargetSourceTests {
/**
* We must simulate container shutdown, which should clear threads.
*/
@After
@AfterEach
public void tearDown() {
// Will call pool.close()
this.beanFactory.destroySingletons();

View File

@@ -19,7 +19,7 @@ package org.springframework.beans.factory.annotation;
import javax.inject.Inject;
import javax.inject.Named;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.stereotype.Component;

View File

@@ -24,7 +24,7 @@ import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Qualifier;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.aop.scope.ScopedProxyUtils;
import org.springframework.beans.factory.BeanCreationException;

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.aop.scope.ScopedProxyUtils;
import org.springframework.beans.factory.BeanCreationException;

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.aop.interceptor.DebugInterceptor;
import org.springframework.context.ApplicationContext;
@@ -42,7 +42,7 @@ public class LookupMethodWrappedByCglibProxyTests {
private ApplicationContext applicationContext;
@Before
@BeforeEach
public void setUp() {
this.applicationContext = new ClassPathXmlApplicationContext(CONTEXT, CLASS);
resetInterceptor();

View File

@@ -22,7 +22,7 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
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.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.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

View File

@@ -28,7 +28,7 @@ import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import org.apache.commons.logging.LogFactory;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.xml.sax.InputSource;
import org.springframework.aop.framework.ProxyFactory;

View File

@@ -22,8 +22,8 @@ import java.util.List;
import java.util.Map;
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.w3c.dom.Attr;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -84,7 +84,7 @@ public class CustomNamespaceHandlerTests {
private GenericApplicationContext beanFactory;
@Before
@BeforeEach
public void setUp() throws Exception {
NamespaceHandlerResolver resolver = new DefaultNamespaceHandlerResolver(CLASS.getClassLoader(), NS_PROPS);
this.beanFactory = new GenericApplicationContext();

View File

@@ -22,7 +22,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicInteger;
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.cache;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.cache.support.AbstractValueAdaptingCache;

View File

@@ -21,7 +21,7 @@ import java.util.Collections;
import java.util.List;
import java.util.Optional;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
import org.springframework.cache.annotation.CachePut;

View File

@@ -18,7 +18,7 @@ package org.springframework.cache;
import java.util.UUID;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.cache.support.NoOpCacheManager;

View File

@@ -26,7 +26,7 @@ import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.cache.interceptor.CacheEvictOperation;
import org.springframework.cache.interceptor.CacheOperation;

View File

@@ -16,7 +16,7 @@
package org.springframework.cache.concurrent;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.cache.Cache;
import org.springframework.cache.CacheManager;

View File

@@ -22,8 +22,8 @@ import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.cache.AbstractValueAdaptingCacheTests;
import org.springframework.core.serializer.support.SerializationDelegate;
@@ -48,7 +48,7 @@ public class ConcurrentMapCacheTests
protected ConcurrentMapCache cacheNoNull;
@Before
@BeforeEach
public void setUp() throws Exception {
this.nativeCache = new ConcurrentHashMap<>();
this.cache = new ConcurrentMapCache(CACHE_NAME, this.nativeCache, true);

View File

@@ -19,9 +19,9 @@ package org.springframework.cache.config;
import java.util.Collection;
import java.util.UUID;
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.aop.framework.AopProxyUtils;
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
@@ -58,7 +58,7 @@ public abstract class AbstractCacheAnnotationTests {
protected abstract ConfigurableApplicationContext getApplicationContext();
@Before
@BeforeEach
public void setup() {
this.ctx = getApplicationContext();
this.cs = ctx.getBean("service", CacheableService.class);
@@ -71,7 +71,7 @@ public abstract class AbstractCacheAnnotationTests {
assertThat(cn.contains("primary")).isTrue();
}
@After
@AfterEach
public void close() {
if (this.ctx != null) {
this.ctx.close();

View File

@@ -16,7 +16,7 @@
package org.springframework.cache.config;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.cache.interceptor.CacheErrorHandler;
import org.springframework.cache.interceptor.CacheInterceptor;

View File

@@ -16,7 +16,7 @@
package org.springframework.cache.config;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.cache.interceptor.CacheInterceptor;
import org.springframework.context.ConfigurableApplicationContext;

View File

@@ -16,7 +16,7 @@
package org.springframework.cache.config;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.BeanDefinitionStoreException;
import org.springframework.context.support.GenericXmlApplicationContext;

View File

@@ -19,9 +19,9 @@ package org.springframework.cache.config;
import java.io.IOException;
import java.util.Map;
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.cache.CacheManager;
import org.springframework.cache.CacheTestUtils;
@@ -46,13 +46,13 @@ public class CustomInterceptorTests {
protected CacheableService<?> cs;
@Before
@BeforeEach
public void setup() {
this.ctx = new AnnotationConfigApplicationContext(EnableCachingConfig.class);
this.cs = ctx.getBean("service", CacheableService.class);
}
@After
@AfterEach
public void tearDown() {
this.ctx.close();
}

View File

@@ -18,8 +18,8 @@ package org.springframework.cache.config;
import java.util.concurrent.atomic.AtomicLong;
import org.junit.After;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.Cache;
@@ -51,7 +51,7 @@ public class EnableCachingIntegrationTests {
private ConfigurableApplicationContext context;
@After
@AfterEach
public void closeContext() {
if (this.context != null) {
this.context.close();

View File

@@ -16,7 +16,7 @@
package org.springframework.cache.config;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.BeanCreationException;
import org.springframework.cache.CacheManager;

View File

@@ -16,7 +16,7 @@
package org.springframework.cache.config;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.cache.CacheManager;
import org.springframework.cache.annotation.CachePut;

View File

@@ -19,8 +19,8 @@ package org.springframework.cache.interceptor;
import java.util.Collections;
import java.util.concurrent.atomic.AtomicLong;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.cache.Cache;
import org.springframework.cache.CacheManager;
@@ -57,7 +57,7 @@ public class CacheErrorHandlerTests {
private SimpleService simpleService;
@Before
@BeforeEach
public void setup() {
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(Config.class);
this.cache = context.getBean("mockCache", Cache.class);

View File

@@ -19,7 +19,7 @@ package org.springframework.cache.interceptor;
import java.util.Arrays;
import java.util.concurrent.atomic.AtomicBoolean;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cache.concurrent.ConcurrentMapCacheManager;

View File

@@ -18,9 +18,9 @@ package org.springframework.cache.interceptor;
import java.util.concurrent.atomic.AtomicLong;
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.cache.Cache;
import org.springframework.cache.CacheManager;
@@ -51,14 +51,14 @@ public class CachePutEvaluationTests {
private SimpleService service;
@Before
@BeforeEach
public void setup() {
this.context = new AnnotationConfigApplicationContext(Config.class);
this.cache = this.context.getBean(CacheManager.class).getCache("test");
this.service = this.context.getBean(SimpleService.class);
}
@After
@AfterEach
public void close() {
if (this.context != null) {
this.context.close();

View File

@@ -21,8 +21,8 @@ import java.util.Collection;
import java.util.Collections;
import java.util.concurrent.atomic.AtomicLong;
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.NoSuchBeanDefinitionException;
import org.springframework.cache.Cache;
@@ -60,7 +60,7 @@ public class CacheResolverCustomizationTests {
private SimpleService simpleService;
@Before
@BeforeEach
public void setup() {
ApplicationContext context = new AnnotationConfigApplicationContext(Config.class);
this.cacheManager = context.getBean("cacheManager", CacheManager.class);

View File

@@ -18,9 +18,9 @@ package org.springframework.cache.interceptor;
import java.util.concurrent.atomic.AtomicLong;
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.cache.CacheManager;
import org.springframework.cache.CacheTestUtils;
@@ -48,13 +48,13 @@ public class CacheSyncFailureTests {
private SimpleService simpleService;
@Before
@BeforeEach
public void setUp() {
this.context = new AnnotationConfigApplicationContext(Config.class);
this.simpleService = this.context.getBean(SimpleService.class);
}
@After
@AfterEach
public void closeContext() {
if (this.context != null) {
this.context.close();

View File

@@ -21,7 +21,7 @@ import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.config.BeanDefinition;

View File

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

View File

@@ -22,8 +22,8 @@ import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.Locale;
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.BeanFactory;
import org.springframework.beans.factory.xml.AbstractListableBeanFactoryTests;
@@ -50,7 +50,7 @@ public abstract class AbstractApplicationContextTests extends AbstractListableBe
protected TestListener parentListener = new TestListener();
@Before
@BeforeEach
public void setUp() throws Exception {
this.applicationContext = createContext();
}

View File

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

View File

@@ -16,7 +16,7 @@
package org.springframework.context.annotation;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.BeanFactoryUtils;
import org.springframework.beans.factory.FactoryBean;

View File

@@ -22,7 +22,7 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import example.scannable.DefaultNamedComponent;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.AnnotatedBeanDefinition;
import org.springframework.beans.factory.annotation.AnnotatedGenericBeanDefinition;

View File

@@ -19,7 +19,7 @@ package org.springframework.context.annotation;
import java.util.Map;
import java.util.regex.Pattern;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.NoSuchBeanDefinitionException;

View File

@@ -24,8 +24,8 @@ import javax.annotation.Resource;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.awaitility.Awaitility;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.RuntimeBeanReference;
@@ -50,7 +50,7 @@ public class AnnotationProcessorPerformanceTests {
private static final Log factoryLog = LogFactory.getLog(DefaultListableBeanFactory.class);
@BeforeClass
@BeforeAll
public static void commonAssumptions() {
Assume.group(TestGroup.PERFORMANCE);
Assume.notLogging(factoryLog);

View File

@@ -20,7 +20,7 @@ import java.io.IOException;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.AnnotatedBeanDefinition;
import org.springframework.beans.factory.annotation.AnnotatedGenericBeanDefinition;

View File

@@ -18,7 +18,7 @@ package org.springframework.context.annotation;
import javax.annotation.PreDestroy;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator;
import org.springframework.aop.framework.autoproxy.target.LazyInitTargetSourceCreator;

View File

@@ -20,7 +20,7 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.Map;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.AnnotatedBeanDefinition;
import org.springframework.beans.factory.config.BeanDefinition;

View File

@@ -18,7 +18,7 @@ package org.springframework.context.annotation;
import java.util.List;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator;
import org.springframework.aop.interceptor.SimpleTraceInterceptor;

View File

@@ -22,7 +22,7 @@ import example.scannable.FooServiceImpl;
import example.scannable.NamedStubDao;
import example.scannable.StubFooDao;
import org.aspectj.lang.annotation.Aspect;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.beans.BeanInstantiationException;
import org.springframework.beans.factory.BeanCreationException;

View File

@@ -16,7 +16,7 @@
package org.springframework.context.annotation;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.aop.scope.ScopedObject;
import org.springframework.aop.support.AopUtils;

View File

@@ -38,7 +38,7 @@ import example.scannable.ServiceInvocationCounter;
import example.scannable.StubFooDao;
import example.scannable.sub.BarComponent;
import org.aspectj.lang.annotation.Aspect;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.AnnotatedGenericBeanDefinition;
import org.springframework.beans.factory.config.BeanDefinition;

View File

@@ -22,7 +22,7 @@ import javax.annotation.PreDestroy;
import javax.annotation.Resource;
import javax.ejb.EJB;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanCreationException;

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