|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
org.multijava.util.testing.TestCase
org.multijava.mjc.TestParsingController
Unit tests for ParsingController
| Field Summary | |
private JavadocLexer |
docLexer
|
private static String |
EXPECTED_SAMPLE_DOC
|
private static String |
EXPECTED_SAMPLE_DOC2
|
private static String |
EXPECTED_SAMPLE_DOC3
|
private static String |
IGNORE_SAMPLE_DOC_CLASS
|
private MjcLexer |
mjLexer
|
private ParsingController |
parsingController
|
private static String |
SAMPLE_CLASS
|
private static String |
SAMPLE_DOC
|
private static String |
SAMPLE_DOC2
|
private static String |
SAMPLE_DOC3
|
private static String |
SAMPLE_DOC_CLASS
|
private static TroubleReporter |
SIMPLE_REPORTER
|
| Fields inherited from class org.multijava.util.testing.TestCase |
NEWLINE |
| Fields inherited from class junit.framework.TestCase |
|
| Constructor Summary | |
TestParsingController(String name)
|
|
| Method Summary | |
private antlr.Token |
discardAllMJTokens()
Discards all MultiJava tokens from the input and returns the end-of-file token. |
private void |
establishLexers(String sourceCode)
Establish lexers and the controller for the given source code, without adding streams to the controller. |
private void |
establishTest(String sourceCode)
Establish lexers and controller for the given source code. |
private void |
establishTest(String sourceCode,
boolean selectInitial)
Establish lexers and controller for the given source code. |
void |
test_addInputStream_method1()
Should get an exception if the first argument is null. |
void |
test_addInputStream_method2()
Should get an exception if the second argument is null. |
void |
test_addInputStream_method3()
Should get an exception if we try to bind two input streams to the same key. |
void |
test_discardAllTokensFor_method1()
Should get an exception when requesting discarding for an undefined key. |
void |
test_discardAllTokensFor_method2()
Should get an exception when requesting discarding for a key for which a token stream has already been exposed |
void |
test_discardAllTokensFor_method3()
Should find no javadoc comments when discarding them, even though they are present in the source. |
void |
test_FilteredTokenStream_class1()
Should successfully lex the MultiJava tokens in the input stream. |
void |
test_FilteredTokenStream_class2()
Should successfully lex the javadoc tokens in the input stream, but no javadoc tokens are in the input stream. |
void |
test_FilteredTokenStream_class3()
Should successfully lex just the multijava tokens in the input stream. |
void |
test_FilteredTokenStream_class4()
Should successfully lex just the javadoc tokens in the input stream. |
void |
test_FilteredTokenStream_class5()
Should successfully lex both the multijava and javadoc tokens in the input stream. |
void |
test_FilteredTokenStream_class6()
Should successfully lex both the multijava and javadoc tokens in the input stream. |
void |
test_FilteredTokenStream_class7()
Should successfully lex both the multijava and javadoc tokens in the input stream. |
void |
test_FilteredTokenStream_class8()
Should successfully lex just the multijava tokens in the input stream despite the javadoc comment ending in '**' + '/'. |
void |
test_getColumn_method1()
Should successfully give the column numbers of each token. |
void |
test_getColumn_method2()
Should successfully give the column numbers of each token. |
void |
test_getLine_method1()
Should successfully give the line numbers of each token. |
void |
test_getLine_method2()
Should successfully give the line numbers of each token. |
void |
test_initialOutputStream_method1()
Should get an exception if we try to get the initial output stream without setting an initial lexer. |
void |
test_selectInitial_method1()
Should get an exception if we try to select based on a key that is not bound. |
void |
test_selectInitial_method2()
Should get an exception if we try to select more than once. |
void |
test_streamForBefore_method1()
Should get an exception when requesting a stream for an undefined key. |
void |
test_streamForBefore_method2()
Should be able to request a stream twice for the same key and index, but second stream should yield end-of-file token. |
| Methods inherited from class org.multijava.util.testing.TestCase |
assertDiff, assertEquals |
| 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 MjcLexer mjLexer
private JavadocLexer docLexer
private ParsingController parsingController
private static final String SAMPLE_CLASS
private static final String SAMPLE_DOC
private static final String SAMPLE_DOC2
private static final String EXPECTED_SAMPLE_DOC2
private static final String SAMPLE_DOC3
private static final String EXPECTED_SAMPLE_DOC3
private static final String EXPECTED_SAMPLE_DOC
private static final String SAMPLE_DOC_CLASS
private static final String IGNORE_SAMPLE_DOC_CLASS
private static final TroubleReporter SIMPLE_REPORTER
| Constructor Detail |
public TestParsingController(String name)
| Method Detail |
public void test_addInputStream_method1()
public void test_addInputStream_method2()
public void test_addInputStream_method3()
public void test_selectInitial_method1()
public void test_selectInitial_method2()
public void test_initialOutputStream_method1()
public void test_discardAllTokensFor_method1()
public void test_discardAllTokensFor_method2()
public void test_discardAllTokensFor_method3()
throws ParsingController.KeyException,
antlr.TokenStreamException
ParsingController.KeyException
antlr.TokenStreamExceptionpublic void test_streamForBefore_method1()
public void test_streamForBefore_method2()
throws ParsingController.KeyException,
antlr.TokenStreamException
ParsingController.KeyException
antlr.TokenStreamException
public void test_FilteredTokenStream_class1()
throws ParsingController.ConfigurationException,
antlr.TokenStreamException
ParsingController.ConfigurationException
antlr.TokenStreamException
public void test_FilteredTokenStream_class2()
throws ParsingController.ConfigurationException,
antlr.TokenStreamException
ParsingController.ConfigurationException
antlr.TokenStreamException
public void test_FilteredTokenStream_class3()
throws ParsingController.ConfigurationException,
antlr.TokenStreamException
ParsingController.ConfigurationException
antlr.TokenStreamException
public void test_FilteredTokenStream_class4()
throws ParsingController.ConfigurationException,
antlr.TokenStreamException
ParsingController.ConfigurationException
antlr.TokenStreamException
public void test_FilteredTokenStream_class5()
throws ParsingController.ConfigurationException,
antlr.TokenStreamException
ParsingController.ConfigurationException
antlr.TokenStreamException
public void test_FilteredTokenStream_class6()
throws ParsingController.ConfigurationException,
antlr.TokenStreamException
ParsingController.ConfigurationException
antlr.TokenStreamException
public void test_FilteredTokenStream_class7()
throws ParsingController.ConfigurationException,
antlr.TokenStreamException
ParsingController.ConfigurationException
antlr.TokenStreamException
public void test_FilteredTokenStream_class8()
throws ParsingController.ConfigurationException,
antlr.TokenStreamException
ParsingController.ConfigurationException
antlr.TokenStreamException
public void test_getLine_method1()
throws ParsingController.ConfigurationException,
antlr.TokenStreamException
ParsingController.ConfigurationException
antlr.TokenStreamException
public void test_getLine_method2()
throws ParsingController.ConfigurationException,
antlr.TokenStreamException
ParsingController.ConfigurationException
antlr.TokenStreamException
public void test_getColumn_method1()
throws ParsingController.ConfigurationException,
antlr.TokenStreamException
ParsingController.ConfigurationException
antlr.TokenStreamException
public void test_getColumn_method2()
throws ParsingController.ConfigurationException,
antlr.TokenStreamException
ParsingController.ConfigurationException
antlr.TokenStreamExceptionprivate void establishLexers(String sourceCode)
private void establishTest(String sourceCode,
boolean selectInitial)
sourceCode - the source code to be lexedselectInitial - indicates whether an initial stream should
be selectedprivate void establishTest(String sourceCode)
private antlr.Token discardAllMJTokens()
|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||