The Meta-Environment API

nl.cwi.sen1.tunit
Class TUnitTestCase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by nl.cwi.sen1.tunit.TUnitTestCase
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
ExampleTestCase

public abstract class TUnitTestCase
extends junit.framework.TestCase

The TUnitTestCase class is a base class for testing toolbus scripts. This class can start / stop the toolbus and connect / disconnect stubs from the toolbus.

Author:
Bas Basten & Anton Lycklama a Nijeholt

Field Summary
protected  DefaultTestToolExecutorFactory defaultTestToolExecutorFactory
           
private  boolean errorsOccured
           
protected  aterm.ATermFactory factory
           
protected  toolbus.ToolBus toolbus
           
 
Constructor Summary
TUnitTestCase()
           
 
Method Summary
 void addComValidatorForExecutableTool(java.lang.String name, java.lang.Class<ToolComValidator> toolStubClass)
           
 void connectToolComValidator(ToolComValidator toolComValidator)
           
 int getPort()
           
 java.lang.String getTopSrcDir()
          Get the absolute top path of the current package.
 boolean hasFailed()
           
protected  void startToolbus(java.lang.String searchPath, java.lang.String scriptName)
          Starts the toolbus at a given port and executes a script.
protected  void stopToolbus()
          Stops the toolbus.
 void testFailed(java.lang.String message)
           
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

toolbus

protected volatile toolbus.ToolBus toolbus

factory

protected final aterm.ATermFactory factory

defaultTestToolExecutorFactory

protected final DefaultTestToolExecutorFactory defaultTestToolExecutorFactory

errorsOccured

private volatile boolean errorsOccured
Constructor Detail

TUnitTestCase

public TUnitTestCase()
Method Detail

getTopSrcDir

public java.lang.String getTopSrcDir()
Get the absolute top path of the current package.


startToolbus

protected void startToolbus(java.lang.String searchPath,
                            java.lang.String scriptName)
Starts the toolbus at a given port and executes a script. If a script uses include scripts the searchPath will be used to include the include scripts from.

Parameters:
searchPath - The directories to search for the included script files of the specified script.
scriptName - The script to be executed.

stopToolbus

protected void stopToolbus()
Stops the toolbus.


getPort

public int getPort()

connectToolComValidator

public void connectToolComValidator(ToolComValidator toolComValidator)
                             throws java.lang.Exception
Throws:
java.lang.Exception

addComValidatorForExecutableTool

public void addComValidatorForExecutableTool(java.lang.String name,
                                             java.lang.Class<ToolComValidator> toolStubClass)

testFailed

public void testFailed(java.lang.String message)

hasFailed

public boolean hasFailed()

The Meta-Environment API