summaryrefslogtreecommitdiff
path: root/Examples/test-suite/java/doxygen_translate_all_tags_runme.java
blob: d5c533f4e68c2dab85eb4376a315c330815cd041 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159

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.func01(int)",
    		" <i>Hello </i>\n\n\n" +
                " <a id=\"theAnchor\"></a>\n\n\n" +
    		" <li>some list item</li>\n\n" +
    		" This is attention!\n" +
    		" You were warned!\n" +
    		" @author lots of them\n" +
    		" @author Zubr\n\n" +
    		" <b>boldword</b>\n\n" +
    		" Some brief description,\n" +
    		" extended to many lines.\n\n" +
    		" Not everything works right now...\n" +
    		" <code>codeword</code>\n\n\n\n\n\n" +
    		" <i>citationword</i>\n" +
                " {@code some test code }\n\n" +
    		" Code immediately following text.  Pydoc translation must add an\n" +
    		" empty line before:\n" +
    		" {@code more test code }");
    
    wantedComments.put("doxygen_translate_all_tags.doxygen_translate_all_tags.func02(int)",
    		" 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");
    
    wantedComments.put("doxygen_translate_all_tags.doxygen_translate_all_tags.func03(int)",
                       " Comment for <b>func03()</b>.\n" +
                       " <i>italicword </i>\n" +
    		" <i>emphazedWord </i>\n" +
                " @ example someFile.txt\n" +
                " Some details on using the example");
    
    wantedComments.put("doxygen_translate_all_tags.doxygen_translate_all_tags.func04(int)",
                       " @exception SuperError \n" +
                       " \\sqrt{(x_2-x_1)^2+(y_2-y_1)^2} \n" +
                       " \\sqrt{(x_2-x_1)^2+(y_2-y_1)^2} \n" +
                       " \\sqrt{(x_2-x_1)^2+(y_2-y_1)^2} \n\n" +
                       "Math immediately following text.  Pydoc translation must add an\n" +
                       "empty line before:\n\n" +
                       " \\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}\n" +
                       " This will only appear in hmtl \n");
    
    wantedComments.put("doxygen_translate_all_tags.doxygen_translate_all_tags.func05(int)",
                       " 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");
    
    wantedComments.put("doxygen_translate_all_tags.doxygen_translate_all_tags.func06(int)",
                       " Comment for <b>func06()</b>.\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");
    
    wantedComments.put("doxygen_translate_all_tags.doxygen_translate_all_tags.func07(int)",
                       " Comment for <b>func07()</b>.\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");
    
    wantedComments.put("doxygen_translate_all_tags.doxygen_translate_all_tags.func08(int)",
                       "<a id=\"someAnchor\"></a>\n" +
                       "Text after anchor.\n" + 
                       "<a href=\"#someAnchor\">Anchor description</a>\n" +
                       "<a href=\"#someAnchor\">someAnchor</a> not quoted text is not part of ref tag\n" +
                       "<a href=\"#someAnchor\">someAnchor</a>\n" +
                       " Remarks: Some remark text \n" +
                       " Remarks: Another remarks section \n" +
                       " @return Whatever \n" +
                       " @return it \n" +
                       " @return may return \n");
    
    wantedComments.put("doxygen_translate_all_tags.doxygen_translate_all_tags.func09(int)",
                       " 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");
    
    wantedComments.put("doxygen_translate_all_tags.doxygen_translate_all_tags.func10(int, float)",
                       " 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" +
    		" $ @ \\ &amp; ~ &lt; &gt; # % &quot; . :: \n" +
    		" And here goes simple text \n" +
    		"");
    // and ask the parser to check comments for us
    System.exit(parser.check(wantedComments));
  }
}