InteGrade: Object-Oriented Grid Middleware v0.5

IGTest Framework Manual

Last updated: June 18th 2009.

-----------------------------------------------------------------------------
INTRODUCTION

IGTest is a framework developed to ease the work needed to create automatic integration tests for the InteGrade middleware.

-----------------------------------------------------------------------------
REQUIREMENTS

This document assumes that you already have a working copy of InteGrade under eclipse with JUnit4. Detailed instructions can be found in bzr://ccsl.ime.usp.br/integrade/trunk/eclipse/README. 

Notice that we only tested on eclipse platform 3.4 which is available for download here http://www.eclipse.org/. It may or may not work on different versions. 

-----------------------------------------------------------------------------
RUNNING TESTS

There are two kinds of tests in IGTest: tests for the framework itself and InteGrade tests.

The integration tests are very simple tests that runs a specific application which has an specific behavior. For instance, the regular test runs a simple application written in C, that yields the key value pair (exit,HelloWorld!) in the format exit:HelloWorld!. There is also a file called regular.expected, it has the key:value pair sequence that defines the expected behavior. Be aware that this sample-applications building, under integrade/tests/sample-application must be done manually typing:

	$ make <app-name>

such as in

	$ make regular

There is also a file called regular.conf that tells how to run the application on InteGrade, syntax is the same of the ASCTGui generated configuration files. For further information refer to ADDING NEW TESTS bellow or to Integrade INSTALLATION guide.  

The $IG_HOME/tools/asct/classes/runit script starts an IG client that needs to pass several arguments to Java VM in order to connect with the remote components. The framework, as a IG client, need these arguments too. Create a new JUnit run configuration and, in the arguments tab, copy all the arguments present in the script to the VM arguments text area. Also set the working to $IG_HOME/tools/asct/classes. 

Be aware that to run this tests you need a running instance of InteGrade, and that sometimes, if the tests catastrophically fail (and unfortunately it happens a little often) you will need to manually start ASCTGui and erase the application files. 

-----------------------------------------------------------------------------
RUNNING FRAMEWORK TESTS

The framework tests are very straightforward, you only need to run the tests folder (or a single test file) as a JUnit test. These tests assure that the framework works properly but have nothing to do with the InteGrade itself. It is recommended to run it before the first time you setup your environment, and after every change on the framework itself. Please, consider adding more tests to the framework if you are going to change it, we strongly suggest the use of Test Driven Development to do so.

-----------------------------------------------------------------------------
ADDING NEW TESTS

Adding a new test is easy. Just follow this recipe.

1 - Write your testing application in sample-applications directory. Let's call it sampleTest.c
2 - Add a target in Makefile in order to build it. The executable name must be sampleTest (without any extensions).
3 - Write a sampleTest.expected containing the expected output. The output must be a sequence of lines following the pattern key:value.
4 - Write a sampleTest.conf with all the information required by InteGrade. Each type of application (regular, parametric, etc) have some specific fields. The easiest way to get a correct file is to manually submit the application in ASCTGui and save its configuration.
5 - Write a new JUnit test class, similar to the existing ones, then change the variable applicationName in setUp method to "sampleTest".
6 - Run your new test.
