Suppress recent deprecation warnings in tests

This commit is contained in:
Sam Brannen 2015-08-27 17:57:50 +02:00
parent abc805819f
commit 8af0151f1b
3 changed files with 15 additions and 8 deletions

View File

@ -30,6 +30,7 @@ import static org.junit.Assert.*;
* @author Juergen Hoeller
* @author Sam Brannen
*/
@SuppressWarnings("deprecation")
public class Log4jConfigurerTests {
@Test

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2015 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.
@ -26,7 +26,6 @@ import java.sql.Statement;
import org.junit.Test;
import org.springframework.jdbc.support.nativejdbc.CommonsDbcpNativeJdbcExtractor;
import org.springframework.jdbc.support.nativejdbc.SimpleNativeJdbcExtractor;
import static org.junit.Assert.*;
@ -39,7 +38,7 @@ import static org.mockito.BDDMockito.*;
public class NativeJdbcExtractorTests {
@Test
public void testSimpleNativeJdbcExtractor() throws SQLException {
public void simpleNativeJdbcExtractor() throws SQLException {
SimpleNativeJdbcExtractor extractor = new SimpleNativeJdbcExtractor();
Connection con = mock(Connection.class);
@ -76,8 +75,9 @@ public class NativeJdbcExtractorTests {
assertEquals(nativeRs, rs);
}
public void testCommonsDbcpNativeJdbcExtractor() throws SQLException {
CommonsDbcpNativeJdbcExtractor extractor = new CommonsDbcpNativeJdbcExtractor();
@SuppressWarnings("deprecation")
public void commonsDbcpNativeJdbcExtractor() throws SQLException {
org.springframework.jdbc.support.nativejdbc.CommonsDbcpNativeJdbcExtractor extractor = new org.springframework.jdbc.support.nativejdbc.CommonsDbcpNativeJdbcExtractor();
assertFalse(extractor.isNativeConnectionNecessaryForNativeStatements());
Connection con = mock(Connection.class);

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2015 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.
@ -17,23 +17,27 @@
package org.springframework.web.util;
import java.net.URL;
import javax.servlet.ServletContextEvent;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.junit.Ignore;
import org.junit.Test;
import org.springframework.core.io.FileSystemResourceLoader;
import org.springframework.mock.web.test.MockServletContext;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import static org.junit.Assume.*;
/**
* @author Juergen Hoeller
* @author Sam Brannen
* @since 21.02.2005
*/
@SuppressWarnings("deprecation")
public class Log4jWebConfigurerTests {
private static final String TESTLOG4J_PROPERTIES = "testlog4j.properties";
@ -78,9 +82,11 @@ public class Log4jWebConfigurerTests {
initLogging(url.toString(), true);
}
@Ignore("Only works on MS Windows")
@Test
public void initLoggingWithAbsoluteFilePathAndRefreshInterval() {
// Only works on MS Windows
assumeThat(System.getProperty("os.name"), containsString("Windows"));
URL url = Log4jWebConfigurerTests.class.getResource(TESTLOG4J_PROPERTIES);
initLogging(url.getFile(), true);
}