Testing Blog Sponsored By     zephyr

Unit Test Your Java Web Application Without An App Server Or A Browser

Written by  Ritu Saxena | 08 May 2012
E-mail PDF

unit testingDo you need to perform unit tests frequently in alignment with the agile project development framework? Is the deployment of the web applications to a server and testing of the application within a browser or an array of browsers taking a large chunk of your time which you feel you could invest in other development activities? Use ZATS mimic to help you automate the unit test cases to finish of your unit testing activity in a very short period of time.

ZK application Test Suite is a new product line of ZK renowned for its "Ajax without JavaScript" concept enabling developers to build rich internet applications transparently without any knowledge of Ajax and JavaScript. ZATS Mimic is a branch of ZATS which is a unit testing library which has been released recently and is now available for download enabling developers to test a composer without an application server or browser.

As the name ZATS mimic suggests, using this library the testers will be able to mimic user interactions with the application under test such as clicking or typing action. Using the library your job as a tester remains to write a regular JUnit test case, use Mimic library's utility class to interact with components on ZUL page and run the test case. You can the leave the rest to Mimic Library, which loads the project's ZUL to a server emulator and without rendering the screen it simulates user interactions to the server. All that is remaining for you to do is verify the result of the user action.


There are a few points worth noting where the tool might not be very helpful to you

  • Functions dependent on the application server do not work.

Since the test cases run in simulated environment all functions that require an application server do not work (e.g. JNDI, or JTA). If you wish to adopt such container provided services some extra effort is required to make it work normally out of the container.

  • You cannot test browser’s behaviour.

In a ZK-based application, some behaviour is handled by the browser (JavaScript), e.g. popup menu or message dialog created at the client side. As server side is not aware of these behaviours, it cannot be verified.

  • You cannot test visual effects.

It cannot verify any behaviour that does not reflect upon component's properties such as animations, or a component's visual effect.


[Image Credits: smallbusinessdelivered]

Ritu Saxena

Ritu Saxena

Ritu is the technical brain behind the website and comes from a strong development background across Web and Mobile platforms. She is our senior editor primarily responsible for Product Reviews and in future will be leading Start-Ups, Mobile and Quality areas.

blog comments powered by Disqus