JSF & RichFaces Conference UNIQA Testing   JSF   with   Arquillian   &   Selenium by  Lukáš Fryč 9.9.2011
Introduction Lukáš Fryč [Luka:ʃ Frɪdʒ]
@lfryc, #RichFaces Software Engineer at JBoss by Red Hat RichFaces Core Developer
Seam, Arquillian and HTML5 enthusiast
JBoss Testing Initiative  member
JSF Testing: Agenda Outline up-to-date state
Tools
Future
Checklist Are there some frameworks targeting JSF app testing?
Are RichFaces simply testable?
What is JBoss Testing Initiative?
Story begins... Java EE testing was always pain Start a container
Build and deploy archive
Configure application
Deal with classpath isolation
Mock components
...sad story Testing JSF isn't exception Black-box testing
Mocking JSF API And bears additional challenges UI
No one able to save the World?
Wait, there is someone... Exceptional who is not satisfied how things goes Who is brave to change the game
Arquillian is coming on Earth Heavy equipment make the testing a breeze!
Arquillian saves the World
Arquillian's Test Facts As easy as writing unit test
Runs in IDE
Test isolated components
In real environment
Arquillian Container-oriented testing framework  Abstracts test lifecycle including deployment
and container management Focus on test logic
JBoss Testing Initiative Lead by Aslak Knutsen
In-container Approach Start a container
Package and deploy test archive
Run test in-container
Collect results
Undeploy test archive
Arquillian's Equipment (1) Unit testing framework runner JUnit, TestNG Deployable test archive
Packaging ShrinkWrap Programmatic creation of Test Archives JARs, WARs, EARs Fluent Java API
Micro-deployments
Developed by JBoss Community Lead by Andrew Lee Rubinger
Arquillian's Equipment (2) Target container Broad range of supported containers Test enrichers @Inject, @EJB, @Resource, @PersistenceContext
@ArquillianResource, @Drone
Test Run Modes In-container Test runs in same JVM
Invokes application directly As client Remote client
Java EE enrichment not available
Advantages of running with Arquillian
Summary Arquillian Rethough integration testing
Makes Java EE components testable
Manages test life-cycle
Simplifies test development and maintenance

Testing JSF with Arquillian and Selenium