|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--junit.framework.Assert | +--junit.framework.TestCase | +--suvi.parse.GraphParserTest
A [JUnit]
test for GraphParser
.
Each parser test case functions by creating a StringReader
from a string, a lexer based on the reader and a
parser based on the lexer. Then the test case calls the parser's parse
method and checks whether there was a syntax error exception - if no
exception was expected, the test fails; if an exception was expected
and there was none, the test fails; otherwise it succeeds (unless there
was an unexpected exception, i.e. a non-syntax-error exception.
Constructor Summary | |
GraphParserTest()
|
Method Summary | |
void |
testErrSyntax(java.lang.String s)
A helper method for the invalid syntax tests A syntax error exception is expected. |
void |
testForgottenSemi()
Test for invalid syntax: no semicolon at the end of an adjacency list item. |
void |
testOkFull()
Test for valid syntax, with all optional parts in. |
void |
testOkNoAttrList()
Test for valid syntax, with the optional node and edge attribute part out. |
void |
testOkNoGraphAttr()
Test for valid syntax, with the optional global attribute part out. |
void |
testOkOnlyTopology()
Test for valid syntax, with only the required topology part in. |
void |
testOkSyntax(java.lang.String s)
A helper method for the valid syntax tests. |
void |
testWithSemi()
Test for valid syntax; identical with the testForgottenSemi test case but with the
forgotten semicolon back in. |
static void |
tryParse(java.lang.String s)
A helper method to create the parser from a string and trying the parse. |
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 |
Constructor Detail |
public GraphParserTest()
Method Detail |
public void testOkFull()
Test for valid syntax, with all optional parts in.
public void testOkNoGraphAttr()
Test for valid syntax, with the optional global attribute part out.
public void testOkNoAttrList()
Test for valid syntax, with the optional node and edge attribute part out.
public void testOkOnlyTopology()
Test for valid syntax, with only the required topology part in.
public void testForgottenSemi()
Test for invalid syntax: no semicolon at the end of an adjacency list item.
public void testWithSemi()
Test for valid syntax; identical with the testForgottenSemi
test case but with the
forgotten semicolon back in.
public void testOkSyntax(java.lang.String s)
A helper method for the valid syntax tests.
No exceptions are expected.
public void testErrSyntax(java.lang.String s)
A helper method for the invalid syntax tests
A syntax error exception is expected. Other exceptions cause a failure.
public static void tryParse(java.lang.String s)
A helper method to create the parser from a string and trying the parse.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |