Lines 1-5
Link Here
|
1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
2 |
* Copyright (c) 2000, 2010 IBM Corporation and others. |
2 |
* Copyright (c) 2000, 2011 IBM Corporation and others. |
3 |
* All rights reserved. This program and the accompanying materials |
3 |
* All rights reserved. This program and the accompanying materials |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
5 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
Lines 43-49
Link Here
|
43 |
private static final String DEFAULT_DOC_FOLDER = "doc"; |
43 |
private static final String DEFAULT_DOC_FOLDER = "doc"; |
44 |
|
44 |
|
45 |
static { |
45 |
static { |
46 |
// TESTS_NAMES = new String[] { "test010" }; |
46 |
// TESTS_NAMES = new String[] { "testBug334652_4" }; |
47 |
// TESTS_NUMBERS = new int[] { 24 }; |
47 |
// TESTS_NUMBERS = new int[] { 24 }; |
48 |
// TESTS_RANGE = new int[] { 169, 180 }; |
48 |
// TESTS_RANGE = new int[] { 169, 180 }; |
49 |
} |
49 |
} |
Lines 783-786
Link Here
|
783 |
this.project.setOptions(options); |
783 |
this.project.setOptions(options); |
784 |
} |
784 |
} |
785 |
} |
785 |
} |
|
|
786 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=334652 |
787 |
public void testBug334652() throws CoreException, IOException { |
788 |
IClasspathEntry[] entries = this.project.getRawClasspath(); |
789 |
|
790 |
try { |
791 |
IClasspathAttribute attribute = |
792 |
JavaCore.newClasspathAttribute( |
793 |
IClasspathAttribute.JAVADOC_LOCATION_ATTRIBUTE_NAME, |
794 |
"jar:platform:/resource/AttachedJavadocProject/bug334652_doc.zip!/NoJavaDocForInnerClass/doc"); |
795 |
IClasspathEntry newEntry = JavaCore.newLibraryEntry(new Path("/AttachedJavadocProject/bug334652.jar"), null, null, null, new IClasspathAttribute[] { attribute}, false); |
796 |
this.project.setRawClasspath(new IClasspathEntry[]{newEntry}, null); |
797 |
this.project.getResolvedClasspath(false); |
798 |
|
799 |
IPackageFragmentRoot jarRoot = this.project.getPackageFragmentRoot(getFile("/AttachedJavadocProject/bug334652.jar")); |
800 |
final IType type = jarRoot.getPackageFragment("com.test").getClassFile("PublicAbstractClass$InnerFinalException.class").getType(); |
801 |
IMethod method = type.getMethod("InnerFinalException", new String[] { "Lcom.test.PublicAbstractClass;", "Ljava.lang.String;", "Ljava.lang.String;"}); |
802 |
assertNotNull(method); |
803 |
assertTrue("Does not exist", method.exists()); |
804 |
|
805 |
String javadoc = method.getAttachedJavadoc(null); |
806 |
assertNotNull(javadoc); |
807 |
assertEquals("Wrong contents", "<H3>\r\n" + |
808 |
"PublicAbstractClass.InnerFinalException</H3>\r\n" + |
809 |
"<PRE>\r\n" + |
810 |
"public <B>PublicAbstractClass.InnerFinalException</B>(java.lang.String property,\r\n" + |
811 |
" java.lang.String msg)</PRE>\r\n" + |
812 |
"<DL>\r\n" + |
813 |
"<DD>javadoc for InnerFinalException(String property, String msg)\r\n" + |
814 |
"<P>\r\n" + |
815 |
"<DL>\r\n" + |
816 |
"<DT><B>Parameters:</B><DD><CODE>property</CODE> - the property argument<DD><CODE>msg</CODE> - the message argument</DL>\r\n" + |
817 |
"</DL>\r\n", javadoc); |
818 |
} finally { |
819 |
this.project.setRawClasspath(entries, null); |
820 |
} |
821 |
} |
822 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=334652 |
823 |
public void testBug334652_2() throws CoreException, IOException { |
824 |
IClasspathEntry[] entries = this.project.getRawClasspath(); |
825 |
|
826 |
try { |
827 |
IClasspathAttribute attribute = |
828 |
JavaCore.newClasspathAttribute( |
829 |
IClasspathAttribute.JAVADOC_LOCATION_ATTRIBUTE_NAME, |
830 |
"jar:platform:/resource/AttachedJavadocProject/bug334652(2)_doc.zip!/doc"); |
831 |
IClasspathEntry newEntry = JavaCore.newLibraryEntry(new Path("/AttachedJavadocProject/bug334652(2).jar"), null, null, null, new IClasspathAttribute[] { attribute}, false); |
832 |
this.project.setRawClasspath(new IClasspathEntry[]{newEntry}, null); |
833 |
this.project.getResolvedClasspath(false); |
834 |
|
835 |
IPackageFragmentRoot jarRoot = this.project.getPackageFragmentRoot(getFile("/AttachedJavadocProject/bug334652(2).jar")); |
836 |
final IType type = jarRoot.getPackageFragment("com.test").getClassFile("PublicAbstractClass$InnerFinalException.class").getType(); |
837 |
IMethod method = type.getMethod("InnerFinalException", new String[] { "Ljava.lang.String;", "Ljava.lang.String;"}); |
838 |
assertNotNull(method); |
839 |
assertTrue("Does not exist", method.exists()); |
840 |
|
841 |
String javadoc = method.getAttachedJavadoc(null); |
842 |
assertNotNull(javadoc); |
843 |
assertEquals("Wrong contents", "<H3>\r\n" + |
844 |
"PublicAbstractClass.InnerFinalException</H3>\r\n" + |
845 |
"<PRE>\r\n" + |
846 |
"public <B>PublicAbstractClass.InnerFinalException</B>(java.lang.String property,\r\n" + |
847 |
" java.lang.String msg)</PRE>\r\n" + |
848 |
"<DL>\r\n" + |
849 |
"<DD>javadoc for InnerFinalException(String property, String msg)\r\n" + |
850 |
"<P>\r\n" + |
851 |
"<DL>\r\n" + |
852 |
"<DT><B>Parameters:</B><DD><CODE>property</CODE> - the property argument<DD><CODE>msg</CODE> - the message argument</DL>\r\n" + |
853 |
"</DL>\r\n", javadoc); |
854 |
} finally { |
855 |
this.project.setRawClasspath(entries, null); |
856 |
} |
857 |
} |
858 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=334652 |
859 |
public void testBug334652_3() throws CoreException, IOException { |
860 |
IClasspathEntry[] entries = this.project.getRawClasspath(); |
861 |
|
862 |
try { |
863 |
IClasspathAttribute attribute = |
864 |
JavaCore.newClasspathAttribute( |
865 |
IClasspathAttribute.JAVADOC_LOCATION_ATTRIBUTE_NAME, |
866 |
"jar:platform:/resource/AttachedJavadocProject/bug334652(3)_doc.zip!/doc"); |
867 |
IClasspathEntry newEntry = JavaCore.newLibraryEntry(new Path("/AttachedJavadocProject/bug334652(3).jar"), null, null, null, new IClasspathAttribute[] { attribute}, false); |
868 |
this.project.setRawClasspath(new IClasspathEntry[]{newEntry}, null); |
869 |
this.project.getResolvedClasspath(false); |
870 |
|
871 |
IPackageFragmentRoot jarRoot = this.project.getPackageFragmentRoot(getFile("/AttachedJavadocProject/bug334652(3).jar")); |
872 |
final IType type = jarRoot.getPackageFragment("com.test").getClassFile("PublicAbstractClass$A$InnerFinalException.class").getType(); |
873 |
IMethod method = type.getMethod("InnerFinalException", new String[] { "Lcom.test.PublicAbstractClass$A;", "Ljava.lang.String;", "Ljava.lang.String;"}); |
874 |
assertNotNull(method); |
875 |
assertTrue("Does not exist", method.exists()); |
876 |
|
877 |
String javadoc = method.getAttachedJavadoc(null); |
878 |
assertNotNull(javadoc); |
879 |
assertEquals("Wrong contents", |
880 |
"<H3>\r\n" + |
881 |
"PublicAbstractClass.A.InnerFinalException</H3>\r\n" + |
882 |
"<PRE>\r\n" + |
883 |
"public <B>PublicAbstractClass.A.InnerFinalException</B>(java.lang.String property,\r\n" + |
884 |
" java.lang.String msg)</PRE>\r\n" + |
885 |
"<DL>\r\n" + |
886 |
"<DD>javadoc for InnerFinalException(String property, String msg)\r\n" + |
887 |
"<P>\r\n" + |
888 |
"<DL>\r\n" + |
889 |
"<DT><B>Parameters:</B><DD><CODE>property</CODE> - the property argument<DD><CODE>msg</CODE> - the message argument</DL>\r\n" + |
890 |
"</DL>\r\n", javadoc); |
891 |
} finally { |
892 |
this.project.setRawClasspath(entries, null); |
893 |
} |
894 |
} |
895 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=334652 |
896 |
public void testBug334652_4() throws CoreException, IOException { |
897 |
IClasspathEntry[] entries = this.project.getRawClasspath(); |
898 |
|
899 |
try { |
900 |
IClasspathAttribute attribute = |
901 |
JavaCore.newClasspathAttribute( |
902 |
IClasspathAttribute.JAVADOC_LOCATION_ATTRIBUTE_NAME, |
903 |
"jar:platform:/resource/AttachedJavadocProject/bug334652(4)_doc.zip!/doc"); |
904 |
IClasspathEntry newEntry = JavaCore.newLibraryEntry(new Path("/AttachedJavadocProject/bug334652(4).jar"), null, null, null, new IClasspathAttribute[] { attribute}, false); |
905 |
this.project.setRawClasspath(new IClasspathEntry[]{newEntry}, null); |
906 |
this.project.getResolvedClasspath(false); |
907 |
|
908 |
IPackageFragmentRoot jarRoot = this.project.getPackageFragmentRoot(getFile("/AttachedJavadocProject/bug334652(4).jar")); |
909 |
final IType type = jarRoot.getPackageFragment("com.test").getClassFile("PublicAbstractClass$A$InnerFinalException.class").getType(); |
910 |
IMethod method = type.getMethod("InnerFinalException", new String[] { "Lcom.test.PublicAbstractClass$A;", "Ljava.lang.String;", "Ljava.lang.String;"}); |
911 |
assertNotNull(method); |
912 |
assertTrue("Does not exist", method.exists()); |
913 |
|
914 |
String javadoc = method.getAttachedJavadoc(null); |
915 |
assertNotNull(javadoc); |
916 |
assertEquals("Wrong contents", "<H3>\r\n" + |
917 |
"PublicAbstractClass.A.InnerFinalException</H3>\r\n" + |
918 |
"<PRE>\r\n" + |
919 |
"public <B>PublicAbstractClass.A.InnerFinalException</B>(java.lang.String property,\r\n" + |
920 |
" java.lang.String msg)</PRE>\r\n" + |
921 |
"<DL>\r\n" + |
922 |
"<DD>javadoc for InnerFinalException(String property, String msg)\r\n" + |
923 |
"<P>\r\n" + |
924 |
"<DL>\r\n" + |
925 |
"<DT><B>Parameters:</B><DD><CODE>property</CODE> - the property argument<DD><CODE>msg</CODE> - the message argument</DL>\r\n" + |
926 |
"</DL>\r\n", javadoc); |
927 |
} finally { |
928 |
this.project.setRawClasspath(entries, null); |
929 |
} |
930 |
} |
786 |
} |
931 |
} |