Skip to content
This repository has been archived by the owner on Apr 6, 2022. It is now read-only.

Commit

Permalink
[FIXED JENKINS-6971] Added another unit test for Doxygen parser.
Browse files Browse the repository at this point in the history
  • Loading branch information
uhafner committed Nov 30, 2011
1 parent b06a055 commit 7a63d66
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
Expand Up @@ -10,6 +10,7 @@
* @author Johannes Utzig
*/
public class BuckminsterParser extends RegexpLineParser {
private static final String ERROR = "Error";
/** Warning type of this parser. */
static final String WARNING_TYPE = "Buckminster Compiler";
/** Pattern for buckminster compiler warnings. */
Expand All @@ -30,7 +31,7 @@ public BuckminsterParser() {
*/
@Override
protected Warning createWarning(final Matcher matcher) {
Priority priority = matcher.group(1).equalsIgnoreCase("Error") ? Priority.HIGH : Priority.NORMAL;
Priority priority = ERROR.equalsIgnoreCase(matcher.group(1)) ? Priority.HIGH : Priority.NORMAL;
return new Warning(matcher.group(2), getLineNumber(matcher.group(4)), WARNING_TYPE, classifyWarning(matcher.group(5)), matcher.group(5), priority);

}
Expand Down
Expand Up @@ -10,6 +10,7 @@
* @author Frederic Chateau
*/
public class Gcc4CompilerParser extends RegexpLineParser {
private static final String ERROR = "error";
/** A GCC error. */
static final String WARNING_CATEGORY = "GCC4 Error";
/** Warning type of this parser. */
Expand All @@ -32,7 +33,7 @@ protected Warning createWarning(final Matcher matcher) {
String message = matcher.group(4);
Priority priority;

if (matcher.group(3).equalsIgnoreCase("error")) {
if (ERROR.equalsIgnoreCase(matcher.group(3))) {
priority = Priority.HIGH;
}
else {
Expand Down
Expand Up @@ -160,7 +160,7 @@ public void issue7178() throws IOException {
}

/**
* Parses a warning log with 3 doxygen 1.7.1 messages.
* Parses a warning log with 4 doxygen 1.7.1 messages.
*
* @throws IOException
* if the file could not be read
Expand All @@ -170,7 +170,7 @@ public void issue7178() throws IOException {
public void issue6971() throws IOException {
Collection<FileAnnotation> warnings = new DoxygenParser().parse(openFile("issue6971.txt"));

assertEquals(WRONG_NUMBER_OF_WARNINGS_DETECTED, 3, warnings.size());
assertEquals(WRONG_NUMBER_OF_WARNINGS_DETECTED, 4, warnings.size());
Iterator<FileAnnotation> iterator = warnings.iterator();
checkWarning(iterator.next(),
479,
Expand All @@ -187,6 +187,11 @@ public void issue6971() throws IOException {
"Member getInternalParser() (function) of class XmlParser is not documented.",
".../XmlParser.h",
WARNING_TYPE, WARNING_CATEGORY, Priority.NORMAL);
checkWarning(iterator.next(),
39,
"Member XmlMemoryEntityMapEntry (typedef) of class XmlMemoryEntityResolver is not documented.",
"P:/Integration/DjRip/djrip/workspace/libraries/xml/XmlMemoryEntityResolver.h",
WARNING_TYPE, WARNING_CATEGORY, Priority.NORMAL);
}


Expand Down
Expand Up @@ -3,4 +3,6 @@

.../XmlParser.h:357: warning: Member getInternalParser() (function) of class XmlParser is not documented.

P:/Integration/DjRip/djrip/workspace/libraries/xml/XmlMemoryEntityResolver.h:39: warning: Member XmlMemoryEntityMapEntry (typedef) of class XmlMemoryEntityResolver is not documented.


0 comments on commit 7a63d66

Please sign in to comment.