From aebbd949a8544d933e69030e5ee0447bb2d9ef99 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Mon, 13 Aug 2018 12:35:19 +0200 Subject: [PATCH] Suppress deprecation warnings in AnnotationProcessorPerformanceTests --- .../AnnotationProcessorPerformanceTests.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/spring-context/src/test/java/org/springframework/context/annotation/AnnotationProcessorPerformanceTests.java b/spring-context/src/test/java/org/springframework/context/annotation/AnnotationProcessorPerformanceTests.java index ebc55b7a2d..010d5781f6 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/AnnotationProcessorPerformanceTests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/AnnotationProcessorPerformanceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2015 the original author or authors. + * Copyright 2002-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,11 +21,10 @@ import javax.annotation.Resource; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.junit.Before; +import org.junit.BeforeClass; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Required; import org.springframework.beans.factory.config.RuntimeBeanReference; import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.beans.factory.support.RootBeanDefinition; @@ -47,8 +46,8 @@ public class AnnotationProcessorPerformanceTests { private static final Log factoryLog = LogFactory.getLog(DefaultListableBeanFactory.class); - @Before - public void commonAssumptions() { + @BeforeClass + public static void commonAssumptions() { Assume.group(TestGroup.PERFORMANCE); Assume.notLogging(factoryLog); } @@ -143,7 +142,9 @@ public class AnnotationProcessorPerformanceTests { private static class ResourceAnnotatedTestBean extends TestBean { @Override - @Resource @Required + @Resource + @SuppressWarnings("deprecation") + @org.springframework.beans.factory.annotation.Required public void setSpouse(ITestBean spouse) { super.setSpouse(spouse); } @@ -152,7 +153,9 @@ public class AnnotationProcessorPerformanceTests { private static class AutowiredAnnotatedTestBean extends TestBean { @Override - @Autowired @Required + @Autowired + @SuppressWarnings("deprecation") + @org.springframework.beans.factory.annotation.Required public void setSpouse(ITestBean spouse) { super.setSpouse(spouse); }