SlideShare une entreprise Scribd logo
1  sur  31
Chris Wash CapTech Ventures FYB Aug 2010
Java EE Development Evolution POJO Model Container  Services Ease of Development Ease of Testing Framework Integration Dependency Injection JNDI CMP EJB2.x Struts Hibernate EJB3 JPA JSF CDI Weld Spring Arquillian Seam “Lightweight” movement Grails
Shift Focus to Testing in EE Lots of developers abandoned EE in search of greener “testing” pastures. Testing has not been the focus for most of the platform’s history. Ride the wave… encourage support and adoption Dev-friendly container-based component models cry out for ease of testability!
Real EE Testing What does “real” mean? Unit testing using doubles can only get us so far when working with container managed resources. Want to be confident we get the interactions correct between container managed resources Short feedback cycle when making a change
Integration Testing
Rolling Your Own How do I get unit test class into the container? Remote deployment (using hook into server) Bootstrap container inside test How do I exercise the code under test? How do I see the results of the test? How does test isolation work? Test classpath-hell Can I call it from IDE and get results?
Challenges to testing in container High barrier to entry Substantial code, configuration and infrastructure Most don’t run from IDE - where’s the feedback? Most aren’t reusable – tied to 1 project’s build Often slow (think “mvn package”) Can’t interact with containers from test (all black-box testing) Enough ROI to justify work/maintenance?
CDI (JSR-299) TCK + ALR EJB3 book examples Used by Weld Plan to be used by JBossAS “Ike” - controls everything in his little world Good way to learn CDI, EJB, JPA, etc.
Arquillian Features JUnit or TestNG compatible Abstracts out server lifecycle and deployment Injects container managed resources into test Zero reliance on build – run straight from IDE Two container modes – remote/embedded Pass-by-reference between test and server Even across JVMs Extensible SPI to plug any container in Single test executed against all containers
Arquillian Architecture
Arquillian: Flexibility Out of the box, supports multiple: Test frameworks (JUnit, TestNG) Containers Enrichers Run Modes Most things are pluggable API/SPI Modular design
ShrinkWrap “Skip the Build!” Fluent API for describing deployable archives Apache-licensed Zero transitive-dependency promise Solves test-classpath madness Removes dependency of integration tests on packaging Creates fine grained archives Contains only what you need
ShrinkWrap
ShrinkWrap IDE can perform incremental compilation Change a class that is ShrinkWrap’d, only that class needs to be recompiled (no repackaging) Poor man’s “hot swap”? Future support tooling views in IDEs See what your archive would look like when SW is executed
ShrinkWrap – Arquillian Integration Simple – method annotated @Deployable within your test class Gets called by ShrinkWrap when deploying your archive, “bundles it” on the fly
Containers Loosely defined, anything that accepts an archive deployment and provides services Arquillian finds specified DeployableContainer SPI on classpath Multiple containers already supported, fairly easy to add support for a container Configured by using Maven profiles, e.g. mvn test –Pjbossas-remote-6
Container Modes Describes how the test archive should be deployed Embedded Same JVM Bootstraps container, often “standalone” environment Managed Different JVM, same machine Server will be started/stopped as part of the test run Remote Different JVM, different machine Server startup/shutdown not controlled by ARQ Arquillian controls binding/unbinding to server
Container Support Notably, no Weblogic and no WebSphere yet Looking for community contribution No Spring or Hibernate yet, but they’re planned.
Enrichers Allow for injections into your test from within a container Out of the box, supports: @Resource (ghetto!) @EJB (a few caveats) @Inject (CDI) Transparent to user – internal lifecycle step before executing test methods
Run Modes IN_CONTAINER AS_CLIENT Arquillian uses this when running your test (after enrichment) Determines which side of the client/server divide the test method should be executed on See LocalRunServletTestCase
Embedded Lifecycle Bundle test archive* Use ShrinkWrap’d archive Bootstrap container Deploy archive to container Enrich test class Execute tests After execution, undeploy archive Stop container Display captured test results
Managed Lifecycle Bundle test archive* Use ShrinkWrap’d archive Add test class and invoker Bootstrap server Deploy archive to container Enrich test class Negotiate test method execution (based on Run Mode) Collect test results, return back thru Arquillian After execution, undeploy archive Stop server Display test results returned from server
Remote Lifecycle Bundle test archive* Use ShrinkWrap’d archive Add test class and invoker Bind to container Deploy archive to container Inside container, enrich test class Negotiate test method execution (based on Run Mode) Collect test results, return back thru Arquillian After execution, undeploy archive Unbind from container Display test results returned from server
Test Execution/SPI Overview
Demo
The Cons Lack of true test isolation Implementing feature to deal with isolation If using an Embedded container you’re in a “Simulated” environment Easy to turn an embedded test into a remote test
The Pros  Scale up to the level of integration you need by growing your test archive Rely on shared memory Don’t have to return/serialize a lot of state just to do asserts on Pass-by-reference works Don’t need remote views exposed just to test Managed concurrency Multiple containers for free
Future *Bundling – read Maven pom.xml and run through dependency resolution algorithm to include required dependencies Support for more Containers Performance monitoring Archive “bundle-time” class manipulation Exception, Callback, Assertion injection Component coverage recording Tooling support Framework integration Selenium, HTTPUnit, DBUnit, easyB
#jbosstesting initiatives Establish testing culture in Java EE! Other frameworks Placeebo – Mock Java EE API implementations (Fakes) JSFUnit – Gray-box JSF testing (Pretty cool, if you’ve seen SeamTest in action)
Further Info Chris Wash, @cwash (Twitter, Yammer) Use #testrevolutionhashtag Material jacked from the following sites: http://github.com/arquillian/arquillian-showcase http://www.slideshare.net/mojavelinux/real-javaeetestingwithanswers http://docs.jboss.org/arquillian/reference/latest/en-US/html_single IRC #jbosstestingirc.freenode.net Sites http://jboss.org/arquillian http://jboss.org/shrinkwrap Source http://github.com/arquillian

