Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 27035 Details for
Bug 108622
[javadoc][dom] ASTNode not including javadoc
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Test case added to ASTConverterJavadocTest
v00-model.txt (text/plain), 4.48 KB, created by
Frederic Fusier
on 2005-09-12 12:59:32 EDT
(
hide
)
Description:
Test case added to ASTConverterJavadocTest
Filename:
MIME Type:
Creator:
Frederic Fusier
Created:
2005-09-12 12:59:32 EDT
Size:
4.48 KB
patch
obsolete
>Index: src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocTest.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocTest.java,v >retrieving revision 1.64 >diff -u -r1.64 ASTConverterJavadocTest.java >--- src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocTest.java 16 Aug 2005 10:55:53 -0000 1.64 >+++ src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocTest.java 12 Sep 2005 15:43:01 -0000 >@@ -113,7 +113,8 @@ > // Run test cases subset > COPY_DIR = false; > System.err.println("WARNING: only subset of tests will be executed!!!"); >- suite.addTest(new ASTConverterJavadocTest("testBug106581")); >+ suite.addTest(new ASTConverterJavadocTest("testBug84049")); >+ suite.addTest(new ASTConverterJavadocTest("testBug108622")); > return suite; > } > >@@ -2450,7 +2451,19 @@ > ASTNode node = getASTNode(compilUnit, 0, 0); > assertEquals("Invalid type for node: "+node, ASTNode.METHOD_DECLARATION, node.getNodeType()); > MethodDeclaration methodDeclaration = (MethodDeclaration) node; >- assertNull("MethodDeclaration should not have any javadoc comment", methodDeclaration.getJavadoc()); >+ Javadoc methodJavadoc = methodDeclaration.getJavadoc(); >+ assertNotNull("MethodDeclaration have a javadoc comment", methodJavadoc); >+ int javadocStart = methodJavadoc.getStartPosition(); >+ assertEquals("Method declaration should include javadoc comment", methodDeclaration.getStartPosition(), javadocStart); >+ /* TODO (frederic) Enable this block when bug will be fixed... >+ SimpleName methodName = methodDeclaration.getName(); >+ int nameStart = methodName.getStartPosition(); >+ assertTrue("Method simple name should not include javadoc comment", nameStart > javadocStart+methodJavadoc.getLength()); >+ int extendedStart = compilUnit.getExtendedStartPosition(methodName); >+ assertEquals("Method simple name start position should not be extended!", nameStart, extendedStart); >+ int extendedLength = compilUnit.getExtendedLength(methodName); >+ assertEquals("Method simple name length should not be extended!", methodName.getLength(), extendedLength); >+ */ > } > } > >@@ -3009,4 +3022,53 @@ > assertNotNull("We should have a type binding for simple name: "+simpleName, simpleName.resolveTypeBinding()); > } > } >+ >+ /** >+ * Bug 108622: [javadoc][dom] ASTNode not including javadoc >+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=108622" >+ */ >+ public void testBug108622() throws JavaModelException { >+ workingCopies = new ICompilationUnit[1]; >+ astLevel = AST.JLS3; >+ workingCopies[0] = getWorkingCopy("/Converter15/src/javadoc/b108622/Test.java", >+ "package javadoc.b108622;\n" + >+ "/**\n" + >+ " * \n" + >+ " */\n" + >+ "public abstract class Test {\n" + >+ "\n" + >+ " /**\n" + >+ " * \n" + >+ " */\n" + >+ " public abstract Zork getFoo();\n" + >+ "\n" + >+ " /**\n" + >+ " * \n" + >+ " */\n" + >+ " public abstract void setFoo(Zork dept);\n" + >+ "\n" + >+ "}" >+ ); >+ CompilationUnit compilUnit = (CompilationUnit) runConversion(workingCopies[0], true); >+ if (docCommentSupport.equals(JavaCore.ENABLED)) { >+ // Verify first method >+ ASTNode node = getASTNode(compilUnit, 0, 0); >+ assertEquals("Invalid type for node: "+node, ASTNode.METHOD_DECLARATION, node.getNodeType()); >+ MethodDeclaration methodDeclaration = (MethodDeclaration) node; >+ assertEquals("Invalid method name", "getFoo", methodDeclaration.getName().toString()); >+ Javadoc methodJavadoc = methodDeclaration.getJavadoc(); >+ assertNotNull("MethodDeclaration have a javadoc comment", methodJavadoc); >+ int javadocStart = methodJavadoc.getStartPosition(); >+ assertEquals("Method declaration should include javadoc comment", methodDeclaration.getStartPosition(), javadocStart); >+ // Verify second method >+ node = getASTNode(compilUnit, 0, 1); >+ assertEquals("Invalid type for node: "+node, ASTNode.METHOD_DECLARATION, node.getNodeType()); >+ methodDeclaration = (MethodDeclaration) node; >+ assertEquals("Invalid method name", "setFoo", methodDeclaration.getName().toString()); >+ methodJavadoc = methodDeclaration.getJavadoc(); >+ assertNotNull("MethodDeclaration have a javadoc comment", methodJavadoc); >+ javadocStart = methodJavadoc.getStartPosition(); >+ assertEquals("Method declaration should include javadoc comment", methodDeclaration.getStartPosition(), javadocStart); >+ } >+ } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 108622
:
27034
| 27035