Google Summer of Code 2011: Project
"Automated webapp tests for MyFaces core + extensions"
Student: Jan Zarnikov < jan.zarnikov AT gmail DOT com>
Organization : Apache Software Foundation
Mentors : Jakob Korherr < jakob.korherr AT gmail DOT com >
Abstract:
The goal of this project is to improve the already existing testing framework which was create during last year's GSOC: http://wiki.apache.org/myfaces/GSoC2010_AutomatedTests The two main requirements are a) the possibility to run a certain test with different configurations and b) provide a convenient API to create both server-side and client-side assertions. The project also has to provide documentation of the API and general usage as well as sample tests that demonstrate how to use all the key features.
Requirements:
Firstly the project has to address requirements that could not be met in GSOC 2010 due to time constraints:
The initial goal of "webapptest" was also to be able to run one test against multiple containers with different configurations (e.g. tomat 6.0.31 + MyFaces 2.0.3, tomcat 6.0.31 + MyFaces 2.0.4, tomcat 7.0.1 + MyFaces 2.0.4, tomcat x.x.x + Mojarra 2.0.x, Glassfish 3.1 + Mojarra 2.0.x, etc ...), allowing MyFaces extensions to automatically test and prove their interoperability!
- The API + assertion possibilities need to be improved
- Easy combination on both server-side and client-side state
- Easy configuration of deployment and library versions including automatic resolving of transitive dependencies
- Better error messages + tracing:
- If a test uses more configurations it has to be clearly visible under which configuration the occurred
- It must be easily traceable which assertion failed and why (including stack trace) even if it is a server-side assertion.
- The tests have to be standard JUnit tests because:
- Easy launching from any IDE is important for developers
- It allows easy integration with exiting build tools such as Maven or continuous integration tools such as Jenkins
Implementation:
The results of last year's GSOC are a good starting point. However several important changes will have to be made. Launching tests with different configurations is a difficult task because of the classpath hell. There are basically two possible approaches:
- Writing a custom classloader.
- Launching the tests in a separate JVM with its own classpath.
These two approaches will be evaluated at the beginning of the project using prototypes.
Combining server-side and client-side assertions also introduces some issues. The client-side assertions can be easily implemented using HTMLUnit. The server-side assertions are a bit more difficult because they have to be evaluated in the context/thread of the server. Possible failures have to be propagated back to the context/thread of the JUnit test.
Because the tests must be normal JUnit test the testing framework has to be implemented as a JUnit Runner.
Validation
The test framework will be used to implement sample tests for MyFaces core and/or extensions in order to show that it meets all the requirements.
Deliverables:
Working testing framework for MyFaces
- Documentation and working examples
Criteria:
This project will follow the guidelines of the Apache Foundation.
Timeline:
See GSOC 2011 timeline: http://www.google-melange.com/document/show/gsoc_program/google/gsoc2011/timeline
Name
The project should have a real name (and not just "automated webapp tests"). I propose the name Manila.
Links:
https://issues.apache.org/jira/browse/MYFACESTEST-47
Background:
I study master's program "Software Engineering and Internet Computing" at University of Technology in Vienna and plan to graduate by the end of 2011.
I also work part time at Irian Solutions, a major contributor to the MyFaces project, at their offices in Vienna. Irian Solutions kindly supports this project and allows me to schedule enough time and resources for its competition.
And I am an active member of the Java Student User Group (http://jsug.at) at the University of Technology in Vienna.