java.lang.Object | ||||||||||
↳ | junit.framework.Assert | |||||||||
↳ | junit.framework.TestCase | |||||||||
↳ | org.springframework.test.ConditionalTestCase | |||||||||
↳ | org.springframework.test.AbstractSpringContextTests | |||||||||
↳ | org.springframework.test.AbstractSingleSpringContextTests | |||||||||
↳ | org.springframework.test.AbstractDependencyInjectionSpringContextTests | |||||||||
↳ | org.springframework.test.AbstractTransactionalSpringContextTests | |||||||||
↳ | org.springframework.test.AbstractTransactionalDataSourceSpringContextTests | |||||||||
↳ | org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests | |||||||||
↳ | org.springframework.test.jpa.AbstractJpaTests |
Known Direct Subclasses |
This class is deprecated.
as of Spring 3.0, in favor of using the listener-based test context framework
(AbstractJUnit38SpringContextTests
)
Convenient support class for JPA-related tests. Offers the same contract as AbstractTransactionalDataSourceSpringContextTests and equally good performance, even when performing the instrumentation required by the JPA specification.
Exposes an EntityManagerFactory and a shared EntityManager. Requires an EntityManagerFactory to be injected, plus the DataSource and JpaTransactionManager through the superclass.
When using Xerces, make sure a post 2.0.2 version is available on the classpath to avoid a critical bug that leads to StackOverflow. Maven users are likely to encounter this problem since 2.0.2 is used by default.
A workaround is to explicitly specify the Xerces version inside the Maven POM:
<dependency> <groupId>xerces</groupId> <artifactId>xercesImpl</artifactId> <version>2.8.1</version> </dependency>
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.test.AbstractDependencyInjectionSpringContextTests
|
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
entityManagerFactory | |||||||||||
sharedEntityManager | Subclasses can use this in test cases. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Overridden to populate transaction definition from annotations.
| |||||||||||
Called to say that the "applicationContext" instance variable is dirty
and should be reloaded.
| |||||||||||
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create an EntityManager that will always automatically enlist itself in current
transactions, in contrast to an EntityManager returned by
EntityManagerFactory.createEntityManager()
(which requires an explicit joinTransaction() call). | |||||||||||
NB: This method must not have a return type of ShadowingClassLoader as that would cause that
class to be loaded eagerly when this test case loads, creating verify errors at runtime.
| |||||||||||
Customize the shadowing class loader.
| |||||||||||
Subclasses can override this to return the real location path for
orm.xml or null if they do not wish to find any orm.xml
| |||||||||||
Subclasses should override this method if they wish to disable shadow class loading.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests
| |||||||||||
From class
org.springframework.test.AbstractTransactionalDataSourceSpringContextTests
| |||||||||||
From class
org.springframework.test.AbstractTransactionalSpringContextTests
| |||||||||||
From class
org.springframework.test.AbstractDependencyInjectionSpringContextTests
| |||||||||||
From class
org.springframework.test.AbstractSingleSpringContextTests
| |||||||||||
From class
org.springframework.test.AbstractSpringContextTests
| |||||||||||
From class
org.springframework.test.ConditionalTestCase
| |||||||||||
From class
junit.framework.TestCase
| |||||||||||
From class
junit.framework.Assert
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
junit.framework.Test
|
Subclasses can use this in test cases. It will participate in any current transaction.
Overridden to populate transaction definition from annotations.
Throwable |
---|
Called to say that the "applicationContext" instance variable is dirty and should be reloaded. We need to do this if a test has modified the context (for example, by replacing a bean definition).
Create an EntityManager that will always automatically enlist itself in current
transactions, in contrast to an EntityManager returned by
EntityManagerFactory.createEntityManager()
(which requires an explicit joinTransaction()
call).
NB: This method must not have a return type of ShadowingClassLoader as that would cause that class to be loaded eagerly when this test case loads, creating verify errors at runtime.
Customize the shadowing class loader.
shadowingClassLoader | this parameter is actually of type ResourceOverridingShadowingClassLoader, and can safely to be cast to that type. However, the signature must not be of that type as that would cause the present class loader to load that type. |
---|
Subclasses can override this to return the real location path for orm.xml or null if they do not wish to find any orm.xml
Subclasses should override this method if they wish to disable shadow class loading.
The default implementation deactivates shadow class loading if Spring's InstrumentationSavingAgent has been configured on VM startup.