net.thefrontside.crosscheck
Class Runner

java.lang.Object
  extended bynet.thefrontside.crosscheck.Runner

public class Runner
extends java.lang.Object

Controls the configuration and execution of a suite of tests across a set of multiple browsers. Which tests will be run are first specified by adding test elements to the Runner object which are either files or directories that will define test cases. Which browser environments against which to run the battery of tests are also configurable. example:

  Runner runner = new Runner();

  runner.addBrowser(Browser.IE6);
  runner.addBrowser(Browser.MOZILLA_1_8)
  
  runner.addSuiteListener(new MySuiteListener())
  
  runner.run()
 
Runner also comes with a main method which will treat its arguments as the names of test elements, and provides a default console reporting mechanism to track the results of the testcases as they happen. example:
  java net.thefrontside.crosscheck.Runner tests/FirstTest.js tests/SecondTest.js tests/test-dir
 


Constructor Summary
Runner()
           
 
Method Summary
 void addBrowser(Browser browser)
          Add a browser environment to run the tests contained in this runner against.
 void addSuiteListener(CrosscheckListener listener)
          Add a CrosscheckListener to this Runner, which will be notified of events corresponding to the status of tests as they happen
 void addTestElement(java.lang.String element)
          Add either a file or a directory (relative to the current working directory) to the set of test sources which will be loaded when running each battery of tests.
static void main(java.lang.String[] args)
          Creates a Runner configured to run all known browsers; calls addTestElement for each member of args.
 void run()
          Execute all of the tests specied in the test elements of this runner against all of the browsers specified by addBrowser.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Runner

public Runner()
Method Detail

addTestElement

public void addTestElement(java.lang.String element)
Add either a file or a directory (relative to the current working directory) to the set of test sources which will be loaded when running each battery of tests. If element is a file, it will be interpreted as javascript. If it is a directory, it will scan the directory for all files ending with "Test.js", and will interpret each file as javascript.

Parameters:
element - file or directory containing scripts to build tests.

addSuiteListener

public void addSuiteListener(CrosscheckListener listener)
Add a CrosscheckListener to this Runner, which will be notified of events corresponding to the status of tests as they happen

Parameters:
listener - the listener to add to this Runner.

main

public static void main(java.lang.String[] args)
Creates a Runner configured to run all known browsers; calls addTestElement for each member of args. and executes against every browser environment.

Parameters:
args - a list of test elements (files or directories) containing test cases.

addBrowser

public void addBrowser(Browser browser)
Add a browser environment to run the tests contained in this runner against. When the run() method is invoked, each browser specified by a call to this method will be first loaded, and then the tests run in that environment.

Parameters:
browser - the browser environment against which the tests will be run.

run

public void run()
Execute all of the tests specied in the test elements of this runner against all of the browsers specified by addBrowser. Results of the tests will be reported to all of the CrosscheckListeners of this Runner as they happen.


The inevitable future of AJAX.

© 2006 The Frontside Software, Inc.