|
Lines 85-90
Link Here
|
| 85 |
suite.addTest(new AttachedJavadocTests("testBug334652_2")); |
85 |
suite.addTest(new AttachedJavadocTests("testBug334652_2")); |
| 86 |
suite.addTest(new AttachedJavadocTests("testBug334652_3")); |
86 |
suite.addTest(new AttachedJavadocTests("testBug334652_3")); |
| 87 |
suite.addTest(new AttachedJavadocTests("testBug334652_4")); |
87 |
suite.addTest(new AttachedJavadocTests("testBug334652_4")); |
|
|
88 |
suite.addTest(new AttachedJavadocTests("testBug354766")); |
| 89 |
suite.addTest(new AttachedJavadocTests("testBug354766_2")); |
| 88 |
return suite; |
90 |
return suite; |
| 89 |
} |
91 |
} |
| 90 |
|
92 |
|
|
Lines 964-967
Link Here
|
| 964 |
this.project.setRawClasspath(entries, null); |
966 |
this.project.setRawClasspath(entries, null); |
| 965 |
} |
967 |
} |
| 966 |
} |
968 |
} |
|
|
969 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=354766 |
| 970 |
public void testBug354766() throws CoreException, IOException { |
| 971 |
IClasspathEntry[] entries = this.project.getRawClasspath(); |
| 972 |
|
| 973 |
try { |
| 974 |
IClasspathAttribute attribute = |
| 975 |
JavaCore.newClasspathAttribute( |
| 976 |
IClasspathAttribute.JAVADOC_LOCATION_ATTRIBUTE_NAME, |
| 977 |
"jar:platform:/resource/AttachedJavadocProject/bug354766_doc.zip!/"); |
| 978 |
IClasspathEntry newEntry = JavaCore.newLibraryEntry(new Path("/AttachedJavadocProject/bug354766.jar"), null, null, null, new IClasspathAttribute[] { attribute}, false); |
| 979 |
this.project.setRawClasspath(new IClasspathEntry[]{newEntry}, null); |
| 980 |
this.project.getResolvedClasspath(false); |
| 981 |
|
| 982 |
IPackageFragmentRoot jarRoot = this.project.getPackageFragmentRoot(getFile("/AttachedJavadocProject/bug354766.jar")); |
| 983 |
final IType type = jarRoot.getPackageFragment("com.test").getClassFile("PublicAbstractClass$InnerFinalException.class").getType(); |
| 984 |
IMethod method = type.getMethod("foo", new String[0]); |
| 985 |
assertNotNull(method); |
| 986 |
assertTrue("Does not exist", method.exists()); |
| 987 |
|
| 988 |
String javadoc = method.getAttachedJavadoc(null); |
| 989 |
assertNotNull(javadoc); |
| 990 |
assertEquals( |
| 991 |
"Wrong contents", |
| 992 |
"<H3>\r\n" + |
| 993 |
"foo</H3>\r\n" + |
| 994 |
"<PRE>\r\n" + |
| 995 |
"public void <B>foo</B>()</PRE>\r\n" + |
| 996 |
"<DL>\r\n" + |
| 997 |
"<DD>Test method\r\n" + |
| 998 |
"<P>\r\n" + |
| 999 |
"<DD><DL>\r\n" + |
| 1000 |
"</DL>\r\n" + |
| 1001 |
"</DD>\r\n" + |
| 1002 |
"</DL>\r\n", |
| 1003 |
javadoc); |
| 1004 |
} finally { |
| 1005 |
this.project.setRawClasspath(entries, null); |
| 1006 |
} |
| 1007 |
} |
| 1008 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=354766 |
| 1009 |
public void testBug354766_2() throws CoreException, IOException { |
| 1010 |
IClasspathEntry[] entries = this.project.getRawClasspath(); |
| 1011 |
|
| 1012 |
try { |
| 1013 |
IClasspathAttribute attribute = |
| 1014 |
JavaCore.newClasspathAttribute( |
| 1015 |
IClasspathAttribute.JAVADOC_LOCATION_ATTRIBUTE_NAME, |
| 1016 |
"jar:platform:/resource/AttachedJavadocProject/bug354766_doc.zip!/"); |
| 1017 |
IClasspathEntry newEntry = JavaCore.newLibraryEntry(new Path("/AttachedJavadocProject/bug354766.jar"), null, null, null, new IClasspathAttribute[] { attribute}, false); |
| 1018 |
this.project.setRawClasspath(new IClasspathEntry[]{newEntry}, null); |
| 1019 |
this.project.getResolvedClasspath(false); |
| 1020 |
|
| 1021 |
IPackageFragmentRoot jarRoot = this.project.getPackageFragmentRoot(getFile("/AttachedJavadocProject/bug354766.jar")); |
| 1022 |
final IType type = jarRoot.getPackageFragment("com.test").getClassFile("PublicAbstractClass$InnerFinalException.class").getType(); |
| 1023 |
IMethod method = type.getMethod("InnerFinalException", new String[] { "Lcom.test.PublicAbstractClass;"}); |
| 1024 |
assertNotNull(method); |
| 1025 |
assertTrue("Does not exist", method.exists()); |
| 1026 |
|
| 1027 |
String javadoc = method.getAttachedJavadoc(null); |
| 1028 |
assertNotNull(javadoc); |
| 1029 |
assertEquals( |
| 1030 |
"Wrong contents", |
| 1031 |
"<H3>\r\n" + |
| 1032 |
"PublicAbstractClass.InnerFinalException</H3>\r\n" + |
| 1033 |
"<PRE>\r\n" + |
| 1034 |
"public <B>PublicAbstractClass.InnerFinalException</B>()</PRE>\r\n" + |
| 1035 |
"<DL>\r\n" + |
| 1036 |
"<DD>javadoc for InnerFinalException()\r\n" + |
| 1037 |
"<P>\r\n" + |
| 1038 |
"</DL>\r\n" + |
| 1039 |
"\r\n" + |
| 1040 |
"<!-- ============ METHOD DETAIL ========== -->\r\n" + |
| 1041 |
"\r\n", |
| 1042 |
javadoc); |
| 1043 |
} finally { |
| 1044 |
this.project.setRawClasspath(entries, null); |
| 1045 |
} |
| 1046 |
} |
| 967 |
} |
1047 |
} |