Skip to content

Commit 8af0151

Browse files
committed
Suppress recent deprecation warnings in tests
1 parent abc8058 commit 8af0151

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

spring-core/src/test/java/org/springframework/util/Log4jConfigurerTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
* @author Juergen Hoeller
3131
* @author Sam Brannen
3232
*/
33+
@SuppressWarnings("deprecation")
3334
public class Log4jConfigurerTests {
3435

3536
@Test

spring-jdbc/src/test/java/org/springframework/jdbc/support/NativeJdbcExtractorTests.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2013 the original author or authors.
2+
* Copyright 2002-2015 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -26,7 +26,6 @@
2626

2727
import org.junit.Test;
2828

29-
import org.springframework.jdbc.support.nativejdbc.CommonsDbcpNativeJdbcExtractor;
3029
import org.springframework.jdbc.support.nativejdbc.SimpleNativeJdbcExtractor;
3130

3231
import static org.junit.Assert.*;
@@ -39,7 +38,7 @@
3938
public class NativeJdbcExtractorTests {
4039

4140
@Test
42-
public void testSimpleNativeJdbcExtractor() throws SQLException {
41+
public void simpleNativeJdbcExtractor() throws SQLException {
4342
SimpleNativeJdbcExtractor extractor = new SimpleNativeJdbcExtractor();
4443

4544
Connection con = mock(Connection.class);
@@ -76,8 +75,9 @@ public void testSimpleNativeJdbcExtractor() throws SQLException {
7675
assertEquals(nativeRs, rs);
7776
}
7877

79-
public void testCommonsDbcpNativeJdbcExtractor() throws SQLException {
80-
CommonsDbcpNativeJdbcExtractor extractor = new CommonsDbcpNativeJdbcExtractor();
78+
@SuppressWarnings("deprecation")
79+
public void commonsDbcpNativeJdbcExtractor() throws SQLException {
80+
org.springframework.jdbc.support.nativejdbc.CommonsDbcpNativeJdbcExtractor extractor = new org.springframework.jdbc.support.nativejdbc.CommonsDbcpNativeJdbcExtractor();
8181
assertFalse(extractor.isNativeConnectionNecessaryForNativeStatements());
8282

8383
Connection con = mock(Connection.class);

spring-web/src/test/java/org/springframework/web/util/Log4jWebConfigurerTests.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2015 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -17,23 +17,27 @@
1717
package org.springframework.web.util;
1818

1919
import java.net.URL;
20+
2021
import javax.servlet.ServletContextEvent;
2122

2223
import org.apache.commons.logging.Log;
2324
import org.apache.commons.logging.LogFactory;
24-
import org.junit.Ignore;
25+
2526
import org.junit.Test;
2627

2728
import org.springframework.core.io.FileSystemResourceLoader;
2829
import org.springframework.mock.web.test.MockServletContext;
2930

31+
import static org.hamcrest.CoreMatchers.*;
3032
import static org.junit.Assert.*;
33+
import static org.junit.Assume.*;
3134

3235
/**
3336
* @author Juergen Hoeller
3437
* @author Sam Brannen
3538
* @since 21.02.2005
3639
*/
40+
@SuppressWarnings("deprecation")
3741
public class Log4jWebConfigurerTests {
3842

3943
private static final String TESTLOG4J_PROPERTIES = "testlog4j.properties";
@@ -78,9 +82,11 @@ public void initLoggingWithUrlAndRefreshInterval() {
7882
initLogging(url.toString(), true);
7983
}
8084

81-
@Ignore("Only works on MS Windows")
8285
@Test
8386
public void initLoggingWithAbsoluteFilePathAndRefreshInterval() {
87+
// Only works on MS Windows
88+
assumeThat(System.getProperty("os.name"), containsString("Windows"));
89+
8490
URL url = Log4jWebConfigurerTests.class.getResource(TESTLOG4J_PROPERTIES);
8591
initLogging(url.getFile(), true);
8692
}

0 commit comments

Comments
 (0)