-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Description
Oran Kelly opened SPR-5305 and commented
When using AbstractTestNGSpringContextTests / AbstractTransactionalTestNGSpringContextTests it is not possible to programmatically "dirty" the application context -- the only way to discard the context is via the @DirtiesContext annotation which is at the 'method' level of granularity. As a result it is not (easily) possible to have an application context discarded after all methods in a particular test class have executed.
It would be nice, in a test class that has subclassed AbstractTestNGSpringContextTests, to be able to implement a method such as:
@AfterClass
public void setContextDirty() {
super.setDirty();
}
... thereby discarding the initialized application context from the TestContextManager's context cache.
Affects: 2.5.4
Reference URL: http://forum.springframework.org/showthread.php?t=63592
Issue Links:
- Support for @DirtiesContext at the test class level [SPR-4702] #9379 Support for
@DirtiesContextat the test class level
2 votes, 4 watchers