SlideShare a Scribd company logo
Others Talk,
We Listen.
Testing Java EE
Applications
using Arquillian
Reza Rahman
Senior Architect
rrahman@captechconsulting.com
@reza_rahman
CapTech
Full-service US national IT consulting firm that focuses on client best interests,
trust, servant leadership, culture, professionalism and technical excellence.
#28 in Vault's Consulting Top 50
#3 Best Consulting Internship
#9 Best Overall Internship
#1 in Meeting Client’s Needs
#7 Best Firm to Work For
#1 in Career Development
Ranked for the
7th
Consecutive Year
Copyright © 2015 CapTech Ventures, Inc. All rights reserved.
Testing, J2EE and Java EE
• Testing not addressed well by J2EE
• This has changed enormously with Java EE and Arquillian
• Java EE provides a number of enabling features
• Arquillian takes full advantage of these features
• Not the only solution, but best-of-breed
• Developer (unit and integration) testing focus for this talk
• Arquillian can also help with performance, system, etc testing
• Arquillian excels at integration/regression testing
Copyright © 2015 CapTech Ventures, Inc. All rights reserved.
Testing Servlet
• Traditional problem is bootstrapping containers from tests
• Arquillian helps by coordinating container life-cycle
• Tests close to production environments
• Also helps isolate tests
• JAX-RS 2 client API comes in very handy
• Java SE 9 may have a better HTTP client API
• HtmlUnit, HttpUnit non-standard alternatives
Copyright © 2015 CapTech Ventures, Inc. All rights reserved.
Servlet Testing Demo
https://github.com/m-reza-rahman/testing-javaee
Copyright © 2015 CapTech Ventures, Inc. All rights reserved.
Testing JSF
• Same general concept as Servlet testing
• Warp ideal for complete JSF testing
• Client and server-side tests from Arquillian
• Drone/Selenium, Graphene often sufficient
• Just the client side
Copyright © 2015 CapTech Ventures, Inc. All rights reserved.
JSF Testing Demo
https://github.com/m-reza-rahman/testing-javaee
Copyright © 2015 CapTech Ventures, Inc. All rights reserved.
Testing CDI/EJB 3
• EJB 3 significantly more testable as it is merely POJOs
• CDI increases Java EE component model level testability by leaps and
bounds
• Embedded containers, generic POJO dependency injection, @Alternative,
XML deployment descriptors, interceptors major enablers
• Arquillian test enrichment through injection, scoping
• Both mock object based unit testing as well as integration testing is possible
• Likely sufficient to stick with integration testing using close to real runtime
environments
Copyright © 2015 CapTech Ventures, Inc. All rights reserved.
Testing JPA
• CDI, EJB 3 and Arquillian works towards JPA testing
• Just testing JPA code is possible too but likely unnecessary
• JPA 2.1 data loading, schema generation
• Defining data sources within the application
• persistence.xml, orm.xml XML overrides
• Embedded databases like Java DB, Derby, HSQL
• DBUnit integration for better data consistency
• Tests can use transactions in Arquillian
Copyright © 2015 CapTech Ventures, Inc. All rights reserved.
CDI, EJB 3, JPA Testing Demo
https://github.com/m-reza-rahman/testing-javaee
Copyright © 2015 CapTech Ventures, Inc. All rights reserved.
Testing JAX-RS, WebSocket (and JAX-WS)
• Same general concept as Servlet testing
• You can use JAX-RS, WebSocket and JAX-WS client APIs with Arquillian
• For more complex cases consider UI based testing tools (e.g. soapUI for
REST and SOAP)
• JUnit integration possible
Copyright © 2015 CapTech Ventures, Inc. All rights reserved.
JAX-RS Testing Demo
https://github.com/m-reza-rahman/testing-javaee
Copyright © 2015 CapTech Ventures, Inc. All rights reserved.
WebSocket Testing Demo
https://github.com/m-reza-rahman/testing-javaee
Copyright © 2015 CapTech Ventures, Inc. All rights reserved.
Arquillian Supported Containers
Copyright © 2015 CapTech Ventures, Inc. All rights reserved.
Container Support
GlassFish Embedded, Managed, Remote
WildFly, JBoss Embedded, Managed, Remote
Weld SE, Weld EE Embedded
TomEE, OpenEJB, OpenWebBeans Embedded, Managed, Remote
WebSphere, Liberty Embedded, Managed, Remote
WebLogic Managed, Remote
Summary
• Robust, end-to-end testing a true reality with modern Java EE
• A number of key enablers in Java EE
• Arquillian best-of-breed Java EE testing tool
• Rich set of features, vibrant community
Copyright © 2015 CapTech Ventures, Inc. All rights reserved.
Resources
• Java EE Tutorials
• http://docs.oracle.com/javaee/7/tutorial/doc/home.htm
• Arquillian
• http://jboss.org/arquillian
Copyright © 2015 CapTech Ventures, Inc. All rights reserved.
Copyright © 2015 CapTech Ventures, Inc. All rights reserved.