Contenu connexe

Tendances

Continuous Delivery concept overview. Continuous Integration Systems. DevOps ...
Continuous Delivery concept overview. Continuous Integration Systems. DevOps ...Continuous Delivery concept overview. Continuous Integration Systems. DevOps ...
Continuous Delivery concept overview. Continuous Integration Systems. DevOps ...
eleksdev
 
Jenkins Evolutions - JEEConf 2012
Jenkins Evolutions - JEEConf 2012Jenkins Evolutions - JEEConf 2012
Jenkins Evolutions - JEEConf 2012
Anton Arhipov
 

Tendances (20)

Testcontainers - Geekout EE 2017 presentation
Testcontainers - Geekout EE 2017 presentationTestcontainers - Geekout EE 2017 presentation
Testcontainers - Geekout EE 2017 presentation
 
Implementing your own Google App Engine
Implementing your own Google App Engine Implementing your own Google App Engine
Implementing your own Google App Engine
 
Testing Java Web Apps With Selenium
Testing Java Web Apps With SeleniumTesting Java Web Apps With Selenium
Testing Java Web Apps With Selenium
 
Take Control of your Integration Testing with TestContainers
Take Control of your Integration Testing with TestContainersTake Control of your Integration Testing with TestContainers
Take Control of your Integration Testing with TestContainers
 
Arquillian & Citrus
Arquillian & CitrusArquillian & Citrus
Arquillian & Citrus
 
How do I write Testable Javascript - Presented at dev.Objective() June 16, 2016
How do I write Testable Javascript - Presented at dev.Objective() June 16, 2016How do I write Testable Javascript - Presented at dev.Objective() June 16, 2016
How do I write Testable Javascript - Presented at dev.Objective() June 16, 2016
 
JavaLand - Integration Testing How-to
JavaLand - Integration Testing How-toJavaLand - Integration Testing How-to
JavaLand - Integration Testing How-to
 
Testing Web Apps with Spring Framework
Testing Web Apps with Spring FrameworkTesting Web Apps with Spring Framework
Testing Web Apps with Spring Framework
 
Riga Dev Day - Automated Android Continuous Integration
Riga Dev Day - Automated Android Continuous IntegrationRiga Dev Day - Automated Android Continuous Integration
Riga Dev Day - Automated Android Continuous Integration
 
