spring-projects / spring-projects/spring-framework
Improve documentation of transactional support in the TestContext framework [SPR-11399]
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 60.2k
- Forks
- 38.8k
- Avg merge
- 5d 2h
- Merged PRs (30d)
- 27
Description
Sam Brannen opened SPR-11399 and commented
Status Quo
The documentation in the reference manual for transactional support in the Spring TestContext Framework (TCF) is currently very lacking. Currently there are only two examples:
FictitiousTransactionalTest: a JUnit-based POJO test class that demonstrates the usage of all annotations related to transactions in the TCF, but in a less than exemplary fashion.AbstractClinicTests: an extension ofAbstractTransactionalJUnit4SpringContextTeststhat demonstrates the use ofcountRowsInTable()but not much else.
So, although there are two examples in the reference manual, neither of these demonstrates best practices or typical usage scenarios. Furthermore, there are zero examples using TestNG.
Deliverables
- Delete the
AbstractClinicTestsexample and create a similar JUnit-based example in the "Transaction management" or "JUnit support classes" section. - Repurpose content from the "PetClinic Example" section as a new "Best Practices" section.
- Create a TestNG-based example that is directly analogous to the new JUnit-based example, for comparison purposes.
- Add TestNG content related to the discussion in #16024.
- See pull request #456.
- Add TestNG content related to the discussion in #10800.
Affects: 3.0 GA
Issue Links:
- #16558 Document programmatic test transaction management support ("depends on")
- #10800 AbstractTransactionalTestNGSpringContextTests not working as expected when an EJB with TransactionAttribute.REQUIRES_NEW is encountered
- #16024 Support
@Transactionalon TestNG@BeforeClassmethods in the TestContext framework
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reference manual's transactional support section and the FictitiousTransactionalTest and AbstractClinicTests examples. Review PR #456 and the linked discussions in #16024 and #10800 before restructuring the examples. Done means the outdated example is replaced, JUnit and analogous TestNG best-practice examples are documented, and the requested TestNG topics are covered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- documentation, testing
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100