|
|||||||||
| 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.struct.util.LpPrettyPrinterTest
public class LpPrettyPrinterTest
Contains tests of the LpPrettyPrinter class.
LpPrettyPrinter| Field Summary | |
|---|---|
protected StringBuilder |
expContents
A container for the expected contents of pp during the tests. |
protected StringBuilder |
expContents2
A container for the expected contents of pp2 during the tests. |
protected LpBuffer |
pp
An instance of LpPrettyPrinter used in the tests. |
protected LpBuffer |
pp2
An instance of LpPrettyPrinter used in the tests. |
protected Random |
r
A random number generator used in doTest(String, LpStructureUnit) to randomize the tests. |
| Constructor Summary | |
|---|---|
LpPrettyPrinterTest(String testName)
A default test case constructor. |
|
| Methods inherited from class junit.framework.TestCase |
|---|
countTestCases, createResult, getName, run, run, runBare, runTest, setName, 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 |
|---|
protected Random r
doTest(String, LpStructureUnit) to randomize the tests.
protected LpBuffer pp
LpPrettyPrinter used in the tests.
protected LpBuffer pp2
LpPrettyPrinter used in the tests.
protected StringBuilder expContents
pp during the tests.
protected StringBuilder expContents2
pp2 during the tests.
| Constructor Detail |
|---|
public LpPrettyPrinterTest(String testName)
testName - the name of the test case| Method Detail |
|---|
protected void setUp()
r, pp, pp2,
expContents and expContents2).
setUp in class TestCasepublic void testAsString()
LpBuffer.asString(LpStructureUnit) method.
public void testAppendNull()
null to the
LpBuffer.asString(LpStructureUnit) and
LpPrinter.append(LpStructureUnit) methods.
public void testAppendConstant()
LpConstant instances to the
LpBuffer.asString(LpStructureUnit) and
LpPrinter.append(LpStructureUnit) methods.
public void testAppendVariable()
LpVariable instances to the
LpBuffer.asString(LpStructureUnit) and
LpPrinter.append(LpStructureUnit) methods.
public void testAppendFunction()
LpFunction instances to the
LpBuffer.asString(LpStructureUnit) and
LpPrinter.append(LpStructureUnit) methods.
public void testAppendCompoundTerm()
LpCompoundTerm instances to the
LpBuffer.asString(LpStructureUnit) and
LpPrinter.append(LpStructureUnit) methods.
public void testAppendPredicate()
LpPredicate instances to the
LpBuffer.asString(LpStructureUnit) and
LpPrinter.append(LpStructureUnit) methods.
public void testAppendLiteral()
LpLiteral instances to the
LpBuffer.asString(LpStructureUnit) and
LpPrinter.append(LpStructureUnit) methods.
public void testAppendRule()
LpRule instances to the
LpBuffer.asString(LpStructureUnit) and
LpPrinter.append(LpStructureUnit) methods.
protected void doTest(String expected,
LpStructureUnit unit)
LpBuffer.asString(LpStructureUnit) and
LpPrinter.append(LpStructureUnit) methods when called with
unit as input.
expected - the expected string that should be returned/appendedunit - the tested LpStructureUnit
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||