Continuous Delivery concept overview. Continuous Integration Systems. DevOps ...
Continuous Delivery concept overview. Continuous Integration Systems. DevOps ...Continuous Delivery concept overview. Continuous Integration Systems. DevOps ...
Continuous Delivery concept overview. Continuous Integration Systems. DevOps ...
 
Jenkins Evolutions - JEEConf 2012
Jenkins Evolutions - JEEConf 2012Jenkins Evolutions - JEEConf 2012
Jenkins Evolutions - JEEConf 2012
 
Apache Lucene for Java EE Developers
Apache Lucene for Java EE DevelopersApache Lucene for Java EE Developers
Apache Lucene for Java EE Developers
 
Prod-Like Integration Testing for Distributed Containerized Applications
Prod-Like Integration Testing for Distributed Containerized ApplicationsProd-Like Integration Testing for Distributed Containerized Applications
Prod-Like Integration Testing for Distributed Containerized Applications
 
The Many Ways to Test Your React App
The Many Ways to Test Your React AppThe Many Ways to Test Your React App
The Many Ways to Test Your React App
 
Apache DeltaSpike the CDI toolbox
Apache DeltaSpike the CDI toolboxApache DeltaSpike the CDI toolbox
Apache DeltaSpike the CDI toolbox
 
2014 Joker - Integration Testing from the Trenches
2014 Joker - Integration Testing from the Trenches2014 Joker - Integration Testing from the Trenches
2014 Joker - Integration Testing from the Trenches
 
Immutable infrastructure:觀念與實作 (建議)
Immutable infrastructure:觀念與實作 (建議)Immutable infrastructure:觀念與實作 (建議)
Immutable infrastructure:觀念與實作 (建議)
 
Testing the Grails Spring Security Plugins
Testing the Grails Spring Security PluginsTesting the Grails Spring Security Plugins
Testing the Grails Spring Security Plugins
 
Automated Deployment with Maven - going the whole nine yards
Automated Deployment with Maven - going the whole nine yardsAutomated Deployment with Maven - going the whole nine yards
Automated Deployment with Maven - going the whole nine yards
 
Make It Cooler: Using Decentralized Version Control
Make It Cooler: Using Decentralized Version ControlMake It Cooler: Using Decentralized Version Control
Make It Cooler: Using Decentralized Version Control
 

En vedette

Making Your Results Visible - A Test Result Dashboard and Comparison Tool
Making Your Results Visible - A Test Result Dashboard and Comparison ToolMaking Your Results Visible - A Test Result Dashboard and Comparison Tool
Making Your Results Visible - A Test Result Dashboard and Comparison Tool
Xiaoxing Hu
 

En vedette (12)

Enterprise Testing using Arquillian
Enterprise Testing using ArquillianEnterprise Testing using Arquillian
Enterprise Testing using Arquillian
 
Arquillian
ArquillianArquillian
Arquillian
 
Introduccion arqullian
Introduccion arqullianIntroduccion arqullian
Introduccion arqullian
 
Testing the Java EE
Testing the Java EETesting the Java EE
Testing the Java EE
 
Making Your Results Visible - A Test Result Dashboard and Comparison Tool
Making Your Results Visible - A Test Result Dashboard and Comparison ToolMaking Your Results Visible - A Test Result Dashboard and Comparison Tool
Making Your Results Visible - A Test Result Dashboard and Comparison Tool
 
Desarrollo de pruebas en entornos Java EE
Desarrollo de pruebas en entornos Java EEDesarrollo de pruebas en entornos Java EE
Desarrollo de pruebas en entornos Java EE
 
(Codemotion 2014) JVM GC: WTF?!
(Codemotion 2014) JVM GC: WTF?!(Codemotion 2014) JVM GC: WTF?!
(Codemotion 2014) JVM GC: WTF?!
 
How to Use Selenium, Successfully
How to Use Selenium, SuccessfullyHow to Use Selenium, Successfully
How to Use Selenium, Successfully
 
Testing Java EE Applications Using Arquillian
Testing Java EE Applications Using ArquillianTesting Java EE Applications Using Arquillian
Testing Java EE Applications Using Arquillian
 
