]
Paul Bakker closed ARQ-131.
---------------------------
Assignee: Paul Bakker
Resolution: Rejected
The proposed features described in this issue are implemented in the Persistence
Extension.
Include utility base class to simplify JPA testing
--------------------------------------------------
Key: ARQ-131
URL:
https://issues.jboss.org/browse/ARQ-131
Project: Arquillian
Issue Type: Feature Request
Components: Test Harness Integration
Reporter: Paul Bakker
Assignee: Paul Bakker
Priority: Minor
Attachments: AbstractJPATest.java, ContactBeanTest.java, RollbackAfterTest.java
Two things are often needed when testing JPA code:
-1 Counting rows in a table
-2 Rolling back the transaction after each test (to speed up test execution, while
potentially dangerous)
To simplify testing it would be good to have a set of base classes that implement this
common functionality. Test class can extend a base class when this kind of functionality
is required. The Spring framework has excellent support for this and can be used for
inspiration:
http://static.springsource.org/spring/docs/3.0.x/spring-framework-referen...
I included some example code that I wrote myself to get a feel how difficult it would be
to implement. The code uses an embedded container using the EJB 3.1 API, but should off
course integrate with Arquillian.
By default each testcase runs in a transaction (using the usertransaction) and is rolled
back at the end of the test, unless the testcase is annotated
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED). The rollback behavior can
be changed with the custom @RollbackAfterTest anotation.
I would be happy to help implementing this feature.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: