SlideShare a Scribd company logo
1 of 17
Download to read offline
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

What's hot

Down-to-Earth Microservices with Java EE
Down-to-Earth Microservices with Java EEDown-to-Earth Microservices with Java EE
Down-to-Earth Microservices with Java EEReza Rahman
 
Java EE Revisits GoF Design Patterns
Java EE Revisits GoF Design PatternsJava EE Revisits GoF Design Patterns
Java EE Revisits GoF Design PatternsMurat Yener
 
Modern web application development with java ee 7
Modern web application development with java ee 7Modern web application development with java ee 7
Modern web application development with java ee 7Shekhar Gulati
 
Java EE 6 Adoption in One of the World’s Largest Online Financial Systems
Java EE 6 Adoption in One of the World’s Largest Online Financial SystemsJava EE 6 Adoption in One of the World’s Largest Online Financial Systems
Java EE 6 Adoption in One of the World’s Largest Online Financial SystemsArshal Ameen
 
Finally, EE Security API JSR 375
Finally, EE Security API JSR 375Finally, EE Security API JSR 375
Finally, EE Security API JSR 375Alex Kosowski
 
HTTP/2 comes to Java. What Servlet 4.0 means to you. DevNexus 2015
HTTP/2 comes to Java.  What Servlet 4.0 means to you. DevNexus 2015HTTP/2 comes to Java.  What Servlet 4.0 means to you. DevNexus 2015
HTTP/2 comes to Java. What Servlet 4.0 means to you. DevNexus 2015Edward Burns
 
EJB and CDI - Alignment and Strategy
EJB and CDI - Alignment and StrategyEJB and CDI - Alignment and Strategy
EJB and CDI - Alignment and StrategyDavid Delabassee
 
Java EE 8 - An instant snapshot
Java EE 8 - An instant snapshot Java EE 8 - An instant snapshot
Java EE 8 - An instant snapshot David Delabassee
 
JavaOne 2011: Migrating Spring Applications to Java EE 6
JavaOne 2011: Migrating Spring Applications to Java EE 6JavaOne 2011: Migrating Spring Applications to Java EE 6
JavaOne 2011: Migrating Spring Applications to Java EE 6Bert Ertman
 
Top 50 java ee 7 best practices [con5669]
Top 50 java ee 7 best practices [con5669]Top 50 java ee 7 best practices [con5669]
Top 50 java ee 7 best practices [con5669]Ryan Cuprak
 
2015 JavaOne EJB/CDI Alignment
2015 JavaOne EJB/CDI Alignment2015 JavaOne EJB/CDI Alignment
2015 JavaOne EJB/CDI AlignmentDavid Blevins
 
Reactive Java EE - Let Me Count the Ways!
Reactive Java EE - Let Me Count the Ways!Reactive Java EE - Let Me Count the Ways!
Reactive Java EE - Let Me Count the Ways!Reza Rahman
 
What is tackled in the Java EE Security API (Java EE 8)
What is tackled in the Java EE Security API (Java EE 8)What is tackled in the Java EE Security API (Java EE 8)
What is tackled in the Java EE Security API (Java EE 8)Rudy De Busscher
 
Java EE 8 Update
Java EE 8 UpdateJava EE 8 Update
Java EE 8 UpdateRyan Cuprak
 

What's hot (16)

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

Similar to Testing Java EE Applications Using Arquillian

How to Thrive on REST/WebSocket-Based Microservices
How to Thrive on REST/WebSocket-Based MicroservicesHow to Thrive on REST/WebSocket-Based Microservices
How to Thrive on REST/WebSocket-Based MicroservicesPavel Bucek
 
Oracle WebLogic Server 12.2.1 Do More with Less
Oracle WebLogic Server 12.2.1 Do More with LessOracle WebLogic Server 12.2.1 Do More with Less
Oracle WebLogic Server 12.2.1 Do More with LessEd Burns
 
Whats New in Java 5, 6, & 7 (Webinar Presentation - June 2013)
Whats New in Java 5, 6, & 7 (Webinar Presentation - June 2013)Whats New in Java 5, 6, & 7 (Webinar Presentation - June 2013)
Whats New in Java 5, 6, & 7 (Webinar Presentation - June 2013)DevelopIntelligence
 
OOW15 - Testing Oracle E-Business Suite Best Practices
OOW15 - Testing Oracle E-Business Suite Best PracticesOOW15 - Testing Oracle E-Business Suite Best Practices
OOW15 - Testing Oracle E-Business Suite Best Practicesvasuballa
 
Testlink Test Management with Teamforge
Testlink Test Management with TeamforgeTestlink Test Management with Teamforge
Testlink Test Management with TeamforgeCollabNet
 
