Fixed BadSqlGrammarException usage in transaction test suite

Issue: SPR-10902
(cherry picked from commit ef66708)
This commit is contained in:
Juergen Hoeller 2013-09-25 13:47:15 +02:00
parent 5e88fe5842
commit beaf6992b2
2 changed files with 11 additions and 11 deletions

View File

@ -16,7 +16,7 @@
package org.springframework.test.context.junit4;
import org.springframework.jdbc.BadSqlGrammarException;
import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.simple.SimpleJdbcTemplate;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.transaction.annotation.Transactional;
@ -51,7 +51,7 @@ public abstract class AbstractTransactionalSpringRunnerTests {
try {
simpleJdbcTemplate.update("CREATE TABLE person (name VARCHAR(20) NOT NULL, PRIMARY KEY(name))");
}
catch (BadSqlGrammarException bsge) {
catch (DataAccessException dae) {
// ignore
}
}

View File

@ -34,7 +34,7 @@ import org.springframework.tests.sample.beans.Pet;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.BadSqlGrammarException;
import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.transaction.AfterTransaction;
@ -87,7 +87,7 @@ public class ConcreteTransactionalJUnit4SpringContextTests extends AbstractTrans
try {
jdbcTemplate.update("CREATE TABLE person (name VARCHAR(20) NOT NULL, PRIMARY KEY(name))");
}
catch (final BadSqlGrammarException bsge) {
catch (DataAccessException dae) {
/* ignore */
}
}