aboutsummaryrefslogtreecommitdiff
path: root/Examples/test-suite/java/doxygen_parsing_runme.java
blob: d58b1f48681c83b6ecfd4ea6d0dc3ef96d3f83e8 (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

import doxygen_parsing.*;
import com.sun.javadoc.*;
import java.util.HashMap;

public class doxygen_parsing_runme {
  static {
    try {
      System.loadLibrary("doxygen_parsing");
    } 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_parsing runtime test",
                                       "CommentParser",
                                       new String[]{"-quiet", "doxygen_parsing"});

    HashMap<String, String> wantedComments = new HashMap<String, String>();
    
    wantedComments.put("doxygen_parsing.SomeAnotherClass",
    		" SomeAnotherClass description");
    wantedComments.put("doxygen_parsing.SomeAnotherClass(int)",
    		" First overloaded constructor.");
    wantedComments.put("doxygen_parsing.SomeAnotherClass(java.lang.String)",
    		" Second overloaded constructor.");
    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.<br>\n" +
                " <br>\n" +
                " {@link SomeAnotherClass#classMethodExtended(int,int) a link text  }\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" +
    		"");
    wantedComments.put("doxygen_parsing.doxygen_parsingConstants.CONSTANT_VALUE",
    		"The constant comment \n" +
    		"");
    
    // and ask the parser to check comments for us
    System.exit(parser.check(wantedComments));
  }
}