From 499c858cd4d3c96f19db4a55d8e204e419e95b24 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Wed, 22 Jan 2014 17:45:45 +0100 Subject: [PATCH] Suppress resource/deprecation warnings in integration tests --- .../cache/annotation/EnableCachingIntegrationTests.java | 3 ++- .../context/annotation/ltw/ComponentScanningWithLTWTests.java | 3 ++- .../springframework/core/env/EnvironmentIntegrationTests.java | 4 ++-- ...pertyPlaceholderConfigurerEnvironmentIntegrationTests.java | 3 ++- .../ScheduledAndTransactionalAnnotationIntegrationTests.java | 3 ++- .../EnableTransactionManagementIntegrationTests.java | 3 ++- .../transaction/annotation/ProxyAnnotationDiscoveryTests.java | 4 +++- 7 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/test/java/org/springframework/cache/annotation/EnableCachingIntegrationTests.java b/src/test/java/org/springframework/cache/annotation/EnableCachingIntegrationTests.java index 39d221b78e..bf16d0cdd7 100644 --- a/src/test/java/org/springframework/cache/annotation/EnableCachingIntegrationTests.java +++ b/src/test/java/org/springframework/cache/annotation/EnableCachingIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -42,6 +42,7 @@ import static org.junit.Assert.*; * @author Chris Beams * @since 3.1 */ +@SuppressWarnings("resource") public class EnableCachingIntegrationTests { @Test diff --git a/src/test/java/org/springframework/context/annotation/ltw/ComponentScanningWithLTWTests.java b/src/test/java/org/springframework/context/annotation/ltw/ComponentScanningWithLTWTests.java index baa911c8f2..7d675ff65b 100644 --- a/src/test/java/org/springframework/context/annotation/ltw/ComponentScanningWithLTWTests.java +++ b/src/test/java/org/springframework/context/annotation/ltw/ComponentScanningWithLTWTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2014 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. @@ -24,6 +24,7 @@ import org.springframework.test.jpa.AbstractJpaTests; * * @author Ramnivas Laddad */ +@SuppressWarnings("deprecation") public class ComponentScanningWithLTWTests extends AbstractJpaTests { public ComponentScanningWithLTWTests() { diff --git a/src/test/java/org/springframework/core/env/EnvironmentIntegrationTests.java b/src/test/java/org/springframework/core/env/EnvironmentIntegrationTests.java index f30afd1ca1..c1649d86f1 100644 --- a/src/test/java/org/springframework/core/env/EnvironmentIntegrationTests.java +++ b/src/test/java/org/springframework/core/env/EnvironmentIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2014 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. @@ -67,7 +67,6 @@ import static org.springframework.beans.factory.support.BeanDefinitionBuilder.*; import static org.springframework.context.ConfigurableApplicationContext.*; import static org.springframework.core.env.EnvironmentIntegrationTests.Constants.*; - /** * Integration tests for container support of {@link Environment} * interface. @@ -84,6 +83,7 @@ import static org.springframework.core.env.EnvironmentIntegrationTests.Constants * * @author Chris Beams */ +@SuppressWarnings("resource") public class EnvironmentIntegrationTests { private ConfigurableEnvironment prodEnv; diff --git a/src/test/java/org/springframework/core/env/PropertyPlaceholderConfigurerEnvironmentIntegrationTests.java b/src/test/java/org/springframework/core/env/PropertyPlaceholderConfigurerEnvironmentIntegrationTests.java index 8028a4cf0f..fb95406498 100644 --- a/src/test/java/org/springframework/core/env/PropertyPlaceholderConfigurerEnvironmentIntegrationTests.java +++ b/src/test/java/org/springframework/core/env/PropertyPlaceholderConfigurerEnvironmentIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2014 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. @@ -22,6 +22,7 @@ import org.junit.Test; import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; import org.springframework.context.support.GenericApplicationContext; +@SuppressWarnings("resource") public class PropertyPlaceholderConfigurerEnvironmentIntegrationTests { @Test public void test() { diff --git a/src/test/java/org/springframework/scheduling/annotation/ScheduledAndTransactionalAnnotationIntegrationTests.java b/src/test/java/org/springframework/scheduling/annotation/ScheduledAndTransactionalAnnotationIntegrationTests.java index 8468024f99..318fa211b7 100644 --- a/src/test/java/org/springframework/scheduling/annotation/ScheduledAndTransactionalAnnotationIntegrationTests.java +++ b/src/test/java/org/springframework/scheduling/annotation/ScheduledAndTransactionalAnnotationIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -47,6 +47,7 @@ import static org.mockito.BDDMockito.*; * @author Chris Beams * @since 3.1 */ +@SuppressWarnings("resource") public class ScheduledAndTransactionalAnnotationIntegrationTests { @Before diff --git a/src/test/java/org/springframework/transaction/annotation/EnableTransactionManagementIntegrationTests.java b/src/test/java/org/springframework/transaction/annotation/EnableTransactionManagementIntegrationTests.java index b5eb2f8e1b..76f9cb955c 100644 --- a/src/test/java/org/springframework/transaction/annotation/EnableTransactionManagementIntegrationTests.java +++ b/src/test/java/org/springframework/transaction/annotation/EnableTransactionManagementIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -56,6 +56,7 @@ import org.springframework.transaction.interceptor.BeanFactoryTransactionAttribu * @author Chris Beams * @since 3.1 */ +@SuppressWarnings("resource") public class EnableTransactionManagementIntegrationTests { @Test diff --git a/src/test/java/org/springframework/transaction/annotation/ProxyAnnotationDiscoveryTests.java b/src/test/java/org/springframework/transaction/annotation/ProxyAnnotationDiscoveryTests.java index a3b509d8a7..6acd90bcb9 100644 --- a/src/test/java/org/springframework/transaction/annotation/ProxyAnnotationDiscoveryTests.java +++ b/src/test/java/org/springframework/transaction/annotation/ProxyAnnotationDiscoveryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2014 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. @@ -36,7 +36,9 @@ import org.springframework.context.annotation.Configuration; * * @author Chris Beams */ +@SuppressWarnings("resource") public class ProxyAnnotationDiscoveryTests { + @Test public void annotatedServiceWithoutInterface_PTC_true() { AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();