Page Objects Done Right - selenium conference 2014
Page Objects Done Right - selenium conference 2014Page Objects Done Right - selenium conference 2014
Page Objects Done Right - selenium conference 2014
 
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!
 
QA Automation Solution
QA Automation SolutionQA Automation Solution
QA Automation Solution
 

Similaire à Arquillian

Testing the Enterprise Layers - the A, B, C's of Integration Testing - Aslak ...
Testing the Enterprise Layers - the A, B, C's of Integration Testing - Aslak ...Testing the Enterprise Layers - the A, B, C's of Integration Testing - Aslak ...
Testing the Enterprise Layers - the A, B, C's of Integration Testing - Aslak ...
JAXLondon2014
 
Mobicents Summit 2012 - George Vagenas - Testing SIP Applications with Arquil...
Mobicents Summit 2012 - George Vagenas - Testing SIP Applications with Arquil...Mobicents Summit 2012 - George Vagenas - Testing SIP Applications with Arquil...
Mobicents Summit 2012 - George Vagenas - Testing SIP Applications with Arquil...
telestax
 
Apache DeltaSpike
Apache DeltaSpikeApache DeltaSpike
Apache DeltaSpike
os890
 

Similaire à Arquillian (20)

Arquillian in a nutshell
Arquillian in a nutshellArquillian in a nutshell
Arquillian in a nutshell
 
Testing the Enterprise Layers - the A, B, C's of Integration Testing - Aslak ...
Testing the Enterprise Layers - the A, B, C's of Integration Testing - Aslak ...Testing the Enterprise Layers - the A, B, C's of Integration Testing - Aslak ...
Testing the Enterprise Layers - the A, B, C's of Integration Testing - Aslak ...
 
Testing the Enterprise layers, with Arquillian
Testing the Enterprise layers, with ArquillianTesting the Enterprise layers, with Arquillian
Testing the Enterprise layers, with Arquillian
 
