org.aitools.programd.test.aiml
Class TestSuite

java.lang.Object
  extended by org.aitools.programd.test.aiml.TestSuite
All Implemented Interfaces:
Iterable<TestCase>

public class TestSuite
extends Object
implements Iterable<TestCase>

A TestSuite comprises a set of TestCases.

Since:
4.5
Author:
Albertas Mickensas

Field Summary
static String TESTCASE_NAMESPACE_URI
          The test cases namespace URI.
 
Constructor Summary
TestSuite(String nameToUse, Multiplexor multiplexorToUse, org.apache.log4j.Logger loggerToUse)
          Creates a new TestSuite (with no clearInput).
TestSuite(String nameToUse, String clearInputToUse, Multiplexor multiplexorToUse, org.apache.log4j.Logger loggerToUse)
          Creates a new TestSuite.
 
Method Summary
 void addTestCase(TestCase testCase)
          Adds a test case to this suite.
 LinkedList<TestResult> getFailures()
           
 String getName()
           
 LinkedList<TestResult> getSuccesses()
           
 ArrayList<TestCase> getTestCases()
           
 Iterator<TestCase> iterator()
           
static TestSuite load(URL path, URL schema, org.apache.log4j.Logger logger)
          Loads a test suite from the given path.
static TestSuite load(URL path, URL schema, Multiplexor multiplexor, org.apache.log4j.Logger logger)
          Loads a test suite from the given path.
 boolean run(String botid)
          Runs the test cases contained in this suite.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TESTCASE_NAMESPACE_URI

public static final String TESTCASE_NAMESPACE_URI
The test cases namespace URI.

See Also:
Constant Field Values
Constructor Detail

TestSuite

public TestSuite(String nameToUse,
                 String clearInputToUse,
                 Multiplexor multiplexorToUse,
                 org.apache.log4j.Logger loggerToUse)
Creates a new TestSuite.

Parameters:
nameToUse - the name to give the test suite
clearInputToUse - the clearInput for the test suite
multiplexorToUse - the multiplexor to use

TestSuite

public TestSuite(String nameToUse,
                 Multiplexor multiplexorToUse,
                 org.apache.log4j.Logger loggerToUse)
Creates a new TestSuite (with no clearInput).

Parameters:
nameToUse - the name to give the test suite
multiplexorToUse - the multiplexor to use
Method Detail

iterator

public Iterator<TestCase> iterator()
Specified by:
iterator in interface Iterable<TestCase>
Returns:
an iterator over this suite's test cases
See Also:
Iterable.iterator()

addTestCase

public void addTestCase(TestCase testCase)
Adds a test case to this suite.

Parameters:
testCase - the test case to add.

getTestCases

public ArrayList<TestCase> getTestCases()
Returns:
the test cases in this suite

getName

public String getName()
Returns:
the name of this suite

run

public boolean run(String botid)
Runs the test cases contained in this suite.

Parameters:
botid - the botid for whom to run the test cases
Returns:
whether the test cases all passed successfully

getSuccesses

public LinkedList<TestResult> getSuccesses()
Returns:
the successes accumulated by this suite

getFailures

public LinkedList<TestResult> getFailures()
Returns:
the failures accumulated by this suite

load

public static TestSuite load(URL path,
                             URL schema,
                             org.apache.log4j.Logger logger)
Loads a test suite from the given path.

Parameters:
path - the path from which to load the test suite
schema - the URL to the copy of the schema for test cases
Returns:
the loaded test suite

load

public static TestSuite load(URL path,
                             URL schema,
                             Multiplexor multiplexor,
                             org.apache.log4j.Logger logger)
Loads a test suite from the given path.

Parameters:
path - the path from which to load the test suite
schema - the URL to the copy of the schema for test cases
multiplexor - the multiplexor to use
Returns:
the loaded test suite