[arquillian-issues] [JBoss JIRA] (ARQ-131) Include utility base class to simplify JPA testing

Paul Bakker (JIRA) jira-events at lists.jboss.org
Fri Mar 2 03:03:36 EST 2012


    [ https://issues.jboss.org/browse/ARQ-131?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12673008#comment-12673008 ] 

Paul Bakker commented on ARQ-131:
---------------------------------

Yes it does, this issue is outdated and can be closed :-)
                
> 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
>            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-reference/html/testing.html#testcontext-support-classes-junit4
> 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: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the arquillian-issues mailing list