Start testing with Larva

Larva is one of the test tools that comes out of the box with the framework. It’s basic use is to test single adapters. You can create sets of inputs and expected outcomes, and run them. We’ll discuss some  of its basic aspects in this article.

The Plan


  • See Larva in action in Ibis4Example
  • Learn to perform xslt transformations with Larva
  • See how adapters are tested via stubbing


You will need a working version of the framework, and a development environment to make some xml and xsl-files.

Larva in action


Demo video of Larva



When you run Ibis4Example you will have two default test scenarios in your project. When you are working with another Ibis you will have to create some files and folders. is the place where you  turn Larva on or off, it lives in the resources folder. The managedatabase webservicelistener creates database connectivity for your test tool. We’ll look at that in the last example.


The folder ‘test/resources’ contains a folder for your test project. You will create scenario folders that you supply with input files and their expected results. Each scenario needs a properties file in which you describe what will happen in your test.








Your test properties file can contain a description that will show up during Larva execution. You will leave the generic classname as it stands but the servicename needs to be replaced by the adapter you are going to test. Ibis4Example has the HelloWorld adapter,  you will write a line “ijs.Generic.servicename = testtool-HelloWorld” then. The part ‘ijs’ is a little confusing, it is a random namespace that is meant to create a unique identiefier for your testfiles, so “abc” , “mynamespace”, etc, are just as good, as long as you prefix your adaptername with “testtool-“.


Basic example


In the HelloWorld example we’ll insert an extra pipe now. Let’s accept only a ‘hello’ message, reply that one with “Hello World”, and echo back any other message. In the step files fill in “hello”, “Hello World”, “something else”, and “something else” respectively, and adapt your properties file. Now you should be ready to run a test. This will give you a pretty good idea now about working with Larva.


    <adapter name="HelloWorld" active="${}">
        <pipeline firstPipe="checkifhello">
                <exit path="EXIT" state="success" code="200" />
                <exit path="ERROR" state="failure" code="500" />
                name = "checkifhello"
                expressionValue = "hello">
                <forward name="then" path="HelloWorld"/>
                <forward name="else" path="ERROR"/>
                returnString="Hello World"
                <forward name="success" path="EXIT"/>

Xslt transformations with Larva

Larva let’s you transform xslt’s on the fly. You can view input and output alongside eachother. Make sure to modify your properties file as in the image below.


For myxslt.xsl, and step01.xml you can use these two snippets :

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
<xsl:template match="/">
    <h2>My CD Collection</h2>
    <table border="1">
      <tr bgcolor="#9acd32">
      <xsl:for-each select="catalog/cd">
        <td><xsl:value-of select="title" /></td>
        <td><xsl:value-of select="artist" /></td>


<?xml version="1.0" encoding="UTF-8"?>
    <title>Back To Oakland</title>
    <artist>The Tower Of Power</artist>
    <title>The Clones Of Dr Funkenstein</title>
    <company>MGM records</company>