junit.extensions.abbot
Class ScriptFixture

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by junit.extensions.abbot.ScriptFixture
All Implemented Interfaces:
Test
Direct Known Subclasses:
FontChooserTest, MyCodeTest

public class ScriptFixture
extends TestCase

Simple wrapper for a test script to run under JUnit. If the script does not contain a launch step, the hierarchy used will include existing components. No automatic cleanup of components is performed, since it is assumed that a Terminate step within the script will trigger that operation if it is required.


Constructor Summary
ScriptFixture(String filename)
          Construct a test case with the given name, which must be the filename of the script to run.
 
Method Summary
static void main(String[] args)
          Assumes each argument is an Abbot script.
protected  void runTest()
          Override the default TestCase runTest method to invoke the script.
protected  void setUp()
          Saves the current UI state for restoration when the fixture (if any) is terminated.
protected  void tearDown()
           
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ScriptFixture

public ScriptFixture(String filename)
Construct a test case with the given name, which must be the filename of the script to run.

Method Detail

setUp

protected void setUp()
              throws Exception
Saves the current UI state for restoration when the fixture (if any) is terminated. Also sets up a TestHierarchy for the duration of the test.

Overrides:
setUp in class TestCase
Throws:
Exception

tearDown

protected void tearDown()
                 throws Exception
Overrides:
tearDown in class TestCase
Throws:
Exception

runTest

protected void runTest()
                throws Throwable
Override the default TestCase runTest method to invoke the script. The Script is created and a default StepRunner is used to run it.

Overrides:
runTest in class TestCase
Throws:
Throwable
See Also:
TestCase.runTest()

main

public static void main(String[] args)
Assumes each argument is an Abbot script. Runs each one.



Copyright © 2002-2008 Timothy Wall. All Rights Reserved.
Abbot is hosted on

SourceForge