Latka is a functional (end-to-end) testing tool. It is implemented in Java, and uses an XML syntax to define a series of HTTP (or HTTPS) requests and a set of validations used to verify that the request was processed correctly.
Note: Although Latka currently supports only HTTP and HTTPS request/response validations, it may be expanded to perform other sorts of functional testing as warranted.
A simple example of a Latka XML test suite is shown in our sample Latka test suite. When processed, this example would verify that the Jakarta Commons homepage is present and that all the Commons Components have online documenation.
A Latka test suite can be run:
From a command prompt
From the Latka web application
From a JUnit TestRunner
Note:To run Latka as an ant task, we suggest you use the JUnit support of ant and write a small test case to invoke Latka, as discussed later
There are two scripts (or batch files) shipped with latka:
latka.bat - for Windows machines
latka.sh - for Unix machines
Both of the scripts take the following parameters:
a test suite URL, e.g.
Optionally properties files of Latka options
can be specified using the propfile parameter:
Optionally individual Latka options may be specified
using the prop parameter:
For more information about what properties you can pass to Latka, please see the Latka Properties definition
The Latka release distribution comes with a web application (latka-webapp.war) ready to deploy on a conforming Servlet 2.2/ JSP 1.1 container.
For example, to install the Latka web application into a Tomcat 4 server, simply copy the .war file to Tomcat's webapp directory, e.g.
or
and restart Tomcat
Once you've gotten the Latka web app running, it's straightforward to use. You can either
Run a latka
Here's hoping you're familiar with JUnit
Latka ships with a class JUnitTestAdapter
that bridges Latka and JUnit. You can use this class to create JUnit
Tests from Latka's XML documents. For example, calling
So, essentially you code a JUnit TestCase, and in the
suite method, you add the Tests created by JUnitTestAdapter
to the JUnit TestSuite.
Once you have Latka's suite as a JUnit TestSuite, you can run it using any JUnit TestRunner to execute the suite, including those shipped with ant.
For a reference of the XML tags that can possibly be used in developing latka test suites, see The XML Reference
A Latka test suite is an XML document with a top level element of suite
Definitive list of properties and their meanings...