Article Discussion
Drive Your Unit Tests with Custom Scripts
Summary: This tutorial shows you how to customize a Suite subclass so that it executes tests by interpreting a script written in a custom test language.
0 posts.
The ability to add new comments in this discussion is temporarily disabled.
    Bill
     
    Posts: 409 / Nickname: bv / Registered: January 17, 2002 4:28 PM
    Drive Your Unit Tests with Custom Scripts
    March 10, 2003 11:15 PM      
    Artima.com has published a tutorial that shows you how to customize an org.suiterunner.Suite subclass so that it executes tests by interpreting a script written in a custom test language.---xj40dkcfea73---Artima.com has published a tutorial that shows you how to customize an org.suiterunner.Suite subclass so that it executes tests by interpreting a script written in a custom test language.

    http://www.artima.com/suiterunner/scriptdriven.html

    Here's an excerpt:

    In Artima SuiteRunner's API contracts, "test" is used abstractly. A test method is one kind of test, but not the only kind. Executing test methods, as performed by Suite's implementation of execute, is one way to execute tests -- but not the only way. To execute tests in a different way, Suite subclasses can override execute. When execute is invoked on such a Suite subclass, its own execute implementation can execute tests in a custom way.

    This article shows an example of a Suite subclass whose execute method:

    - Reads in a file, written in a simple custom scripting language, that contains test commands
    - Interprets the commands in the file, and executes the requested tests
    - Invokes execute on each sub-Suite