|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
lp.trans.DlpGrounderTest
public class DlpGrounderTest
Contains tests of the DlpGrounder
class.
DlpGrounder
Field Summary | |
---|---|
private DlpGrounder |
grounder
The tested DlpGrounder instance. |
private LpParser |
parser
The parser used in the tests. |
Constructor Summary | |
---|---|
DlpGrounderTest(String testName)
A default test case constructor. |
Method Summary | |
---|---|
private void |
doTest(String[] inputDlp,
String[] groundedDlp,
GrounderMessage expError,
List<GrounderMessage> expWarnings)
Performs a single call of grounder.ground(inputProgram); and tests if expected output program, error and warnings are extracted from the lparse's output. |
private GrounderMessage |
makeGrounderMessage(String message,
String sourceRule,
boolean isWarning)
|
void |
testAlreadyGroundedInput()
Tests DlpGrounder on an already grounded input. |
void |
testConstraint()
Tests DlpGrounder on input with constraints. |
void |
testErrorFreeInput()
Tests DlpGrounder on an error free input. |
void |
testInputWithError()
Tests DlpGrounder on input with an error. |
void |
testMultipleWarnings()
Tests DlpGrounder on input that should issue multiple warnings. |
void |
testNoProgram()
Tests DlpGrounder on input that only contains no program. |
void |
testOneEmptyProgram()
Tests DlpGrounder on input that only contains one empty program. |
void |
testOneWarning()
Tests DlpGrounder on input that should issue one warning. |
void |
testWeirdError()
Tests DlpGrounder on input that should issue a weird error. |
Methods inherited from class junit.framework.TestCase |
---|
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString |
Methods inherited from class junit.framework.Assert |
---|
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private final LpParser parser
private final DlpGrounder grounder
DlpGrounder
instance.
Constructor Detail |
---|
public DlpGrounderTest(String testName)
testName
- the name of the test caseMethod Detail |
---|
public void testAlreadyGroundedInput()
DlpGrounder
on an already grounded input.
This test can only pass if the lparse binary can be executed by issuing a
simple "lparse"
command.
public void testErrorFreeInput()
DlpGrounder
on an error free input.
This test can only pass if the lparse binary can be executed by issuing a
simple "lparse"
command.
public void testInputWithError()
DlpGrounder
on input with an error.
This test can only pass if the lparse binary can be executed by issuing a
simple "lparse"
command.
public void testOneWarning()
DlpGrounder
on input that should issue one warning.
This test can only pass if the lparse binary can be executed by issuing a
simple "lparse"
command.
public void testMultipleWarnings()
DlpGrounder
on input that should issue multiple warnings.
This test can only pass if the lparse binary can be executed by issuing a
simple "lparse"
command.
public void testWeirdError()
DlpGrounder
on input that should issue a weird error.
This test can only pass if the lparse binary can be executed by issuing a
simple "lparse"
command.
public void testOneEmptyProgram()
DlpGrounder
on input that only contains one empty program.
This test can only pass if the lparse binary can be executed by issuing a
simple "lparse"
command.
public void testNoProgram()
DlpGrounder
on input that only contains no program.
This test can only pass if the lparse binary can be executed by issuing a
simple "lparse"
command.
public void testConstraint()
DlpGrounder
on input with constraints.
This test can only pass if the lparse binary can be executed by issuing a
simple "lparse"
command.
private GrounderMessage makeGrounderMessage(String message, String sourceRule, boolean isWarning)
private void doTest(String[] inputDlp, String[] groundedDlp, GrounderMessage expError, List<GrounderMessage> expWarnings)
grounder.ground(inputProgram);and tests if expected output program, error and warnings are extracted from the lparse's output.
inputDlp
- the input dynamic logic program to groundgroundedDlp
- the expected grounded dynamic logic programexpError
- the expected lparse errorexpWarnings
- the expected lparse warnings
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |