|
|||||||||
| 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.LpGrounderTest
public class LpGrounderTest
Contains tests of the LpGrounder class.
LpGrounder| Field Summary | |
|---|---|
private LpGrounder |
grounder
The LpGrounder instance used in the tests. |
private LpLiteral[] |
litAs
An array with literals "a(1)" ... |
private LpLiteral |
litAVar
A literal "a(X)" used in the tests. |
private LpLiteral |
litBConst
A literal "b(x)" used in the tests. |
private LpLiteral[] |
litBs
An array with literals "b(1)" ... |
private LpLiteral |
litBVar
A literal "b(X)" used in the tests. |
private LpLiteral[] |
litDs
An array with literals "b(1)" ... |
private LpLiteral |
litDVar
A literal "d(X)" used in the tests. |
private LpLiteral[] |
litNotAs
An array with literals "not a(1)" ... |
private LpLiteral |
litNotAVar
Literal "not a(X)" used in the tests. |
private LpLiteral[] |
litNotBs
An array with literals "not b(1)" ... |
private LpLiteral |
litNotBVar
Literal "not b(X)" used in the tests. |
| Constructor Summary | |
|---|---|
LpGrounderTest(String testName)
A default test case constructor. |
|
| Method Summary | |
|---|---|
private void |
doTest(LogicProgram inputProgram,
LogicProgram expOutputProgram,
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. |
void |
testErrorFreeInput()
Tests LpGrounder on an error free input. |
void |
testInputWithError()
Tests LpGrounder on an input with a single error and no warnings. |
void |
testMultipleWarnings()
Tests LpGrounder on an input with a multiple warnings and no
error. |
void |
testOneWarning()
Tests LpGrounder on an input with a single warning and no 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 LpLiteral litAVar
private final LpLiteral litNotAVar
private final LpLiteral[] litAs
private final LpLiteral[] litNotAs
private final LpLiteral litBConst
private final LpLiteral litBVar
private final LpLiteral litNotBVar
private final LpLiteral[] litBs
private final LpLiteral[] litNotBs
private final LpLiteral litDVar
private final LpLiteral[] litDs
private final LpGrounder grounder
LpGrounder instance used in the tests.
| Constructor Detail |
|---|
public LpGrounderTest(String testName)
testName - the name of the test case| Method Detail |
|---|
public void testErrorFreeInput()
LpGrounder 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()
LpGrounder on an input with a single error and no warnings.
This test can only pass if the lparse binary can be executed by issuing a
simple "lparse" command.
public void testOneWarning()
LpGrounder on an input with a single warning and no error.
This test can only pass if the lparse binary can be executed by issuing a
simple "lparse" command.
public void testMultipleWarnings()
LpGrounder on an input with a multiple warnings and no
error.
This test can only pass if the lparse binary can be executed by issuing a
simple "lparse" command.
private void doTest(LogicProgram inputProgram,
LogicProgram expOutputProgram,
GrounderMessage expError,
List<GrounderMessage> expWarnings)
grounder.ground(inputProgram);and tests if expected output program, error and warnings are extracted from the lparse's output.
inputProgram - the input program to groundexpOutputProgram - the expected output 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 | ||||||||