Tapestry for Nonbelievers
A new article by I. Drobiazko and R. Zubairov introduces v. 5 of the Apache Tapestry component-oriented web framework. The tutorial shows how to create a component and covers IoC in Tapestry and Ajax.
- Java,
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.
Create a photo album application with Project Zero and REST design principles
IBM software architect eKit: Grady Booch podcast, whitepapers, articles
IBM Web 2.0 Developer eKit: Free Tutorials, Webcasts, Whitepapers
Rational Model Driven Development eKit: Examples, Tutorials, Webcasts
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
A new article by I. Drobiazko and R. Zubairov introduces v. 5 of the Apache Tapestry component-oriented web framework. The tutorial shows how to create a component and covers IoC in Tapestry and Ajax.
In this interview, Burton Group consultant Pete Lacey talks to Stefan Tilkov about his disillusionment with SOAP, his opinion on REST, and addresses some of the perceived shortcomings REST vs. WS-*.
Jay Fields presents his concept of Business Natural Languages - a type of Domain Specific Languages geared towards being readable by domain experts.
Adoption and interest for Distributed Version Control Systems is constantly rising. We will introduce the concept of DVCS and have a look at 3 actors in the area: git, Mercurial and Bazaar.
Deborah Hartmann interviewed Segundo Velasquez about his experience as customer with an Agile team during the initial phase of software design of a product.
David Cooksey shows how to fine grained versioning to a ClickOnce deployment using an HttpHandler written with ASP.NET, making partial rollouts to a test audience much easier.
Windows workflow (WF) is an excellent framework for implementing business processes, but lacks support for human activities. This article describes a completely generic approach for changing this.
In this interview taken during OOPSLA 2007, Markus Voelter talks about the importance of documenting the software architecture, and gives some good and also bad examples on how it could be done.
2 comments
Reply