More Related Content

PDF
Java on Azure
PPT
What's New in WebLogic 12.1.3 and Beyond
PDF
Java API for JSON Binding - Introduction and update
PPT
JavaScript Frameworks and Java EE – A Great Match
PPTX
Seven Points for Applying Java EE 7
PDF
Java EE 8: On the Horizon
PPTX
Java EE8 - by Kito Mann
PPT
Have You Seen Java EE Lately?
Java on Azure
What's New in WebLogic 12.1.3 and Beyond
Java API for JSON Binding - Introduction and update
JavaScript Frameworks and Java EE – A Great Match
Seven Points for Applying Java EE 7
Java EE 8: On the Horizon
Java EE8 - by Kito Mann
Have You Seen Java EE Lately?

What's hot (16)

PPT
Down-to-Earth Microservices with Java EE
PDF
Java EE Revisits GoF Design Patterns
PDF
Modern web application development with java ee 7
PDF
Java EE 6 Adoption in One of the World’s Largest Online Financial Systems
PDF
Finally, EE Security API JSR 375
PPTX
HTTP/2 comes to Java. What Servlet 4.0 means to you. DevNexus 2015
PPTX
Move from J2EE to Java EE
PDF
EJB and CDI - Alignment and Strategy
PDF
MVC 1.0 / JSR 371
PDF
Java EE 8 - An instant snapshot
PDF
JavaOne 2011: Migrating Spring Applications to Java EE 6
PPTX
Top 50 java ee 7 best practices [con5669]
PDF
2015 JavaOne EJB/CDI Alignment
PPT
Reactive Java EE - Let Me Count the Ways!
PDF
What is tackled in the Java EE Security API (Java EE 8)
PPTX
Java EE 8 Update
Down-to-Earth Microservices with Java EE
Java EE Revisits GoF Design Patterns
Modern web application development with java ee 7
Java EE 6 Adoption in One of the World’s Largest Online Financial Systems
Finally, EE Security API JSR 375
HTTP/2 comes to Java. What Servlet 4.0 means to you. DevNexus 2015
Move from J2EE to Java EE
EJB and CDI - Alignment and Strategy
MVC 1.0 / JSR 371
Java EE 8 - An instant snapshot
JavaOne 2011: Migrating Spring Applications to Java EE 6
Top 50 java ee 7 best practices [con5669]
2015 JavaOne EJB/CDI Alignment
Reactive Java EE - Let Me Count the Ways!
What is tackled in the Java EE Security API (Java EE 8)
Java EE 8 Update
Ad

Similar to Testing Java EE Applications Using Arquillian (20)

