+ All Categories
Home > Software > Testing the Java EE

Testing the Java EE

Date post: 21-Jan-2017
Category:
Upload: dmitry-alexandrov
View: 65 times
Download: 0 times
Share this document with a friend
12
Testing the Java EE with Arquillian jug.bg | #bgjug | @bgjug Sofia | October 23, 2015
Transcript
Page 1: Testing the Java EE

Testing the Java EEwith Arquillian

jug.bg | #bgjug | @bgjugSofia | October 23, 2015

Page 2: Testing the Java EE

Inspired by Reza Rahman

jug.bg | #bgjug | @bgjugSofia | October 23, 2015

Page 3: Testing the Java EE

AgendaArquillianTesting ServletTesting JSFTesting EJB3/CDITesting RS, WSSummary

jug.bg | #bgjug | @bgjugSofia | October 23, 2015

Page 4: Testing the Java EE

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

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

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

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

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

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

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

Learn moreArquillian– http://jboss.org/arquillian

jug.bg | #bgjug | @bgjugSofia | October 23, 2015

Page 12: Testing the Java EE

jug.bg | #bgjug | @bgjugSofia | October 23, 2015


Recommended