org.ourgrid.test
Class SelectiveTestsRunner

java.lang.Object
  extended by org.ourgrid.test.SelectiveTestsRunner

public class SelectiveTestsRunner
extends java.lang.Object

Description: This classes creates, using a SelectiveTestCollector and runs, using a junit.runner,TestRunner, a test suite.
The test suite is created based on the tests type that should be executed, as described in org.ourgrid.test.SelectiveTestCollector.
The tests can be executed with a junit.textui.TestRunner or a junit.swingui.TestRunner. This selection depends on the value of the envionment variable ourgrid.test.type.

Version:
1.0 Created on 05/07/2004 TODO Write unit tests for this class

Nested Class Summary
protected  class SelectiveTestsRunner.SwingRunner
           
protected  class SelectiveTestsRunner.TextRunner
           
 
Field Summary
protected  java.lang.String runnerType
          Indicates the type os TestRunner that will be used to run the tests.
static java.lang.String SWINGRUNNER
          Value of the environment variable ourgrid.test.type that Indicates that the tests should be executed with a junit.swingui.TestRunner
protected  SelectiveTestCollector testCollector
          A SelectiveTestCollector to create the test suite.
static java.lang.String TEXTRUNNER
          Value of the environment variable ourgrid.test.type that Indicates that the tests should be executed with a junit.textui.TestRunner
 
Constructor Summary
SelectiveTestsRunner(java.lang.String selectiveClassName)
          Creates a SelectiveTestsRunner setting the test type to be executed and the basedir to search for test classes.
 
Method Summary
protected  junit.framework.Test getTestSuite()
          Asks the SelectiveTestCollector to create the test suite.
static void main(java.lang.String[] args)
          Runs a suite of tests in which all tests implements an interface specified as a command line argument.
 void runTests()
          Runs the test suite created using a SelectiveTestCollector The tests can be executed with a junit.textui.TestRunner or a junit.swingui.TestRunner.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

testCollector

protected SelectiveTestCollector testCollector
A SelectiveTestCollector to create the test suite.


TEXTRUNNER

public static java.lang.String TEXTRUNNER
Value of the environment variable ourgrid.test.type that Indicates that the tests should be executed with a junit.textui.TestRunner


SWINGRUNNER

public static java.lang.String SWINGRUNNER
Value of the environment variable ourgrid.test.type that Indicates that the tests should be executed with a junit.swingui.TestRunner


runnerType

protected java.lang.String runnerType
Indicates the type os TestRunner that will be used to run the tests.

Constructor Detail

SelectiveTestsRunner

public SelectiveTestsRunner(java.lang.String selectiveClassName)
                     throws java.lang.ClassNotFoundException
Creates a SelectiveTestsRunner setting the test type to be executed and the basedir to search for test classes.

Parameters:
selectiveClassName - Full class name of the test type that should be executed. E.g. org.ougrid.tests.FastTest
Throws:
java.lang.ClassNotFoundException - If the selectiveClassName didn't represented a valid class name.
Method Detail

runTests

public void runTests()
Runs the test suite created using a SelectiveTestCollector The tests can be executed with a junit.textui.TestRunner or a junit.swingui.TestRunner. This selection depends on the value of the envionment variable ourgrid.test.type.


getTestSuite

protected junit.framework.Test getTestSuite()
Asks the SelectiveTestCollector to create the test suite.

Returns:
A test suite where all tests are of type selectiveTestType

main

public static void main(java.lang.String[] args)
Runs a suite of tests in which all tests implements an interface specified as a command line argument.

Parameters:
args -