PDF
How to Thrive on REST/WebSocket-Based Microservices
PPTX
Oracle WebLogic Server 12.2.1 Do More with Less
PPTX
Whats New in Java 5, 6, & 7 (Webinar Presentation - June 2013)
PPTX
OOW15 - Testing Oracle E-Business Suite Best Practices
PDF
Testlink Test Management with Teamforge
PDF
Module-1_Getting-Started_with_selenium_and_Java_basics.pdf
PPT
Java EE7 in action
PDF
SVCC 2011 - 0 - 60: QA Automation @ Box
PPT
ocejwcd 6 preparation guide
PDF
Taking Flexibility to the Next Level
PPTX
Interactive Java Support to your tool -- The JShell API and Architecture
PDF
Agile Java Testing With Open Source Frameworks
PDF
Atlassian user group in itiviti
PPTX
Automated Acceptance Tests & Tool choice
PPTX
Mastering DevOps with Oracle
PPTX
4&5.pptx SOFTWARE TESTING UNIT-4 AND UNIT-5
PPTX
Melhore o Desenvolvimento do Time com DevOps na Nuvem
PPT
ocejwsd 6 preparation guide
PPTX
Selenium
PPTX
Oracle JET overview
How to Thrive on REST/WebSocket-Based Microservices
Oracle WebLogic Server 12.2.1 Do More with Less
Whats New in Java 5, 6, & 7 (Webinar Presentation - June 2013)
OOW15 - Testing Oracle E-Business Suite Best Practices
Testlink Test Management with Teamforge
Module-1_Getting-Started_with_selenium_and_Java_basics.pdf
Java EE7 in action
SVCC 2011 - 0 - 60: QA Automation @ Box
ocejwcd 6 preparation guide
Taking Flexibility to the Next Level
Interactive Java Support to your tool -- The JShell API and Architecture
Agile Java Testing With Open Source Frameworks
Atlassian user group in itiviti
Automated Acceptance Tests & Tool choice
Mastering DevOps with Oracle
4&5.pptx SOFTWARE TESTING UNIT-4 AND UNIT-5
Melhore o Desenvolvimento do Time com DevOps na Nuvem
ocejwsd 6 preparation guide
Selenium
Oracle JET overview
Ad

Recently uploaded (20)

PDF
Empathic Computing: Creating Shared Understanding
PDF
HCSP-Presales-Campus Network Planning and Design V1.0 Training Material-Witho...
PDF
cuic standard and advanced reporting.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
CIFDAQ's Market Wrap: Ethereum Leads, Bitcoin Lags, Institutions Shift
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Advanced Soft Computing BINUS July 2025.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Telecom Fraud Prevention Guide | Hyperlink InfoSystem
PDF
Sensors and Actuators in IoT Systems using pdf
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Empathic Computing: Creating Shared Understanding
HCSP-Presales-Campus Network Planning and Design V1.0 Training Material-Witho...
cuic standard and advanced reporting.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
Spectral efficient network and resource selection model in 5G networks
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
Advanced methodologies resolving dimensionality complications for autism neur...
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
CIFDAQ's Market Wrap: Ethereum Leads, Bitcoin Lags, Institutions Shift
Review of recent advances in non-invasive hemoglobin estimation
20250228 LYD VKU AI Blended-Learning.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
Understanding_Digital_Forensics_Presentation.pptx
Advanced Soft Computing BINUS July 2025.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Diabetes mellitus diagnosis method based random forest with bat algorithm
Telecom Fraud Prevention Guide | Hyperlink InfoSystem
Sensors and Actuators in IoT Systems using pdf
CIFDAQ's Market Insight: SEC Turns Pro Crypto