Throwing complexity over the wall: Rapid development for enterprise Java (Jav...
Throwing complexity over the wall: Rapid development for enterprise Java (Jav...Throwing complexity over the wall: Rapid development for enterprise Java (Jav...
Throwing complexity over the wall: Rapid development for enterprise Java (Jav...
 
Arquillian in a nutshell
Arquillian in a nutshellArquillian in a nutshell
Arquillian in a nutshell
 
Level Up Your Integration Testing With Testcontainers
Level Up Your Integration Testing With TestcontainersLevel Up Your Integration Testing With Testcontainers
Level Up Your Integration Testing With Testcontainers
 
Devoxx UK 2013 Test-Driven Development with JavaEE 7, Arquillian and Embedded...
Devoxx UK 2013 Test-Driven Development with JavaEE 7, Arquillian and Embedded...Devoxx UK 2013 Test-Driven Development with JavaEE 7, Arquillian and Embedded...
Devoxx UK 2013 Test-Driven Development with JavaEE 7, Arquillian and Embedded...
 
Ensuring Software Quality in the cloud
Ensuring Software Quality in the cloudEnsuring Software Quality in the cloud
Ensuring Software Quality in the cloud
 
Arquillian 소개
Arquillian 소개Arquillian 소개
Arquillian 소개
 
테스트 어디까지 해봤니? Arquillian을 이용한 Real Object 테스트
테스트 어디까지 해봤니? Arquillian을 이용한 Real Object 테스트테스트 어디까지 해봤니? Arquillian을 이용한 Real Object 테스트
테스트 어디까지 해봤니? Arquillian을 이용한 Real Object 테스트
 
Selenium-Browser-Based-Automated-Testing-for-Grails-Apps
Selenium-Browser-Based-Automated-Testing-for-Grails-AppsSelenium-Browser-Based-Automated-Testing-for-Grails-Apps
Selenium-Browser-Based-Automated-Testing-for-Grails-Apps
 
Creating Realistic Unit Tests with Testcontainers
Creating Realistic Unit Tests with TestcontainersCreating Realistic Unit Tests with Testcontainers
Creating Realistic Unit Tests with Testcontainers
 
Jakarta EE Test Strategies (2022)
Jakarta EE Test Strategies (2022)Jakarta EE Test Strategies (2022)
Jakarta EE Test Strategies (2022)
 
Advanced Java Testing
Advanced Java TestingAdvanced Java Testing
Advanced Java Testing
 
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)
 
JLove - Replicating production on your laptop using the magic of containers
JLove - Replicating production on your laptop using the magic of containersJLove - Replicating production on your laptop using the magic of containers
JLove - Replicating production on your laptop using the magic of containers
 
Mobicents Summit 2012 - George Vagenas - Testing SIP Applications with Arquil...
Mobicents Summit 2012 - George Vagenas - Testing SIP Applications with Arquil...Mobicents Summit 2012 - George Vagenas - Testing SIP Applications with Arquil...
Mobicents Summit 2012 - George Vagenas - Testing SIP Applications with Arquil...
 
Apache DeltaSpike
Apache DeltaSpikeApache DeltaSpike
Apache DeltaSpike
 
JBCN_Testing_With_Containers
JBCN_Testing_With_ContainersJBCN_Testing_With_Containers
JBCN_Testing_With_Containers
 
Kubernetes your tests! automation with docker on google cloud platform
Kubernetes your tests! automation with docker on google cloud platformKubernetes your tests! automation with docker on google cloud platform
Kubernetes your tests! automation with docker on google cloud platform
 

Dernier

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Dernier (20)

Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
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
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 

Arquillian

  • 1. Chris Wash CapTech Ventures FYB Aug 2010
  • 2. Java EE Development Evolution POJO Model Container Services Ease of Development Ease of Testing Framework Integration Dependency Injection JNDI CMP EJB2.x Struts Hibernate EJB3 JPA JSF CDI Weld Spring Arquillian Seam “Lightweight” movement Grails
  • 3. Shift Focus to Testing in EE Lots of developers abandoned EE in search of greener “testing” pastures. Testing has not been the focus for most of the platform’s history. Ride the wave… encourage support and adoption Dev-friendly container-based component models cry out for ease of testability!
  • 4. Real EE Testing What does “real” mean? Unit testing using doubles can only get us so far when working with container managed resources. Want to be confident we get the interactions correct between container managed resources Short feedback cycle when making a change
  • 6. Rolling Your Own How do I get unit test class into the container? Remote deployment (using hook into server) Bootstrap container inside test How do I exercise the code under test? How do I see the results of the test? How does test isolation work? Test classpath-hell Can I call it from IDE and get results?
  • 7. Challenges to testing in container High barrier to entry Substantial code, configuration and infrastructure Most don’t run from IDE - where’s the feedback? Most aren’t reusable – tied to 1 project’s build Often slow (think “mvn package”) Can’t interact with containers from test (all black-box testing) Enough ROI to justify work/maintenance?
  • 8. CDI (JSR-299) TCK + ALR EJB3 book examples Used by Weld Plan to be used by JBossAS “Ike” - controls everything in his little world Good way to learn CDI, EJB, JPA, etc.
  • 9. Arquillian Features JUnit or TestNG compatible Abstracts out server lifecycle and deployment Injects container managed resources into test Zero reliance on build – run straight from IDE Two container modes – remote/embedded Pass-by-reference between test and server Even across JVMs Extensible SPI to plug any container in Single test executed against all containers
  • 11. Arquillian: Flexibility Out of the box, supports multiple: Test frameworks (JUnit, TestNG) Containers Enrichers Run Modes Most things are pluggable API/SPI Modular design
  • 12. ShrinkWrap “Skip the Build!” Fluent API for describing deployable archives Apache-licensed Zero transitive-dependency promise Solves test-classpath madness Removes dependency of integration tests on packaging Creates fine grained archives Contains only what you need
  • 14. ShrinkWrap IDE can perform incremental compilation Change a class that is ShrinkWrap’d, only that class needs to be recompiled (no repackaging) Poor man’s “hot swap”? Future support tooling views in IDEs See what your archive would look like when SW is executed
  • 15. ShrinkWrap – Arquillian Integration Simple – method annotated @Deployable within your test class Gets called by ShrinkWrap when deploying your archive, “bundles it” on the fly
  • 16. Containers Loosely defined, anything that accepts an archive deployment and provides services Arquillian finds specified DeployableContainer SPI on classpath Multiple containers already supported, fairly easy to add support for a container Configured by using Maven profiles, e.g. mvn test –Pjbossas-remote-6
  • 17. Container Modes Describes how the test archive should be deployed Embedded Same JVM Bootstraps container, often “standalone” environment Managed Different JVM, same machine Server will be started/stopped as part of the test run Remote Different JVM, different machine Server startup/shutdown not controlled by ARQ Arquillian controls binding/unbinding to server
  • 18.
  • 19. Container Support Notably, no Weblogic and no WebSphere yet Looking for community contribution No Spring or Hibernate yet, but they’re planned.
  • 20. Enrichers Allow for injections into your test from within a container Out of the box, supports: @Resource (ghetto!) @EJB (a few caveats) @Inject (CDI) Transparent to user – internal lifecycle step before executing test methods
  • 21. Run Modes IN_CONTAINER AS_CLIENT Arquillian uses this when running your test (after enrichment) Determines which side of the client/server divide the test method should be executed on See LocalRunServletTestCase
  • 22. Embedded Lifecycle Bundle test archive* Use ShrinkWrap’d archive Bootstrap container Deploy archive to container Enrich test class Execute tests After execution, undeploy archive Stop container Display captured test results
  • 23. Managed Lifecycle Bundle test archive* Use ShrinkWrap’d archive Add test class and invoker Bootstrap server Deploy archive to container Enrich test class Negotiate test method execution (based on Run Mode) Collect test results, return back thru Arquillian After execution, undeploy archive Stop server Display test results returned from server
  • 24. Remote Lifecycle Bundle test archive* Use ShrinkWrap’d archive Add test class and invoker Bind to container Deploy archive to container Inside container, enrich test class Negotiate test method execution (based on Run Mode) Collect test results, return back thru Arquillian After execution, undeploy archive Unbind from container Display test results returned from server
  • 26. Demo
  • 27. The Cons Lack of true test isolation Implementing feature to deal with isolation If using an Embedded container you’re in a “Simulated” environment Easy to turn an embedded test into a remote test
  • 28. The Pros Scale up to the level of integration you need by growing your test archive Rely on shared memory Don’t have to return/serialize a lot of state just to do asserts on Pass-by-reference works Don’t need remote views exposed just to test Managed concurrency Multiple containers for free
  • 29. Future *Bundling – read Maven pom.xml and run through dependency resolution algorithm to include required dependencies Support for more Containers Performance monitoring Archive “bundle-time” class manipulation Exception, Callback, Assertion injection Component coverage recording Tooling support Framework integration Selenium, HTTPUnit, DBUnit, easyB
  • 30. #jbosstesting initiatives Establish testing culture in Java EE! Other frameworks Placeebo – Mock Java EE API implementations (Fakes) JSFUnit – Gray-box JSF testing (Pretty cool, if you’ve seen SeamTest in action)
  • 31. Further Info Chris Wash, @cwash (Twitter, Yammer) Use #testrevolutionhashtag Material jacked from the following sites: http://github.com/arquillian/arquillian-showcase http://www.slideshare.net/mojavelinux/real-javaeetestingwithanswers http://docs.jboss.org/arquillian/reference/latest/en-US/html_single IRC #jbosstestingirc.freenode.net Sites http://jboss.org/arquillian http://jboss.org/shrinkwrap Source http://github.com/arquillian

Notes de l'éditeur

  1. We branched from Grails developers as we began to walk upright. 
  2. “Unit testing doesn’t catch the kind of bugs I write.”Test doubles – unit testing constructs that help provide test isolation. Fakes – empty impls make setup of test easier, like Spring test helpers. Stubs – simpler implementation for testing, like a dummy Paypalwebservice.Mocks – allow you to test interactions between collaborating objects.
  3. Without Arquillian…
  4. Classpath for the test has traditionally been a kitchen sink of all production classes and resources with the test classes and resources layered on top. Can make the test run undeterministic, different from what actually happens, hard to isolate different resources. One big reason to use SW – microdeployments – contain only what you need!