Skip to content

Commit

Permalink
Delete deprecated code in the TestContext framework
Browse files Browse the repository at this point in the history
This commit deletes the deprecated SimpleJdbcTestUtils class as well as
remaining usage of SimpleJdbcTemplate within the TestContext framework
and its test suite.

Issue: SPR-10499
  • Loading branch information
sbrannen committed Apr 28, 2013
1 parent 2685818 commit 88e514b
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 247 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2013 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.
Expand All @@ -24,7 +24,6 @@
import org.springframework.core.io.support.EncodedResource;
import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.simple.SimpleJdbcTemplate;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestExecutionListeners;
import org.springframework.test.context.transaction.TransactionalTestExecutionListener;
Expand Down Expand Up @@ -66,7 +65,6 @@
* @see org.springframework.test.context.transaction.TransactionalTestExecutionListener
* @see org.springframework.test.context.transaction.TransactionConfiguration
* @see org.springframework.transaction.annotation.Transactional
* @see org.springframework.test.annotation.NotTransactional
* @see org.springframework.test.annotation.Rollback
* @see org.springframework.test.context.transaction.BeforeTransaction
* @see org.springframework.test.context.transaction.AfterTransaction
Expand All @@ -78,13 +76,6 @@
@SuppressWarnings("deprecation")
public abstract class AbstractTransactionalJUnit4SpringContextTests extends AbstractJUnit4SpringContextTests {

/**
* The {@code SimpleJdbcTemplate} that this base class manages, available to subclasses.
* @deprecated As of Spring 3.2, use {@link #jdbcTemplate} instead.
*/
@Deprecated
protected SimpleJdbcTemplate simpleJdbcTemplate;

/**
* The {@code JdbcTemplate} that this base class manages, available to subclasses.
* @since 3.2
Expand All @@ -96,12 +87,11 @@ public abstract class AbstractTransactionalJUnit4SpringContextTests extends Abst

/**
* Set the {@code DataSource}, typically provided via Dependency Injection.
* <p>This method also instantiates the {@link #simpleJdbcTemplate} and
* {@link #jdbcTemplate} instance variables.
* <p>This method also instantiates the {@link #jdbcTemplate} instance
* variable.
*/
@Autowired
public void setDataSource(DataSource dataSource) {
this.simpleJdbcTemplate = new SimpleJdbcTemplate(dataSource);
this.jdbcTemplate = new JdbcTemplate(dataSource);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2013 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.
Expand All @@ -24,7 +24,6 @@
import org.springframework.core.io.support.EncodedResource;
import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.simple.SimpleJdbcTemplate;
import org.springframework.test.context.TestExecutionListeners;
import org.springframework.test.context.transaction.TransactionalTestExecutionListener;
import org.springframework.test.jdbc.JdbcTestUtils;
Expand Down Expand Up @@ -57,7 +56,6 @@
* @see org.springframework.test.context.transaction.TransactionalTestExecutionListener
* @see org.springframework.test.context.transaction.TransactionConfiguration
* @see org.springframework.transaction.annotation.Transactional
* @see org.springframework.test.annotation.NotTransactional
* @see org.springframework.test.annotation.Rollback
* @see org.springframework.test.context.transaction.BeforeTransaction
* @see org.springframework.test.context.transaction.AfterTransaction
Expand All @@ -69,13 +67,6 @@
@SuppressWarnings("deprecation")
public abstract class AbstractTransactionalTestNGSpringContextTests extends AbstractTestNGSpringContextTests {

/**
* The {@code SimpleJdbcTemplate} that this base class manages, available to subclasses.
* @deprecated As of Spring 3.2, use {@link #jdbcTemplate} instead.
*/
@Deprecated
protected SimpleJdbcTemplate simpleJdbcTemplate;

/**
* The {@code JdbcTemplate} that this base class manages, available to subclasses.
* @since 3.2
Expand All @@ -87,12 +78,11 @@ public abstract class AbstractTransactionalTestNGSpringContextTests extends Abst

/**
* Set the {@code DataSource}, typically provided via Dependency Injection.
* <p>This method also instantiates the {@link #simpleJdbcTemplate} and
* {@link #jdbcTemplate} instance variables.
* <p>This method also instantiates the {@link #jdbcTemplate} instance
* variable.
*/
@Autowired
public void setDataSource(DataSource dataSource) {
this.simpleJdbcTemplate = new SimpleJdbcTemplate(dataSource);
this.jdbcTemplate = new JdbcTemplate(dataSource);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@
* {@code JdbcTestUtils} is a collection of JDBC related utility functions
* intended to simplify standard database testing scenarios.
*
* <p>As of Spring 3.1.3, {@code JdbcTestUtils} supersedes {@link SimpleJdbcTestUtils}.
*
* @author Thomas Risberg
* @author Sam Brannen
* @author Juergen Hoeller
Expand Down

This file was deleted.

Loading

0 comments on commit 88e514b

Please sign in to comment.