Testing Java EE Applications Using Arquillian

  • 1. Others Talk, We Listen. Testing Java EE Applications using Arquillian Reza Rahman Senior Architect [email protected] @reza_rahman
  • 2. CapTech Full-service US national IT consulting firm that focuses on client best interests, trust, servant leadership, culture, professionalism and technical excellence. #28 in Vault's Consulting Top 50 #3 Best Consulting Internship #9 Best Overall Internship #1 in Meeting Client’s Needs #7 Best Firm to Work For #1 in Career Development Ranked for the 7th Consecutive Year Copyright © 2015 CapTech Ventures, Inc. All rights reserved.
  • 3. Testing, J2EE and Java EE • Testing not addressed well by J2EE • This has changed enormously with Java EE and Arquillian • Java EE provides a number of enabling features • Arquillian takes full advantage of these features • Not the only solution, but best-of-breed • Developer (unit and integration) testing focus for this talk • Arquillian can also help with performance, system, etc testing • Arquillian excels at integration/regression testing Copyright © 2015 CapTech Ventures, Inc. All rights reserved.
  • 4. Testing Servlet • Traditional problem is bootstrapping containers from tests • Arquillian helps by coordinating container life-cycle • Tests close to production environments • Also helps isolate tests • JAX-RS 2 client API comes in very handy • Java SE 9 may have a better HTTP client API • HtmlUnit, HttpUnit non-standard alternatives Copyright © 2015 CapTech Ventures, Inc. All rights reserved.
  • 6. Testing JSF • Same general concept as Servlet testing • Warp ideal for complete JSF testing • Client and server-side tests from Arquillian • Drone/Selenium, Graphene often sufficient • Just the client side Copyright © 2015 CapTech Ventures, Inc. All rights reserved.
  • 8. Testing CDI/EJB 3 • EJB 3 significantly more testable as it is merely POJOs • CDI increases Java EE component model level testability by leaps and bounds • Embedded containers, generic POJO dependency injection, @Alternative, XML deployment descriptors, interceptors major enablers • Arquillian test enrichment through injection, scoping • Both mock object based unit testing as well as integration testing is possible • Likely sufficient to stick with integration testing using close to real runtime environments Copyright © 2015 CapTech Ventures, Inc. All rights reserved.
  • 9. Testing JPA • CDI, EJB 3 and Arquillian works towards JPA testing • Just testing JPA code is possible too but likely unnecessary • JPA 2.1 data loading, schema generation • Defining data sources within the application • persistence.xml, orm.xml XML overrides • Embedded databases like Java DB, Derby, HSQL • DBUnit integration for better data consistency • Tests can use transactions in Arquillian Copyright © 2015 CapTech Ventures, Inc. All rights reserved.
  • 10. CDI, EJB 3, JPA Testing Demo https://github.com/m-reza-rahman/testing-javaee Copyright © 2015 CapTech Ventures, Inc. All rights reserved.
  • 11. Testing JAX-RS, WebSocket (and JAX-WS) • Same general concept as Servlet testing • You can use JAX-RS, WebSocket and JAX-WS client APIs with Arquillian • For more complex cases consider UI based testing tools (e.g. soapUI for REST and SOAP) • JUnit integration possible Copyright © 2015 CapTech Ventures, Inc. All rights reserved.
  • 14. Arquillian Supported Containers Copyright © 2015 CapTech Ventures, Inc. All rights reserved. Container Support GlassFish Embedded, Managed, Remote WildFly, JBoss Embedded, Managed, Remote Weld SE, Weld EE Embedded TomEE, OpenEJB, OpenWebBeans Embedded, Managed, Remote WebSphere, Liberty Embedded, Managed, Remote WebLogic Managed, Remote
  • 15. Summary • Robust, end-to-end testing a true reality with modern Java EE • A number of key enablers in Java EE • Arquillian best-of-breed Java EE testing tool • Rich set of features, vibrant community Copyright © 2015 CapTech Ventures, Inc. All rights reserved.
  • 16. Resources • Java EE Tutorials • http://docs.oracle.com/javaee/7/tutorial/doc/home.htm • Arquillian • http://jboss.org/arquillian Copyright © 2015 CapTech Ventures, Inc. All rights reserved.
  • 17. Copyright © 2015 CapTech Ventures, Inc. All rights reserved.