| org.mandarax.reference.validation.TestCaseImpl
TestCaseImpl | public class TestCaseImpl extends junit.framework.TestCase implements TestCase(Code) | | Default implementation of a test case, based on the JUnit framework.
author: Jens Dietrich version: 3.4 <7 March 05> since: 3.3.3 |
Constructor Summary | |
public | TestCaseImpl(ClauseSet[] assumptions, int policyToAddAssumptionsToKB, Query query, int expectedNumberOfResults, java.util.Map[] expectedReplacements, boolean mustBeTrue) Constructor. | public | TestCaseImpl(ClauseSet[] assumptions, int policyToAddAssumptionsToKB, Query query, int expectedNumberOfResults) Constructor. | public | TestCaseImpl(ClauseSet[] assumptions, int policyToAddAssumptionsToKB, Query query, java.util.Map[] expectedReplacements) Constructor. | public | TestCaseImpl(ClauseSet[] assumptions, int policyToAddAssumptionsToKB, Query query, boolean mustBeTrue) Constructor. |
expectedNumberOfResults | protected int expectedNumberOfResults(Code) | | |
TestCaseImpl | public TestCaseImpl(ClauseSet[] assumptions, int policyToAddAssumptionsToKB, Query query, int expectedNumberOfResults, java.util.Map[] expectedReplacements, boolean mustBeTrue)(Code) | | Constructor.
Parameters: assumptions - Parameters: policyToAddAssumptionsToKB - Parameters: query - Parameters: expectedNumberOfResults - Parameters: expectedReplacements - Parameters: mustBeTrue - |
TestCaseImpl | public TestCaseImpl(ClauseSet[] assumptions, int policyToAddAssumptionsToKB, Query query, int expectedNumberOfResults)(Code) | | Constructor.
Parameters: assumptions - Parameters: policyToAddAssumptionsToKB - Parameters: query - Parameters: expectedNumberOfResults - |
TestCaseImpl | public TestCaseImpl(ClauseSet[] assumptions, int policyToAddAssumptionsToKB, Query query, java.util.Map[] expectedReplacements)(Code) | | Constructor.
Parameters: assumptions - Parameters: policyToAddAssumptionsToKB - Parameters: query - Parameters: expectedReplacements - |
TestCaseImpl | public TestCaseImpl(ClauseSet[] assumptions, int policyToAddAssumptionsToKB, Query query, boolean mustBeTrue)(Code) | | Constructor.
Parameters: assumptions - Parameters: policyToAddAssumptionsToKB - Parameters: query - Parameters: expectedNumberOfResults - Parameters: expectedReplacements - Parameters: mustBeTrue - |
equals | public boolean equals(Object obj)(Code) | | Compares objects.
Parameters: obj - an object a boolean |
execute | public void execute() throws Exception(Code) | | Tests the knowledge base.
|
getAssumptions | public ClauseSet[] getAssumptions()(Code) | | Get the assumptions.
Returns the assumptions. |
getExpectedNumberOfResults | public int getExpectedNumberOfResults()(Code) | | Returns the expectedNumberOfResults. |
getExpectedReplacements | public java.util.Map[] getExpectedReplacements()(Code) | | Get an array of maps containing variable term -> constant term mapping expected in the result
at this position.
Can be null indicating that this condition will not be checked in this test case.
Returns the expectedReplacements. |
getPolicyToAddAssumptionsToKB | public int getPolicyToAddAssumptionsToKB()(Code) | | Get the policy to add an assumption.
an integer, the (encoded) policy = one of the constants defined in TestCase |
getProperties | public Properties getProperties()(Code) | | Get the properties as one "properties" instance.
a properties instance |
getProperty | public String getProperty(String key)(Code) | | Get a property.
Parameters: key - the property key the respective value. The method returns null if the property is not found. |
getQuery | public Query getQuery()(Code) | | Get the test query.
Returns the query. |
hashCode | public int hashCode()(Code) | | Get the hash code for this object
an integer |
isMustBeTrue | public boolean isMustBeTrue()(Code) | | Indicates whether a test case must yield true.
Only used if the query is ground (does not have variables).
Returns the mustBeTrue. |
prepare | public void prepare() throws Exception(Code) | | Prepares the test case.
|
propertyNames | public Enumeration propertyNames()(Code) | | Returns an enumeration of all the keys in this property list, including distinct
keys in the default property list if a key of the same name has not already been
found from the main properties list.
an enumeration of all the keys in this property list, including the keys in the default property list |
release | public void release() throws Exception(Code) | | Releases the test case.
|
removeProperty | public Object removeProperty(String key)(Code) | | Remove a property.
Parameters: key - the property key the value to which the key had been mapped, or null if the key did not have a mapping. |
setAssumptions | public void setAssumptions(ClauseSet[] assumptions)(Code) | | Set the assumptions.
Parameters: assumptions - The assumptions to set. |
setExpectedNumberOfResults | public void setExpectedNumberOfResults(int expectedNumberOfResults)(Code) | | Parameters: expectedNumberOfResults - The expectedNumberOfResults to set. |
setExpectedReplacements | public void setExpectedReplacements(java.util.Map[] expectedReplacements)(Code) | | Set an array of maps containing variable term -> constant term mapping expected in the result
at this position.
Can be null indicating that this condition will not be checked in this test case.
Parameters: expectedReplacements - The expectedReplacements to set. |
setKb | public void setKb(KnowledgeBase kb)(Code) | | Set the kb. Called by the kb when adding the test case to the kb to insert a back reference.
Parameters: kb - The kb to set. |
setMustBeTrue | public void setMustBeTrue(boolean mustBeTrue)(Code) | | Sets whether a test case must yield true.
Only used if the query is ground (does not have variables).
Parameters: mustBeTrue - The mustBeTrue to set. |
setPolicyToAddAssumptionsToKB | public void setPolicyToAddAssumptionsToKB(int policy)(Code) | | Set the policy to add an assumption.
Parameters: policy - the (encoded) policy = one of the constants defined in TestCase |
setProperties | public void setProperties(Properties properties)(Code) | | Set the properties. Not required by the interface, but useful for bean (introspection-) based
tools.
Parameters: properties - the properties |
setProperty | public Object setProperty(String key, String value)(Code) | | Set a property.
Parameters: key - the key Parameters: value - the value the previous value of the specified key in this property list, or null if it did not have one. |
setQuery | public void setQuery(Query query)(Code) | | Set the test query.
Parameters: query - The query to set. |
setUp | protected void setUp() throws Exception(Code) | | Sets up down the test case.
|
tearDown | protected void tearDown() throws Exception(Code) | | Tears down the test case.
|
|
|