Testing the Java EE
-
Upload
dmitry-alexandrov -
Category
Software
-
view
62 -
download
0
Transcript of Testing the Java EE
![Page 1: Testing the Java EE](https://reader036.fdocuments.in/reader036/viewer/2022062302/5882bde11a28abb2478b54cf/html5/thumbnails/1.jpg)
Testing the Java EEwith Arquillian
jug.bg | #bgjug | @bgjugSofia | October 23, 2015
![Page 2: Testing the Java EE](https://reader036.fdocuments.in/reader036/viewer/2022062302/5882bde11a28abb2478b54cf/html5/thumbnails/2.jpg)
Inspired by Reza Rahman
jug.bg | #bgjug | @bgjugSofia | October 23, 2015
![Page 3: Testing the Java EE](https://reader036.fdocuments.in/reader036/viewer/2022062302/5882bde11a28abb2478b54cf/html5/thumbnails/3.jpg)
AgendaArquillianTesting ServletTesting JSFTesting EJB3/CDITesting RS, WSSummary
jug.bg | #bgjug | @bgjugSofia | October 23, 2015
![Page 4: Testing the Java EE](https://reader036.fdocuments.in/reader036/viewer/2022062302/5882bde11a28abb2478b54cf/html5/thumbnails/4.jpg)
ArquillianJava 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
![Page 5: Testing the Java EE](https://reader036.fdocuments.in/reader036/viewer/2022062302/5882bde11a28abb2478b54cf/html5/thumbnails/5.jpg)
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
![Page 6: Testing the Java EE](https://reader036.fdocuments.in/reader036/viewer/2022062302/5882bde11a28abb2478b54cf/html5/thumbnails/6.jpg)
Testing JSF2Same 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
![Page 7: Testing the Java EE](https://reader036.fdocuments.in/reader036/viewer/2022062302/5882bde11a28abb2478b54cf/html5/thumbnails/7.jpg)
Testing EJB3/CDIEJB3 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
![Page 8: Testing the Java EE](https://reader036.fdocuments.in/reader036/viewer/2022062302/5882bde11a28abb2478b54cf/html5/thumbnails/8.jpg)
Testing JPACDI/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
![Page 9: Testing the Java EE](https://reader036.fdocuments.in/reader036/viewer/2022062302/5882bde11a28abb2478b54cf/html5/thumbnails/9.jpg)
Testing JAX-RS, WSSame 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
![Page 10: Testing the Java EE](https://reader036.fdocuments.in/reader036/viewer/2022062302/5882bde11a28abb2478b54cf/html5/thumbnails/10.jpg)
SummaryRobust 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
![Page 11: Testing the Java EE](https://reader036.fdocuments.in/reader036/viewer/2022062302/5882bde11a28abb2478b54cf/html5/thumbnails/11.jpg)
Learn moreArquillian– http://jboss.org/arquillian
jug.bg | #bgjug | @bgjugSofia | October 23, 2015
![Page 12: Testing the Java EE](https://reader036.fdocuments.in/reader036/viewer/2022062302/5882bde11a28abb2478b54cf/html5/thumbnails/12.jpg)
jug.bg | #bgjug | @bgjugSofia | October 23, 2015