|
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.TestMjcParser
Unit tests for MjcParser
| Nested Class Summary | |
protected static class |
TestMjcParser.TestCompiler
|
| Field Summary | |
protected Main |
compiler
|
private static JavadocLexer |
docLexer
|
static StringBuffer |
errorOut
|
private static MjcLexer |
mjLexer
|
private static MjcParser |
parser
|
private static ParsingController |
parsingController
Used to switch lexers. |
private static String |
SAMPLE_AUG_METHOD
|
private static String |
SAMPLE_CLASS
|
private static String |
SAMPLE_DOC
|
private static String |
SAMPLE_DOC_CLASS
|
private static String |
SAMPLE_DOC_CONTENT
|
private static String |
SAMPLE_FIELD
|
private static String |
SAMPLE_INIT
|
private static String |
SAMPLE_INIT2
|
private static String |
SAMPLE_INNER_CLASS
|
private static String |
SAMPLE_INTERFACE
|
private static String |
SAMPLE_METHOD
|
| Fields inherited from class org.multijava.util.testing.TestCase |
NEWLINE |
| Fields inherited from class junit.framework.TestCase |
|
| Constructor Summary | |
TestMjcParser(String name)
|
|
TestMjcParser(String name,
ModifierUtility modUtil)
|
|
| Method Summary | |
protected void |
establishTest(String sourceCode)
Establish lexers and parsers for the given source code, including parsing of javadoc comments. |
protected void |
establishTest(String sourceCode,
boolean parseJavadocs)
Establish lexers and parsers for the given source code, parsing javadoc comments according to the given boolean. |
protected JCompilationUnitType |
getAST(String sourceCode)
Returns an AST for the source code represented by the given string. |
protected JCompilationUnitType |
getAST(String sourceCode,
boolean parseJavadocs)
Returns an AST for the source code represented by the given string. |
void |
test_comment_parsing_1()
|
void |
test_comment_parsing_2()
|
void |
test_ignore_misplaced_javadoc_parsing1()
Should ignore javadoc comment preceding the package declaration. |
void |
test_ignore_misplaced_javadoc_parsing10()
Should ignore javadoc comments inside a method declaration. |
void |
test_ignore_misplaced_javadoc_parsing11()
Should ignore javadoc comments inside a field declaration. |
void |
test_ignore_misplaced_javadoc_parsing12()
Should ignore javadoc comments inside an initializer declaration. |
void |
test_ignore_misplaced_javadoc_parsing13()
Should ignore javadoc comments inside an if-else statement. |
void |
test_ignore_misplaced_javadoc_parsing2()
Should ignore javadoc comment between "public" and "class". |
void |
test_ignore_misplaced_javadoc_parsing3()
Should ignore javadoc comment between "class" and "Sample". |
void |
test_ignore_misplaced_javadoc_parsing4()
Should ignore javadoc comment between "Sample" and "{". |
void |
test_ignore_misplaced_javadoc_parsing5()
Should ignore javadoc comment inside empty class body. |
void |
test_ignore_misplaced_javadoc_parsing6()
Should ignore evil javadoc comment inside empty class body while successfully parsing the class. |
void |
test_ignore_misplaced_javadoc_parsing7()
Should ignore javadoc comments inside an interface declaration. |
void |
test_ignore_misplaced_javadoc_parsing8()
Should ignore javadoc comments inside an augmenting method declaration. |
void |
test_ignore_misplaced_javadoc_parsing9()
Should ignore javadoc comments inside an empty inner class declaration. |
void |
test_initMods_1()
|
void |
test_initMods_2()
|
void |
test_initMods_3()
|
void |
test_initMods_4()
|
void |
testAugmentingMethodDeclJavadocParsing1()
Should handle javadoc comments for an augmenting method declaration. |
void |
testClassDeclJavadocParsing1()
Should handle a class declaration preceded by a javadoc comment. |
void |
testClassDeclJavadocParsing2()
Should handle javadoc comment for a class declaration. |
void |
testClassDeclJavadocParsing3()
Should handle empty javadoc comment. |
void |
testClassDeclJavadocParsing4()
Should handle two javadoc comments for a single class declaration. |
void |
testClassDeclJavadocParsing5()
Should get a null javadoc comment for a class declaration when javadoc parsing is disabled. |
void |
testClassDeclParsing()
Should handle a class declaration without a javadoc comment. |
void |
testFieldJavadocParsing1()
Should handle javadoc comments for a field declaration. |
void |
testInitializerJavadocParsing1()
Should handle javadoc comments for an initializer declaration. |
void |
testInnerClassJavadocParsing1()
Should handle javadoc comments for an inner class declaration. |
void |
testInterfaceDeclJavadocParsing1()
Should handle javadoc comments for an interface declaration. |
void |
testMethodJavadocParsing1()
Should handle javadoc comments for a method declaration. |
| 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 static MjcLexer mjLexer
private static JavadocLexer docLexer
private static MjcParser parser
private static ParsingController parsingController
public static final StringBuffer errorOut
protected Main compiler
private static final String SAMPLE_DOC_CONTENT
private static final String SAMPLE_DOC
private static final String SAMPLE_CLASS
private static final String SAMPLE_INTERFACE
private static final String SAMPLE_AUG_METHOD
private static final String SAMPLE_DOC_CLASS
private static final String SAMPLE_INNER_CLASS
private static final String SAMPLE_METHOD
private static final String SAMPLE_FIELD
private static final String SAMPLE_INIT
private static final String SAMPLE_INIT2
| Constructor Detail |
public TestMjcParser(String name)
public TestMjcParser(String name,
ModifierUtility modUtil)
| Method Detail |
public void testClassDeclParsing()
throws antlr.RecognitionException,
antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public void testClassDeclJavadocParsing1()
throws antlr.RecognitionException,
antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public void testClassDeclJavadocParsing2()
throws antlr.RecognitionException,
antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public void testClassDeclJavadocParsing3()
throws antlr.RecognitionException,
antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public void testClassDeclJavadocParsing4()
throws antlr.RecognitionException,
antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public void testClassDeclJavadocParsing5()
throws antlr.RecognitionException,
antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public void testInterfaceDeclJavadocParsing1()
throws antlr.RecognitionException,
antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public void testAugmentingMethodDeclJavadocParsing1()
throws antlr.RecognitionException,
antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public void testInnerClassJavadocParsing1()
throws antlr.RecognitionException,
antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public void testMethodJavadocParsing1()
throws antlr.RecognitionException,
antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public void testFieldJavadocParsing1()
throws antlr.RecognitionException,
antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public void testInitializerJavadocParsing1()
throws antlr.RecognitionException,
antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public void test_ignore_misplaced_javadoc_parsing1()
throws antlr.RecognitionException,
antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public void test_ignore_misplaced_javadoc_parsing2()
throws antlr.RecognitionException,
antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public void test_ignore_misplaced_javadoc_parsing3()
throws antlr.RecognitionException,
antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public void test_ignore_misplaced_javadoc_parsing4()
throws antlr.RecognitionException,
antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public void test_ignore_misplaced_javadoc_parsing5()
throws antlr.RecognitionException,
antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public void test_ignore_misplaced_javadoc_parsing6()
throws antlr.RecognitionException,
antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public void test_ignore_misplaced_javadoc_parsing7()
throws antlr.RecognitionException,
antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public void test_ignore_misplaced_javadoc_parsing8()
throws antlr.RecognitionException,
antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public void test_ignore_misplaced_javadoc_parsing9()
throws antlr.RecognitionException,
antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public void test_ignore_misplaced_javadoc_parsing10()
throws antlr.RecognitionException,
antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public void test_ignore_misplaced_javadoc_parsing11()
throws antlr.RecognitionException,
antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public void test_ignore_misplaced_javadoc_parsing12()
throws antlr.RecognitionException,
antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public void test_ignore_misplaced_javadoc_parsing13()
throws antlr.RecognitionException,
antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public void test_initMods_1()
throws antlr.RecognitionException,
antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public void test_initMods_2()
throws antlr.RecognitionException,
antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public void test_initMods_3()
throws antlr.TokenStreamException
antlr.TokenStreamException
public void test_initMods_4()
throws antlr.RecognitionException,
antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public void test_comment_parsing_1()
throws antlr.RecognitionException,
antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public void test_comment_parsing_2()
throws antlr.RecognitionException,
antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamExceptionprotected void establishTest(String sourceCode)
protected void establishTest(String sourceCode,
boolean parseJavadocs)
protected JCompilationUnitType getAST(String sourceCode)
throws antlr.RecognitionException,
antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
protected JCompilationUnitType getAST(String sourceCode,
boolean parseJavadocs)
throws antlr.RecognitionException,
antlr.TokenStreamException
parseJavadocs flag is true, then
the AST is annotated with any javadocs that appear in the
string.
antlr.RecognitionException
antlr.TokenStreamException
|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||