Enhanced and unified all java doxygen tests

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2012-doxygen@13345 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Dmitry Kabak 2012-07-23 11:23:47 +00:00
commit 4c293c8282
7 changed files with 333 additions and 60 deletions

View file

@ -25,14 +25,35 @@ public class doxygen_parsing_enums_proper_runme {
HashMap<String, String> wantedComments = new HashMap<String, String>();
wantedComments.put("SomeAnotherEnum", " Testing comments before enum items \n");
wantedComments.put("SOME_ITEM_1", " The comment for the first item \n");
wantedComments.put("SOME_ITEM_2", " The comment for the second item \n");
wantedComments.put("SOME_ITEM_3", " The comment for the third item \n");
wantedComments.put("SomeAnotherEnum2", " Testing comments after enum items \n");
wantedComments.put("SOME_ITEM_10", " Post comment for the first item \n");
wantedComments.put("SOME_ITEM_20", " Post comment for the second item \n");
wantedComments.put("SOME_ITEM_30", " Post comment for the third item \n");
wantedComments.put("doxygen_parsing_enums_proper.SomeAnotherEnum2.SOME_ITEM_10",
"Post comment for the first item \n" +
"");
wantedComments.put("doxygen_parsing_enums_proper.SomeAnotherEnum.SOME_ITEM_1",
" The comment for the first item \n" +
" \n" +
"");
wantedComments.put("doxygen_parsing_enums_proper.SomeAnotherEnum",
" Testing comments before enum items \n" +
" \n" +
"");
wantedComments.put("doxygen_parsing_enums_proper.SomeAnotherEnum2.SOME_ITEM_30",
"Post comment for the third item \n" +
"");
wantedComments.put("doxygen_parsing_enums_proper.SomeAnotherEnum2",
" Testing comments after enum items \n" +
" \n" +
"");
wantedComments.put("doxygen_parsing_enums_proper.SomeAnotherEnum.SOME_ITEM_3",
" The comment for the third item \n" +
" \n" +
"");
wantedComments.put("doxygen_parsing_enums_proper.SomeAnotherEnum.SOME_ITEM_2",
" The comment for the second item \n" +
" \n" +
"");
wantedComments.put("doxygen_parsing_enums_proper.SomeAnotherEnum2.SOME_ITEM_20",
"Post comment for the second item \n" +
"");
// and ask the parser to check comments for us
System.exit(parser.check(wantedComments));

View file

@ -25,12 +25,27 @@ public class doxygen_parsing_enums_simple_runme {
HashMap<String, String> wantedComments = new HashMap<String, String>();
wantedComments.put("SOME_ITEM_1", " The comment for the first item \n");
wantedComments.put("SOME_ITEM_2", " The comment for the second item \n");
wantedComments.put("SOME_ITEM_3", " The comment for the third item \n");
wantedComments.put("SOME_ITEM_10", " Post comment for the first item \n");
wantedComments.put("SOME_ITEM_20", " Post comment for the second item \n");
wantedComments.put("SOME_ITEM_30", " Post comment for the third item \n");
wantedComments.put("doxygen_parsing_enums_simple.doxygen_parsing_enums_simpleConstants.SOME_ITEM_30",
"Post comment for the third item \n" +
"");
wantedComments.put("doxygen_parsing_enums_simple.doxygen_parsing_enums_simpleConstants.SOME_ITEM_3",
" The comment for the third item \n" +
" \n" +
"");
wantedComments.put("doxygen_parsing_enums_simple.doxygen_parsing_enums_simpleConstants.SOME_ITEM_2",
" The comment for the second item \n" +
" \n" +
"");
wantedComments.put("doxygen_parsing_enums_simple.doxygen_parsing_enums_simpleConstants.SOME_ITEM_10",
"Post comment for the first item \n" +
"");
wantedComments.put("doxygen_parsing_enums_simple.doxygen_parsing_enums_simpleConstants.SOME_ITEM_20",
"Post comment for the second item \n" +
"");
wantedComments.put("doxygen_parsing_enums_simple.doxygen_parsing_enums_simpleConstants.SOME_ITEM_1",
" The comment for the first item \n" +
" \n" +
"");
// and ask the parser to check comments for us
System.exit(parser.check(wantedComments));

View file

@ -25,14 +25,36 @@ public class doxygen_parsing_enums_typesafe_runme {
HashMap<String, String> wantedComments = new HashMap<String, String>();
wantedComments.put("SomeAnotherEnum", " Testing comments before enum items \n");
wantedComments.put("SOME_ITEM_1", " The comment for the first item \n");
wantedComments.put("SOME_ITEM_2", " The comment for the second item \n");
wantedComments.put("SOME_ITEM_3", " The comment for the third item \n");
wantedComments.put("SomeAnotherEnum2", " Testing comments after enum items \n");
wantedComments.put("SOME_ITEM_10", " Post comment for the first item \n");
wantedComments.put("SOME_ITEM_20", " Post comment for the second item \n");
wantedComments.put("SOME_ITEM_30", " Post comment for the third item \n");
wantedComments.put("doxygen_parsing_enums_typesafe.SomeAnotherEnum.SOME_ITEM_1",
" The comment for the first item \n" +
" \n" +
"");
wantedComments.put("doxygen_parsing_enums_typesafe.SomeAnotherEnum2",
" Testing comments after enum items \n" +
" \n" +
"");
wantedComments.put("doxygen_parsing_enums_typesafe.SomeAnotherEnum.SOME_ITEM_2",
" The comment for the second item \n" +
" \n" +
"");
wantedComments.put("doxygen_parsing_enums_typesafe.SomeAnotherEnum2.SOME_ITEM_20",
"Post comment for the second item \n" +
"");
wantedComments.put("doxygen_parsing_enums_typesafe.SomeAnotherEnum",
" Testing comments before enum items \n" +
" \n" +
"");
wantedComments.put("doxygen_parsing_enums_typesafe.SomeAnotherEnum2.SOME_ITEM_10",
"Post comment for the first item \n" +
"");
wantedComments.put("doxygen_parsing_enums_typesafe.SomeAnotherEnum.SOME_ITEM_3",
" The comment for the third item \n" +
" \n" +
"");
wantedComments.put("doxygen_parsing_enums_typesafe.SomeAnotherEnum2.SOME_ITEM_30",
"Post comment for the third item \n" +
"");
// and ask the parser to check comments for us
System.exit(parser.check(wantedComments));

View file

@ -25,14 +25,35 @@ public class doxygen_parsing_enums_typeunsafe_runme {
HashMap<String, String> wantedComments = new HashMap<String, String>();
wantedComments.put("SomeAnotherEnum", " Testing comments before enum items \n");
wantedComments.put("SOME_ITEM_1", " The comment for the first item \n");
wantedComments.put("SOME_ITEM_2", " The comment for the second item \n");
wantedComments.put("SOME_ITEM_3", " The comment for the third item \n");
wantedComments.put("SomeAnotherEnum2", " Testing comments after enum items \n");
wantedComments.put("SOME_ITEM_10", " Post comment for the first item \n");
wantedComments.put("SOME_ITEM_20", " Post comment for the second item \n");
wantedComments.put("SOME_ITEM_30", " Post comment for the third item \n");
wantedComments.put("doxygen_parsing_enums_typeunsafe.SomeAnotherEnum.SOME_ITEM_2",
" The comment for the second item \n" +
" \n" +
"");
wantedComments.put("doxygen_parsing_enums_typeunsafe.SomeAnotherEnum.SOME_ITEM_3",
" The comment for the third item \n" +
" \n" +
"");
wantedComments.put("doxygen_parsing_enums_typeunsafe.SomeAnotherEnum.SOME_ITEM_1",
" The comment for the first item \n" +
" \n" +
"");
wantedComments.put("doxygen_parsing_enums_typeunsafe.SomeAnotherEnum2.SOME_ITEM_20",
"Post comment for the second item \n" +
"");
wantedComments.put("doxygen_parsing_enums_typeunsafe.SomeAnotherEnum",
" Testing comments before enum items \n" +
" \n" +
"");
wantedComments.put("doxygen_parsing_enums_typeunsafe.SomeAnotherEnum2",
" Testing comments after enum items \n" +
" \n" +
"");
wantedComments.put("doxygen_parsing_enums_typeunsafe.SomeAnotherEnum2.SOME_ITEM_30",
"Post comment for the third item \n" +
"");
wantedComments.put("doxygen_parsing_enums_typeunsafe.SomeAnotherEnum2.SOME_ITEM_10",
"Post comment for the first item \n" +
"");
// and ask the parser to check comments for us
System.exit(parser.check(wantedComments));

View file

@ -25,31 +25,105 @@ public class doxygen_parsing_runme {
HashMap<String, String> wantedComments = new HashMap<String, String>();
wantedComments.put("someFunction", " The function comment \n");
wantedComments.put("SomeEnum", " The enum comment \n");
wantedComments.put("setSomeVar", " The var comment \n");
wantedComments.put("getSomeVar", " The var comment \n");
wantedComments.put("SomeClass", " The class comment \n");
wantedComments.put("setClassAttr", " The class attribute comment \n");
wantedComments.put("getClassAttr", " The class attribute comment \n");
wantedComments.put("setClassAttr2", " The class attribute post-comment \n");
wantedComments.put("getClassAttr2", " The class attribute post-comment \n");
wantedComments.put("setClassAttr3", " The class attribute post-comment with details \n");
wantedComments.put("getClassAttr3", " The class attribute post-comment with details \n");
wantedComments.put("classMethod", " The class method comment \n");
wantedComments.put("classMethodExtended", " The class method with parameter \n @param a Parameter a \n @param b Parameter b \n");
wantedComments.put("classMethodExtended2", " The class method with parameter \n @param a Parameter a \n @param b Parameter b \n");
wantedComments.put("SomeStruct", " The struct comment \n");
wantedComments.put("setStructAttr", " The struct attribute comment \n");
wantedComments.put("getStructAttr", " The struct attribute comment \n");
wantedComments.put("setStructAttr2", " The struct attribute post-comment \n");
wantedComments.put("getStructAttr2", " The struct attribute post-comment \n");
wantedComments.put("setStructAttr3", " The struct attribute post-comment with details \n");
wantedComments.put("getStructAttr3", " The struct attribute post-comment with details \n");
wantedComments.put("structMethod", " The struct method comment \n");
wantedComments.put("structMethodExtended", " The struct method with parameter \n @param a Parameter a \n @param b Parameter b \n");
wantedComments.put("structMethodExtended2", " The struct method with parameter \n @param a Parameter a \n @param b Parameter b \n");
wantedComments.put("doxygen_parsing.SomeAnotherClass.getClassAttr()",
" The class attribute comment \n" +
" \n" +
"");
wantedComments.put("doxygen_parsing.SomeAnotherClass.setClassAttr3(int)",
"The class attribute post-comment with details \n" +
"");
wantedComments.put("doxygen_parsing.SomeAnotherStruct.setStructAttr3(int)",
"The struct attribute post-comment with details \n" +
"");
wantedComments.put("doxygen_parsing.SomeAnotherClass.classMethodExtended2(int, int)",
" The class method with parameter \n" +
" \n" +
" @param a Parameter a \n" +
" @param b Parameter b \n" +
" \n" +
"");
wantedComments.put("doxygen_parsing.SomeStruct",
" The struct comment \n" +
" \n" +
"");
wantedComments.put("doxygen_parsing.doxygen_parsing.setSomeVar(int)",
" The var comment \n" +
" \n" +
"");
wantedComments.put("doxygen_parsing.SomeAnotherStruct.structMethod()",
" The struct method comment \n" +
" \n" +
"");
wantedComments.put("doxygen_parsing.doxygen_parsing.someFunction()",
" The function comment \n" +
" \n" +
"");
wantedComments.put("doxygen_parsing.SomeAnotherClass.classMethodExtended(int, int)",
" The class method with parameter \n" +
" \n" +
" @param a Parameter a \n" +
" @param b Parameter b \n" +
"");
wantedComments.put("doxygen_parsing.SomeAnotherClass.setClassAttr(int)",
" The class attribute comment \n" +
" \n" +
"");
wantedComments.put("doxygen_parsing.SomeAnotherStruct.structMethodExtended(int, int)",
" The struct method with parameter \n" +
" \n" +
" @param a Parameter a \n" +
" @param b Parameter b \n" +
"");
wantedComments.put("doxygen_parsing.SomeAnotherStruct.getStructAttr()",
" The struct attribute comment \n" +
" \n" +
"");
wantedComments.put("doxygen_parsing.SomeClass",
" The class comment \n" +
" \n" +
"");
wantedComments.put("doxygen_parsing.SomeAnotherStruct.getStructAttr3()",
"The struct attribute post-comment with details \n" +
"");
wantedComments.put("doxygen_parsing.doxygen_parsing.getSomeVar()",
" The var comment \n" +
" \n" +
"");
wantedComments.put("doxygen_parsing.SomeAnotherStruct.setStructAttr2(int)",
"The struct attribute post-comment \n" +
"");
wantedComments.put("doxygen_parsing.SomeAnotherClass.getClassAttr2()",
"The class attribute post-comment \n" +
"");
wantedComments.put("doxygen_parsing.SomeAnotherStruct.getStructAttr2()",
"The struct attribute post-comment \n" +
"");
wantedComments.put("doxygen_parsing.SomeAnotherStruct.setStructAttr(int)",
" The struct attribute comment \n" +
" \n" +
"");
wantedComments.put("doxygen_parsing.SomeEnum",
" The enum comment \n" +
" \n" +
"");
wantedComments.put("doxygen_parsing.SomeAnotherClass.getClassAttr3()",
"The class attribute post-comment with details \n" +
"");
wantedComments.put("doxygen_parsing.SomeAnotherClass.classMethod()",
" The class method comment \n" +
" \n" +
"");
wantedComments.put("doxygen_parsing.SomeAnotherStruct.structMethodExtended2(int, int)",
" The struct method with parameter \n" +
" \n" +
" @param a Parameter a \n" +
" @param b Parameter b \n" +
" \n" +
"");
wantedComments.put("doxygen_parsing.SomeAnotherClass.setClassAttr2(int)",
"The class attribute post-comment \n" +
"");
// and ask the parser to check comments for us
System.exit(parser.check(wantedComments));
}

View file

@ -0,0 +1,120 @@
import doxygen_translate_all_tags.*;
import com.sun.javadoc.*;
import java.util.HashMap;
public class doxygen_translate_all_tags_runme {
static {
try {
System.loadLibrary("doxygen_translate_all_tags");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + e);
System.exit(1);
}
}
public static void main(String argv[])
{
/*
Here we are using internal javadoc tool, it accepts the name of the class as paramterer,
and calls the start() method of that class with parsed information.
*/
commentParser parser = new commentParser();
com.sun.tools.javadoc.Main.execute("doxygen_translate_all_tags runtime test",
"commentParser", new String[]{"-quiet", "doxygen_translate_all_tags"});
HashMap<String, String> wantedComments = new HashMap<String, String>();
wantedComments.put("doxygen_translate_all_tags.doxygen_translate_all_tags.function(int, float)",
" <i>Hello </i>\n" +
" <li>some list item \n" +
" </li>This is attention! \n" +
" You were warned! \n" +
" @author lots of them \n" +
" @author Zubr \n" +
" <b>boldword </b>\n" +
" Some brief description, \n" +
" extended to many lines. \n" +
" Not everything works right now... \n" +
" <code>codeword </code>\n" +
" <i>citationword </i>\n" +
" {@code some test code }\n" +
" Conditional comment: SOMECONDITION \n" +
" Some conditional comment \n" +
" End of conditional comment.\n" +
" Copyright: some copyright \n" +
" 1970 - 2012 \n" +
" @deprecated Now use another function \n" +
" This is very large \n" +
" and detailed description of some thing \n" +
" <i>italicword </i>\n" +
" <i>emphazedWord </i>\n" +
" @exception SuperError \n" +
" This will only appear in hmtl \n" +
" If: ANOTHERCONDITION {\n" +
" First part of comment \n" +
" If: SECONDCONDITION {\n" +
" Nested condition text \n" +
" }Else if: THIRDCONDITION {\n" +
" The third condition text \n" +
" }Else: {The last text block \n" +
" }\n" +
" }Else: {Second part of comment \n" +
" If: CONDITION {\n" +
" Second part extended \n" +
" }\n" +
" }\n" +
" If not: SOMECONDITION {\n" +
" This is printed if not \n" +
" }\n" +
" <img src=testImage.bmp alt=\"Hello, world!\" />\n" +
" Some text \n" +
" describing invariant. \n" +
" This will only appear in LATeX \n" +
" <ul> \n" +
" <li>Some unordered list \n" +
" </li><li>With lots of items \n" +
" </li><li>lots of lots of items \n" +
" </li></ul> \n" +
" {@link someMember Some description follows }\n" +
" This will only appear in man \n" +
" Note: Here \n" +
" is the note! \n" +
" This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.\n" +
" <code>someword </code>\n" +
" @package superPackage \n" +
" <p alt=\"The paragraph title \">\n" +
" The paragraph text. \n" +
" Maybe even multiline \n" +
" </p>\n" +
" @param a the first param \n" +
" Remarks: Some remark text \n" +
" Remarks: Another remarks section \n" +
" @return Whatever \n" +
" @return it \n" +
" @return may return \n" +
" This will only appear in RTF \n" +
" @see someOtherMethod \n" +
" @see function \n" +
" Same as \n" +
" brief description \n" +
" @since version 0.0.0.1 \n" +
" @throws superException \n" +
" @throws RuntimeError \n" +
" TODO: Some very important task \n" +
" @param b B is mentioned again... \n" +
" {@literal \n" +
"very long \n" +
"text with tags <sometag> \n" +
" }\n" +
" @version 0.0.0.2 \n" +
" Warning: This is senseless! \n" +
" This will only appear in XML \n" +
" Here goes test of symbols: \n" +
" $ @ \\ & ~ < > # % \" . :: \n" +
" And here goes simple text \n" +
"");
// and ask the parser to check comments for us
System.exit(parser.check(wantedComments));
}
}

View file

@ -25,7 +25,8 @@ public class doxygen_translate_runme {
HashMap<String, String> wantedComments = new HashMap<String, String>();
wantedComments.put("function", " <i>Hello </i>\n" +
wantedComments.put("doxygen_translate.doxygen_translate.function(int, float)",
" <i>Hello </i>\n" +
" \n" +
" <li>some list item \n" +
" \n" +
@ -91,8 +92,7 @@ public class doxygen_translate_runme {
" Note: Here \n" +
" is the note! \n" +
" \n" +
" This is an overloaded member function, provided for convenience. \n" +
" It differs from the above function only in what argument(s) it accepts.\n" +
" This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.\n" +
" \n" +
" <code>someword </code>\n" +
" \n" +
@ -141,8 +141,8 @@ public class doxygen_translate_runme {
" $ @ \\ & ~ < > # % \" . :: \n" +
" \n" +
" And here goes simple text \n" +
" \n");
" \n" +
"");
// and ask the parser to check comments for us
System.exit(parser.check(wantedComments));
}