|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.aitools.programd.test.aiml.TestCase
public class TestCase
A TestCase contains an inputs and a set of checkers that test the response to that inputs.
| Field Summary | |
|---|---|
protected List<Checker> |
checkers
The checker(s) contained in this test case. |
protected String |
input
The inputs that this test case should send. |
protected String |
lastResponse
The last response received by this test case. |
protected String |
name
The name of this test case. |
static String |
TAG_DESCRIPTION
The string "". |
static String |
TAG_INPUT
The string "". |
static String |
TAG_TESTCASE
The string "". |
| Constructor Summary | |
|---|---|
TestCase(Element element,
String encoding,
int index)
Creates a new TestCase from the given XML element. |
|
TestCase(String testInput)
Constructs a basic TestCase with just an input. |
|
TestCase(String testInput,
String expectedAnswer)
Constructs a basic TestCase with an input and an expected answer (utility constructor). |
|
| Method Summary | |
|---|---|
void |
addChecker(Checker checker)
Adds a given checker. |
boolean |
equals(Object obj)
|
List<String[]> |
getDescription()
Produces a map of checker names to contents that can be used to describe the test case textually. |
String |
getInput()
|
String |
getLastResponse()
|
String |
getName()
|
int |
hashCode()
|
void |
removeCheckers()
Removes all checkers. |
boolean |
run(Multiplexor multiplexor,
String userid,
String botid)
Runs this test case for the given botid. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static String TAG_TESTCASE
public static String TAG_DESCRIPTION
public static String TAG_INPUT
protected String name
protected String input
protected List<Checker> checkers
protected String lastResponse
| Constructor Detail |
|---|
public TestCase(Element element,
String encoding,
int index)
element - the TestCase elementencoding - the encoding of the document from which this element comesindex - a default index to use for automatically naming this case
public TestCase(String testInput,
String expectedAnswer)
testInput - the input to useexpectedAnswer - the answer to expectpublic TestCase(String testInput)
testInput - the input to use| Method Detail |
|---|
public String getName()
public String getInput()
public String getLastResponse()
public boolean run(Multiplexor multiplexor,
String userid,
String botid)
multiplexor - the Multiplexor to use for testinguserid - the userid to use when testingbotid - the bot for whom to run this test case
public List<String[]> getDescription()
public void removeCheckers()
public void addChecker(Checker checker)
checker - the checker to addpublic boolean equals(Object obj)
equals in class ObjectObject.equals(java.lang.Object)public int hashCode()
hashCode in class ObjectObject.hashCode()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||