net.sourceforge.taverna.scuflworkers
Class LocalWorkerTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by net.sourceforge.taverna.scuflworkers.LocalWorkerTest
All Implemented Interfaces:
junit.framework.Test

public abstract class LocalWorkerTest
extends junit.framework.TestCase

This class is provides a simple set of test to verify that a LocalWorker is functioning properly. To use this class, simply instantiate it can call the tests that you need. Last edited by $Author: sowen70 $

Version:
$Revision: 1.2 $
Author:
Mark

Constructor Summary
LocalWorkerTest(LocalWorker worker, boolean allOutputsRequired, boolean allInputsRequired)
          Constructor
 
Method Summary
 void testInputs()
          This test verifies that the number of inputs, and input types are the same.
 void testOutputs()
          This test verifies that the number of outputs and output types are the same.
 void testWithInputMap(java.util.Map inputMap)
          This method tests the LocalWorker when it's passed an input map of values.
 void testWithInputs(java.lang.String[] inputNames, java.lang.String[] inputValues)
          This method tests a given local worker by setting all of the input names to the values specified in the inputValues array.
 
Methods inherited from class junit.framework.TestCase
countTestCases, getName, run, run, runBare, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LocalWorkerTest

public LocalWorkerTest(LocalWorker worker,
                       boolean allOutputsRequired,
                       boolean allInputsRequired)
Constructor

Parameters:
worker - The LocalWorker instance to be tested.
allOutputsRequired - Determines if all outputValues are required to be in the output map.
allInputsRequired - Determines if all inputValues are required to be in the input map.
Method Detail

testInputs

public void testInputs()
This test verifies that the number of inputs, and input types are the same.


testOutputs

public void testOutputs()
This test verifies that the number of outputs and output types are the same.


testWithInputs

public void testWithInputs(java.lang.String[] inputNames,
                           java.lang.String[] inputValues)
                    throws java.lang.Exception
This method tests a given local worker by setting all of the input names to the values specified in the inputValues array. These values are loaded into the inputMap and the LocalWorker's execute method is then called.

Parameters:
inputNames -
inputValues -
Throws:
java.lang.Exception

testWithInputMap

public void testWithInputMap(java.util.Map inputMap)
                      throws java.lang.Exception
This method tests the LocalWorker when it's passed an input map of values. It verifies that the input map only contains keys specified in the inputNames array of the LocalWorker. It also verifies that all output values are also present, and that the output map is neither null, nor empty.

Parameters:
inputMap -
Throws:
java.lang.Exception