SlideShare ist ein Scribd-Unternehmen logo
1 von 17
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.

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Kürzlich hochgeladen

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 

Kürzlich hochgeladen (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 

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.