Module-1_Getting-Started_with_selenium_and_Java_basics.pdf
Module-1_Getting-Started_with_selenium_and_Java_basics.pdfModule-1_Getting-Started_with_selenium_and_Java_basics.pdf
Module-1_Getting-Started_with_selenium_and_Java_basics.pdfdevika266518
 
Java EE7 in action
Java EE7 in actionJava EE7 in action
Java EE7 in actionAnkara JUG
 
SVCC 2011 - 0 - 60: QA Automation @ Box
SVCC 2011 - 0 - 60: QA Automation @ BoxSVCC 2011 - 0 - 60: QA Automation @ Box
SVCC 2011 - 0 - 60: QA Automation @ BoxPeter White
 
ocejwcd 6 preparation guide
ocejwcd 6 preparation guideocejwcd 6 preparation guide
ocejwcd 6 preparation guideGanesh P
 
Taking Flexibility to the Next Level
Taking Flexibility to the Next LevelTaking Flexibility to the Next Level
Taking Flexibility to the Next LevelForgeRock
 
Interactive Java Support to your tool -- The JShell API and Architecture
Interactive Java Support to your tool -- The JShell API and ArchitectureInteractive Java Support to your tool -- The JShell API and Architecture
Interactive Java Support to your tool -- The JShell API and ArchitectureJavaDayUA
 
Agile Java Testing With Open Source Frameworks
Agile Java Testing With Open Source FrameworksAgile Java Testing With Open Source Frameworks
Agile Java Testing With Open Source FrameworksViraf Karai
 
Atlassian user group in itiviti
Atlassian user group in itivitiAtlassian user group in itiviti
Atlassian user group in itivitiGonchik Tsymzhitov
 
Automated Acceptance Tests & Tool choice
Automated Acceptance Tests & Tool choiceAutomated Acceptance Tests & Tool choice
Automated Acceptance Tests & Tool choicetoddbr
 
Mastering DevOps with Oracle
Mastering DevOps with Oracle Mastering DevOps with Oracle
Mastering DevOps with Oracle jeckels
 
4&5.pptx SOFTWARE TESTING UNIT-4 AND UNIT-5
4&5.pptx SOFTWARE TESTING UNIT-4 AND UNIT-54&5.pptx SOFTWARE TESTING UNIT-4 AND UNIT-5
4&5.pptx SOFTWARE TESTING UNIT-4 AND UNIT-5hemasubbu08
 
Melhore o Desenvolvimento do Time com DevOps na Nuvem
Melhore o Desenvolvimento do Time com DevOps na NuvemMelhore o Desenvolvimento do Time com DevOps na Nuvem
Melhore o Desenvolvimento do Time com DevOps na NuvemBruno Borges
 
ocejwsd 6 preparation guide
ocejwsd 6 preparation guideocejwsd 6 preparation guide
ocejwsd 6 preparation guideGanesh P
 

Similar to Testing Java EE Applications Using Arquillian (20)

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

Recently uploaded

VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXTarek Kalaji
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAshyamraj55
 
Linked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesLinked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesDavid Newbury
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Websitedgelyza
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdfPedro Manuel
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024D Cloud Solutions
 
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsIgniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsSafe Software
 
UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7DianaGray10
 
AI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarAI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarPrecisely
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URLRuncy Oommen
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesMd Hossain Ali
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaborationbruanjhuli
 
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfJamie (Taka) Wang
 
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...DianaGray10
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UbiTrack UK
 
Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024SkyPlanner
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6DianaGray10
 
Introduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxIntroduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxMatsuo Lab
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfDianaGray10
 

Recently uploaded (20)

VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBX
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
 
Linked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesLinked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond Ontologies
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Website
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdf
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024
 
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsIgniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
 
UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7
 
AI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarAI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity Webinar
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URL
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
 
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
 
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
 
Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6
 
Introduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxIntroduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptx
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
 
201610817 - edge part1
201610817 - edge part1201610817 - edge part1
201610817 - edge part1
 

Testing Java EE Applications Using Arquillian

  • 1. Others Talk, We Listen. Testing Java EE Applications using Arquillian Reza Rahman Senior Architect rrahman@captechconsulting.com @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.
  • 5. Servlet Testing Demo https://github.com/m-reza-rahman/testing-javaee 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.
  • 7. JSF Testing Demo https://github.com/m-reza-rahman/testing-javaee 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.
  • 12. JAX-RS Testing Demo https://github.com/m-reza-rahman/testing-javaee Copyright © 2015 CapTech Ventures, Inc. All rights reserved.
  • 13. WebSocket Testing Demo https://github.com/m-reza-rahman/testing-javaee 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.