Suppressing warnings for deprecation of SimpleJdbcTemplate; polishing JavaDoc; using TestNG assertions in TestNG tests.
This commit is contained in:
parent
266e1096ce
commit
0d4469d8e3
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2010 the original author or authors.
|
||||
* Copyright 2002-2011 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.
|
||||
|
|
@ -77,6 +77,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
* @see org.springframework.test.context.junit38.AbstractTransactionalJUnit38SpringContextTests
|
||||
* @see org.springframework.test.context.testng.AbstractTransactionalTestNGSpringContextTests
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
@TestExecutionListeners(TransactionalTestExecutionListener.class)
|
||||
@Transactional
|
||||
public abstract class AbstractTransactionalJUnit4SpringContextTests extends AbstractJUnit4SpringContextTests {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2008 the original author or authors.
|
||||
* Copyright 2002-2011 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.
|
||||
|
|
@ -65,6 +65,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
* @see org.springframework.test.context.junit38.AbstractTransactionalJUnit38SpringContextTests
|
||||
* @see org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
@TestExecutionListeners(TransactionalTestExecutionListener.class)
|
||||
@Transactional
|
||||
public abstract class AbstractTransactionalTestNGSpringContextTests extends AbstractTestNGSpringContextTests {
|
||||
|
|
@ -94,7 +95,6 @@ public abstract class AbstractTransactionalTestNGSpringContextTests extends Abst
|
|||
this.sqlScriptEncoding = sqlScriptEncoding;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Count the rows in the given table.
|
||||
* @param tableName table name to count rows in
|
||||
|
|
@ -125,12 +125,11 @@ public abstract class AbstractTransactionalTestNGSpringContextTests extends Abst
|
|||
* @throws DataAccessException if there is an error executing a statement
|
||||
* and continueOnError was <code>false</code>
|
||||
*/
|
||||
protected void executeSqlScript(String sqlResourcePath, boolean continueOnError)
|
||||
throws DataAccessException {
|
||||
protected void executeSqlScript(String sqlResourcePath, boolean continueOnError) throws DataAccessException {
|
||||
|
||||
Resource resource = this.applicationContext.getResource(sqlResourcePath);
|
||||
SimpleJdbcTestUtils.executeSqlScript(
|
||||
this.simpleJdbcTemplate, new EncodedResource(resource, this.sqlScriptEncoding), continueOnError);
|
||||
SimpleJdbcTestUtils.executeSqlScript(this.simpleJdbcTemplate, new EncodedResource(resource,
|
||||
this.sqlScriptEncoding), continueOnError);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2008 the original author or authors.
|
||||
* Copyright 2002-2011 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.
|
||||
|
|
@ -23,7 +23,6 @@ import java.util.List;
|
|||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.core.io.ResourceLoader;
|
||||
import org.springframework.core.io.support.EncodedResource;
|
||||
|
|
@ -40,6 +39,7 @@ import org.springframework.jdbc.core.simple.SimpleJdbcTemplate;
|
|||
* @author Thomas Risberg
|
||||
* @since 2.5
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public abstract class SimpleJdbcTestUtils {
|
||||
|
||||
private static final Log logger = LogFactory.getLog(SimpleJdbcTestUtils.class);
|
||||
|
|
@ -86,9 +86,8 @@ public abstract class SimpleJdbcTestUtils {
|
|||
* @throws DataAccessException if there is an error executing a statement
|
||||
* and continueOnError was <code>false</code>
|
||||
*/
|
||||
public static void executeSqlScript(SimpleJdbcTemplate simpleJdbcTemplate,
|
||||
ResourceLoader resourceLoader, String sqlResourcePath, boolean continueOnError)
|
||||
throws DataAccessException {
|
||||
public static void executeSqlScript(SimpleJdbcTemplate simpleJdbcTemplate, ResourceLoader resourceLoader,
|
||||
String sqlResourcePath, boolean continueOnError) throws DataAccessException {
|
||||
|
||||
Resource resource = resourceLoader.getResource(sqlResourcePath);
|
||||
executeSqlScript(simpleJdbcTemplate, resource, continueOnError);
|
||||
|
|
@ -107,8 +106,8 @@ public abstract class SimpleJdbcTestUtils {
|
|||
* @throws DataAccessException if there is an error executing a statement
|
||||
* and continueOnError was <code>false</code>
|
||||
*/
|
||||
public static void executeSqlScript(SimpleJdbcTemplate simpleJdbcTemplate,
|
||||
Resource resource, boolean continueOnError) throws DataAccessException {
|
||||
public static void executeSqlScript(SimpleJdbcTemplate simpleJdbcTemplate, Resource resource,
|
||||
boolean continueOnError) throws DataAccessException {
|
||||
|
||||
executeSqlScript(simpleJdbcTemplate, new EncodedResource(resource), continueOnError);
|
||||
}
|
||||
|
|
@ -126,8 +125,8 @@ public abstract class SimpleJdbcTestUtils {
|
|||
* @throws DataAccessException if there is an error executing a statement
|
||||
* and continueOnError was <code>false</code>
|
||||
*/
|
||||
public static void executeSqlScript(SimpleJdbcTemplate simpleJdbcTemplate,
|
||||
EncodedResource resource, boolean continueOnError) throws DataAccessException {
|
||||
public static void executeSqlScript(SimpleJdbcTemplate simpleJdbcTemplate, EncodedResource resource,
|
||||
boolean continueOnError) throws DataAccessException {
|
||||
|
||||
if (logger.isInfoEnabled()) {
|
||||
logger.info("Executing SQL script from " + resource);
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ import org.springframework.test.context.transaction.BeforeTransaction;
|
|||
import org.springframework.test.jdbc.SimpleJdbcTestUtils;
|
||||
|
||||
/**
|
||||
* Combined unit test for {@link AbstractJUnit38SpringContextTests} and
|
||||
* Combined integration test for {@link AbstractJUnit38SpringContextTests} and
|
||||
* {@link AbstractTransactionalJUnit38SpringContextTests}.
|
||||
*
|
||||
* @author Sam Brannen
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ import org.springframework.test.context.transaction.BeforeTransaction;
|
|||
|
||||
/**
|
||||
* <p>
|
||||
* JUnit 4 based unit test for verifying that '<em>before</em>' and '<em>after</em>'
|
||||
* JUnit 4 based integration test for verifying that '<em>before</em>' and '<em>after</em>'
|
||||
* methods of {@link TestExecutionListener TestExecutionListeners} as well as
|
||||
* {@link BeforeTransaction @BeforeTransaction} and
|
||||
* {@link AfterTransaction @AfterTransaction} methods can fail a test in a JUnit
|
||||
|
|
|
|||
|
|
@ -16,18 +16,17 @@
|
|||
|
||||
package org.springframework.test.context.junit4;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.springframework.test.transaction.TransactionTestUtils.assertInTransaction;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.Before;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import org.springframework.jdbc.core.simple.SimpleJdbcTemplate;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.TestExecutionListeners;
|
||||
|
|
@ -37,13 +36,14 @@ import org.springframework.test.context.transaction.TransactionalTestExecutionLi
|
|||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* JUnit 4 based unit test which verifies
|
||||
* JUnit 4 based integration test which verifies
|
||||
* {@link BeforeTransaction @BeforeTransaction} and
|
||||
* {@link AfterTransaction @AfterTransaction} behavior.
|
||||
*
|
||||
* @author Sam Brannen
|
||||
* @since 2.5
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration
|
||||
@TestExecutionListeners({ TransactionalTestExecutionListener.class })
|
||||
|
|
@ -73,7 +73,6 @@ public class BeforeAndAfterTransactionAnnotationTests extends AbstractTransactio
|
|||
BeforeAndAfterTransactionAnnotationTests.numAfterTransactionCalls);
|
||||
}
|
||||
|
||||
|
||||
@BeforeTransaction
|
||||
public void beforeTransaction() {
|
||||
assertInTransaction(false);
|
||||
|
|
@ -95,7 +94,8 @@ public class BeforeAndAfterTransactionAnnotationTests extends AbstractTransactio
|
|||
|
||||
@Before
|
||||
public void before() {
|
||||
assertEquals("Verifying the number of rows in the person table before a test method.", (this.inTransaction ? 1 : 0), countRowsInPersonTable(simpleJdbcTemplate));
|
||||
assertEquals("Verifying the number of rows in the person table before a test method.", (this.inTransaction ? 1
|
||||
: 0), countRowsInPersonTable(simpleJdbcTemplate));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
|
||||
/**
|
||||
* <p>
|
||||
* JUnit 4 based unit test which verifies support of Spring's
|
||||
* JUnit 4 based integration test which verifies support of Spring's
|
||||
* {@link Transactional @Transactional}, {@link NotTransactional
|
||||
* @NotTransactional}, {@link TestExecutionListeners
|
||||
* @TestExecutionListeners}, and {@link ContextConfiguration
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ import org.springframework.test.context.transaction.BeforeTransaction;
|
|||
import org.springframework.test.jdbc.SimpleJdbcTestUtils;
|
||||
|
||||
/**
|
||||
* Combined unit test for {@link AbstractJUnit4SpringContextTests} and
|
||||
* Combined integration test for {@link AbstractJUnit4SpringContextTests} and
|
||||
* {@link AbstractTransactionalJUnit4SpringContextTests}.
|
||||
*
|
||||
* @author Sam Brannen
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ import org.springframework.test.context.ContextConfiguration;
|
|||
import org.springframework.test.context.support.GenericPropertiesContextLoader;
|
||||
|
||||
/**
|
||||
* Unit tests which verify that a subclass of {@link SpringJUnit4ClassRunner}
|
||||
* Integration tests which verify that a subclass of {@link SpringJUnit4ClassRunner}
|
||||
* can specify a custom <em>default ContextLoader class name</em> that overrides
|
||||
* the standard default class name.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@ import org.junit.AfterClass;
|
|||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import org.springframework.jdbc.core.simple.SimpleJdbcTemplate;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.transaction.TransactionConfiguration;
|
||||
|
|
@ -34,7 +33,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
|
||||
/**
|
||||
* <p>
|
||||
* JUnit 4 based unit test which verifies proper transactional behavior when the
|
||||
* JUnit 4 based integration test which verifies proper transactional behavior when the
|
||||
* {@link TransactionConfiguration#defaultRollback() defaultRollback} attribute
|
||||
* of the {@link TransactionConfiguration} annotation is set to <strong><code>false</code></strong>.
|
||||
* Also tests configuration of the
|
||||
|
|
@ -45,6 +44,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
* @since 2.5
|
||||
* @see TransactionConfiguration
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration
|
||||
@TransactionConfiguration(transactionManager = "txMgr", defaultRollback = false)
|
||||
|
|
|
|||
|
|
@ -26,14 +26,13 @@ import org.junit.AfterClass;
|
|||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import org.springframework.jdbc.core.simple.SimpleJdbcTemplate;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.transaction.TransactionConfiguration;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* JUnit 4 based unit test which verifies proper transactional behavior when the
|
||||
* JUnit 4 based integration test which verifies proper transactional behavior when the
|
||||
* {@link TransactionConfiguration#defaultRollback() defaultRollback} attribute
|
||||
* of the {@link TransactionConfiguration} annotation is set to <strong><code>true</code></strong>.
|
||||
*
|
||||
|
|
@ -41,6 +40,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
* @since 2.5
|
||||
* @see TransactionConfiguration
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration
|
||||
@TransactionConfiguration(defaultRollback = true)
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ import org.springframework.test.context.transaction.BeforeTransaction;
|
|||
|
||||
/**
|
||||
* <p>
|
||||
* JUnit 4 based unit test for verifying that '<i>before</i>' and '<i>after</i>'
|
||||
* JUnit 4 based integration test for verifying that '<i>before</i>' and '<i>after</i>'
|
||||
* methods of {@link TestExecutionListener TestExecutionListeners} as well as
|
||||
* {@link BeforeTransaction @BeforeTransaction} and
|
||||
* {@link AfterTransaction @AfterTransaction} methods can fail a test in a
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
|
||||
/**
|
||||
* <p>
|
||||
* JUnit 4 based unit test which verifies support of Spring's
|
||||
* JUnit 4 based integration test which verifies support of Spring's
|
||||
* {@link Transactional @Transactional}, {@link TestExecutionListeners
|
||||
* @TestExecutionListeners}, and {@link ContextConfiguration
|
||||
* @ContextConfiguration} annotations in conjunction with the
|
||||
|
|
@ -60,6 +60,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
* @since 2.5
|
||||
* @see ClassLevelTransactionalSpringRunnerTests
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration
|
||||
@TestExecutionListeners({ DependencyInjectionTestExecutionListener.class, DirtiesContextTestExecutionListener.class,
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@ import org.junit.Test;
|
|||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Parameterized;
|
||||
import org.junit.runners.Parameterized.Parameters;
|
||||
|
||||
import org.springframework.beans.Employee;
|
||||
import org.springframework.beans.Pet;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
@ -42,7 +41,7 @@ import org.springframework.test.context.TestExecutionListeners;
|
|||
import org.springframework.test.context.support.DependencyInjectionTestExecutionListener;
|
||||
|
||||
/**
|
||||
* Simple JUnit 4 based unit test which demonstrates how to use JUnit's
|
||||
* Simple JUnit 4 based integration test which demonstrates how to use JUnit's
|
||||
* {@link Parameterized} Runner in conjunction with
|
||||
* {@link ContextConfiguration @ContextConfiguration}, the
|
||||
* {@link DependencyInjectionTestExecutionListener}, and a
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ import javax.sql.DataSource;
|
|||
import org.junit.AfterClass;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.jdbc.core.simple.SimpleJdbcTemplate;
|
||||
import org.springframework.test.annotation.Rollback;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
|
|
@ -39,6 +38,7 @@ import org.springframework.test.context.ContextConfiguration;
|
|||
* @since 2.5
|
||||
* @see Rollback
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
@ContextConfiguration
|
||||
public class RollbackOverrideDefaultRollbackFalseTransactionalSpringRunnerTests extends
|
||||
DefaultRollbackFalseTransactionalSpringRunnerTests {
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ import javax.sql.DataSource;
|
|||
import org.junit.AfterClass;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.jdbc.core.simple.SimpleJdbcTemplate;
|
||||
import org.springframework.test.annotation.Rollback;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
|
|
@ -40,6 +39,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
* @since 2.5
|
||||
* @see Rollback
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
@ContextConfiguration
|
||||
public class RollbackOverrideDefaultRollbackTrueTransactionalSpringRunnerTests extends
|
||||
DefaultRollbackTrueTransactionalSpringRunnerTests {
|
||||
|
|
@ -61,7 +61,6 @@ public class RollbackOverrideDefaultRollbackTrueTransactionalSpringRunnerTests e
|
|||
countRowsInPersonTable(simpleJdbcTemplate));
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
@Rollback(false)
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ import org.springframework.test.context.ContextConfiguration;
|
|||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* JUnit 4 based unit test which verifies support of Spring's
|
||||
* JUnit 4 based integration test which verifies support of Spring's
|
||||
* {@link Transactional @Transactional} and {@link NotTransactional
|
||||
* @NotTransactional} annotations in conjunction with {@link Timed
|
||||
* @Timed} and JUnit 4's {@link Test#timeout() timeout} attribute.
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import org.junit.Test;
|
|||
import org.springframework.test.context.ContextConfiguration;
|
||||
|
||||
/**
|
||||
* JUnit 4 based unit test for verifying support for the
|
||||
* JUnit 4 based integration test for verifying support for the
|
||||
* {@link ContextConfiguration#inheritLocations() inheritLocations} flag of
|
||||
* {@link ContextConfiguration @ContextConfiguration} indirectly proposed in <a
|
||||
* href="http://opensource.atlassian.com/projects/spring/browse/SPR-3896"
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import org.junit.Test;
|
|||
import org.springframework.test.context.ContextConfiguration;
|
||||
|
||||
/**
|
||||
* JUnit 4 based unit test for verifying support for the
|
||||
* JUnit 4 based integration test for verifying support for the
|
||||
* {@link ContextConfiguration#inheritLocations() inheritLocations} flag of
|
||||
* {@link ContextConfiguration @ContextConfiguration} indirectly proposed in <a
|
||||
* href="http://opensource.atlassian.com/projects/spring/browse/SPR-3896"
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ import org.springframework.test.context.ContextConfiguration;
|
|||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
/**
|
||||
* JUnit 4 based unit test for verifying support for the
|
||||
* JUnit 4 based integration test for verifying support for the
|
||||
* {@link ContextConfiguration#inheritLocations() inheritLocations} flag of
|
||||
* {@link ContextConfiguration @ContextConfiguration} indirectly proposed in <a
|
||||
* href="http://opensource.atlassian.com/projects/spring/browse/SPR-3896"
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.test.context.ContextConfiguration;
|
||||
|
||||
/**
|
||||
* JUnit 4 based unit test for verifying support for the
|
||||
* JUnit 4 based integration test for verifying support for the
|
||||
* {@link ContextConfiguration#inheritLocations() inheritLocations} flag of
|
||||
* {@link ContextConfiguration @ContextConfiguration} indirectly proposed in <a
|
||||
* href="http://opensource.atlassian.com/projects/spring/browse/SPR-3896"
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ import org.springframework.test.context.ContextConfiguration;
|
|||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
/**
|
||||
* JUnit 4 based unit test for verifying support for the
|
||||
* JUnit 4 based integration test for verifying support for the
|
||||
* {@link ContextConfiguration#inheritLocations() inheritLocations} flag of
|
||||
* {@link ContextConfiguration @ContextConfiguration} indirectly proposed in <a
|
||||
* href="http://opensource.atlassian.com/projects/spring/browse/SPR-3896"
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.test.context.ContextConfiguration;
|
||||
|
||||
/**
|
||||
* JUnit 4 based unit test for verifying support for the
|
||||
* JUnit 4 based integration test for verifying support for the
|
||||
* {@link ContextConfiguration#inheritLocations() inheritLocations} flag of
|
||||
* {@link ContextConfiguration @ContextConfiguration} indirectly proposed in <a
|
||||
* href="http://opensource.atlassian.com/projects/spring/browse/SPR-3896"
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ import org.springframework.test.context.ContextConfiguration;
|
|||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
/**
|
||||
* Unit tests to verify claims made in <a
|
||||
* Integration tests to verify claims made in <a
|
||||
* href="http://jira.springframework.org/browse/SPR-6128"
|
||||
* target="_blank">SPR-6128</a>.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -16,10 +16,10 @@
|
|||
|
||||
package org.springframework.test.context.testng;
|
||||
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.springframework.test.transaction.TransactionTestUtils.assertInTransaction;
|
||||
import static org.springframework.test.transaction.TransactionTestUtils.inTransaction;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
import static org.testng.Assert.assertNotNull;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
|
|
@ -113,11 +113,11 @@ public class AnnotationConfigTransactionalTestNGSpringContextTests extends
|
|||
@Test
|
||||
@NotTransactional
|
||||
public void autowiringFromConfigClass() {
|
||||
assertNotNull("The employee should have been autowired.", employee);
|
||||
assertEquals("John Smith", employee.getName());
|
||||
assertNotNull(employee, "The employee should have been autowired.");
|
||||
assertEquals(employee.getName(), "John Smith");
|
||||
|
||||
assertNotNull("The pet should have been autowired.", pet);
|
||||
assertEquals("Fido", pet.getName());
|
||||
assertNotNull(pet, "The pet should have been autowired.");
|
||||
assertEquals(pet.getName(), "Fido");
|
||||
}
|
||||
|
||||
@BeforeTransaction
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ import org.testng.annotations.BeforeMethod;
|
|||
import org.testng.annotations.Test;
|
||||
|
||||
/**
|
||||
* Combined unit test for {@link AbstractTestNGSpringContextTests} and
|
||||
* Combined integration test for {@link AbstractTestNGSpringContextTests} and
|
||||
* {@link AbstractTransactionalTestNGSpringContextTests}.
|
||||
*
|
||||
* @author Sam Brannen
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ import org.testng.annotations.Test;
|
|||
|
||||
/**
|
||||
* <p>
|
||||
* TestNG based unit test to assess the claim in <a
|
||||
* TestNG based integration test to assess the claim in <a
|
||||
* href="http://opensource.atlassian.com/projects/spring/browse/SPR-3880"
|
||||
* target="_blank">SPR-3880</a> that a "context marked dirty using
|
||||
* {@link DirtiesContext @DirtiesContext} in [a] TestNG based test is not
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ import org.testng.TestNG;
|
|||
|
||||
/**
|
||||
* <p>
|
||||
* JUnit 4 based unit test for verifying that '<i>before</i>' and '<i>after</i>'
|
||||
* JUnit 4 based integration test for verifying that '<i>before</i>' and '<i>after</i>'
|
||||
* methods of {@link TestExecutionListener TestExecutionListeners} as well as
|
||||
* {@link BeforeTransaction @BeforeTransaction} and
|
||||
* {@link AfterTransaction @AfterTransaction} methods can fail a test in a
|
||||
|
|
|
|||
Loading…
Reference in New Issue