4. Arquillian
Java EE testing is underestimated
Arquillian takes advantage of the most JEE features
Currently the best solution (but not the only)
Excels integration/regression testing
Can also help in performance, system etc. testing
Supports JUnit and TestNG
jug.bg | #bgjug | @bgjugSofia | October 23, 2015
5. Testing Servlet
Traditional problems for bootstraping the container
– Arquillian coordinates the lifecycle
– Helps the isolation
HtmlUnit or HttpUnit comes very handy
jug.bg | #bgjug | @bgjugSofia | October 23, 2015
6. Testing JSF2
Same concept as Servlet testing
JSF2 project stages useful for testing
– Development, production, system test, unit test
Drone/Selenium, Graphene for client side
Warp for complete JSF testing
– Both client and server side tests
jug.bg | #bgjug | @bgjugSofia | October 23, 2015
7. Testing EJB3/CDI
EJB3 is unexpectedly testable
CDI increases Java EE component model level testability by leaps and bounds
Embedded containers, generic DI, @Alternative, XML Deployment, interceptors
Test enrichment via injection and scoping
Both Mock unit testing and integration testing possible
Close to real environment
jug.bg | #bgjug | @bgjugSofia | October 23, 2015
8. Testing JPA
CDI/EJB3 and arquillian works great with JPA as well
– Still isolated JPA is possible
JPA 2.1 data loading and schema generation
@DataSourceDefinition within the application
XML overrides:
– persistence.xml
Embedded DB are recommended to be used
DBUnit coexist smoothly
Transactions can be used
jug.bg | #bgjug | @bgjugSofia | October 23, 2015
9. Testing JAX-RS, WS
Same general concept
JAX-RS, WebSocket and JAX-WS client APIs can
be used arquillian
Can be automated with JMeter and SoapUI for
example
jug.bg | #bgjug | @bgjugSofia | October 23, 2015
10. Summary
Robust and modern end-to-end solution for Java EE
EJB3, JPA2, CDI, JSF2, embedded containers, client APIs
key enablers
Rich set of features
Vibrant community
jug.bg | #bgjug | @bgjugSofia | October 23, 2015