Bindings, Platforms, and Innovation
This presentation focuses on the Internet and separating myth from fact, history from the future, and the mundane from the imaginative. Bob Frankston presents a vision of what could and should be.
Tracking change and innovation in the enterprise software development community
Posted by Srini Penchikala on Dec 31, 2007 12:00 PM
Unit testing JSF based web applications has been considered difficult because of the constraints of testing JSF components outside the container. Most of the web-tier testing frameworks follow black-box testing approach where developers write test classes using the web components to verify the rendered HTML output is what is expected. Frameworks such as HtmlUnit, HttpUnit, Canoo WebTest, and Selenium fall into this category. The limitation of these frameworks is that they only test the client side of a web application.
But this trend is changing with the recently released JSFUnit and other JSF testing frameworks such as Shale Test and JSF Extensions that support white-box testing to test both client and server components of the web application. And projects like Eclipse Web Tools Platform (WTP) and JXInsight are also helping in the development and testing of JSF applications.
Like any other unit testing framework, a typical JSF test framework should provide the following features:
The test framework should also support the JSF specific requirements like:
JSFUnit, which is built on HttpUnit and Apache Cactus, allows integration testing and debugging of JSF applications and JSF AJAX components. It can be used for testing both client and server side JSF artifacts in the same test class. With JSFUnit API, the test class methods can submit data on a form and verify that managed beans are properly updated.
JSFUnit includes a JSF Static Analysis test suite to validate the JSF configuration files to identify any configuration related issues before they occur at run-time. It also provides JSFTimer component for performance analysis of the JSF lifecycle. This can be used to trace the response time for each phase of the JSF lifecycle for a given web request and assert that the response time is within SLA limits.
JSFUnit includes support for RichFaces and Ajax4jsf components. Beta 1 version of this framework was released last month and the second Beta Version release is scheduled for the end of next month.
Shale Test Framework, an Apache project, provides mock object implementations for Servlet and JSF components. These base test classes can be used for testing Shale framework classes as well as JSF application components built on top of the framework. Shale Test can be used to write isolated unit tests that exercise the methods exposed by ViewController interface. This is useful because of the complexity involved in setting up the runtime environment for a ViewController component. Following are the main classes in Shale Test framework:
Shale Test also has integration with Spring Framework to allow a JSF component to be bound as a managed bean or as a Spring bean.
JSF Extensions project is a collection of non-UI components that extend the functionality of a JSF 1.2 based web application. It uses JUnit, HTMLUnit, and Cactus for automated testing. Test-Time module of the framework provides mock objects for JSF 1.2 components. Design-Time module has a JSF hot-deploy feature to stop and restart the application without going through build & redeploy cycles. This feature, based on JSF PhaseListener interface, causes all the configuration files and classes to be reloaded. This allows the developers to follow a test driven iterative JSF development approach when writing JSF applications.
ToolsThere are also some development tools that aid in the development and performance monitoring of JSF applications. JXInsight from JInspired group provides a JSF trace and profile feature which is based on the PhaseListener interface. By including this tracing phase listener in the JSF application, developers and web administrators can collect information such as trace stacks, java call stacks and runtime UIComponent hierarchy associated with a JSF request.
JSF tools sub-project in Eclipse WTP project also provides tool support for developing and deploying JSF based web applications with features such as Visual JSF Page Editor and Faces Config Editor.
Usage Landscape: Enterprise Open Source Data Integration
Effective Management of Static Analysis Vulnerabilities and Defects
The Role of Open Source in Data Integration
It should be noted that the Shale mock library is really a stub library. Not knocking Srini on this one, just pointing out this ... http://martinfowler.com/articles/mocksArentStubs.html . Nice article.
I wanted to also point out that JXInsight also offers in addition to the trace and profile extension mentioned above a comprehensive resource metering and request/component diagnostics state capture/storage inspection facility based on our AspectJ aspect libraries. http://forums.jinspired.com/viewtopic.php?p=123#123 http://forums.jinspired.com/viewtopic.php?p=109#109 This offline inspection of request/responses as well as application/component state is extremely powerful and required for actual problem resolution if a test fails. William
This presentation focuses on the Internet and separating myth from fact, history from the future, and the mundane from the imaginative. Bob Frankston presents a vision of what could and should be.
This article explores the use of JBoss and jBPM to implement design solutions that effectively address the issue of orchestrating long running activities.
This presentation covers the use of graph databases as an optimal solution for data that is difficult to fit in static tables, rapidly evolving data or data that has a lot of optional attributes.
This session introduces Real Options and shows how it can help in running your project. Real Options is a decision-making process that can be used to manage risk.
This article discusses the use of bindings on services and references (including the instance of non-configured bindings) as the means to implement SCA communications in a Web and SOA environment.
After a short introduction to DSLs, Scott Davis plays with the keyboard showing how to approach the creation of a DSL by typing working snippets of Groovy code that get executed.
IBM Rational and InfoQ present, Scaling Agile with C/ALM, an eBook showing organizations how to become “finely tuned software delivery machines” by enabling team integration and scaling.
Amanda Laucher presents a real life enterprise application written in F#. She shows actual code snippets, explaining design decisions and suggesting how to use some of the F# constructs.
2 comments
Watch Thread Reply