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

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #35 from codesimplicity/JENKINS-21377
[FIXED JENKINS-21377] Update of regexp for tycho-compiler-jdt 0.19.0
  • Loading branch information
uhafner committed Jan 17, 2014
2 parents f0bfddd + e8d420a commit 5e1fc87
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
Expand Up @@ -16,7 +16,7 @@
@Extension
public class EclipseParser extends RegexpDocumentParser {
private static final long serialVersionUID = 425883472788422955L;
private static final String ANT_ECLIPSE_WARNING_PATTERN = "\\[?(WARNING|ERROR)\\]?\\s*(?:in)?\\s*(.*)(?:\\(at line\\s*(\\d+)\\)|:\\[(\\d+),).*(?:\\r?\\n[^\\^]*)+(?:\\r?\\n(.*)([\\^]+).*)\\r?\\n(?:\\s*\\[.*\\]\\s*)?(.*)";
private static final String ANT_ECLIPSE_WARNING_PATTERN = "\\[?(WARNING|ERROR)\\]?\\s*(?:in)?\\s*(.*)(?:\\(at line\\s*(\\d+)\\)|:\\[(\\d+)).*(?:\\r?\\n[^\\^]*)+(?:\\r?\\n(.*)([\\^]+).*)\\r?\\n(?:\\s*\\[.*\\]\\s*)?(.*)";

/**
* Creates a new instance of {@link EclipseParser}.
Expand Down
Expand Up @@ -20,12 +20,36 @@
* Tests the class {@link EclipseParser}.
*/
public class EclipseParserTest extends AbstractEclipseParserTest {
/**
* Parses a warning log with previously undetected warnings.
*
* @throws IOException
* if the file could not be read
* @see <a href="http://issues.jenkins-ci.org/browse/JENKINS-21377">Issue 21377</a>
*/
@Test
public void issue21377() throws IOException {
Collection<FileAnnotation> warnings = createParser().parse(openFile("issue21377.txt"));

assertEquals(WRONG_NUMBER_OF_WARNINGS_DETECTED, 1, warnings.size());

ParserResult result = new ParserResult(warnings);
assertEquals(WRONG_NUMBER_OF_WARNINGS_DETECTED, 1, result.getNumberOfAnnotations());

Iterator<FileAnnotation> iterator = warnings.iterator();
checkWarning(iterator.next(),
13,
"The method getOldValue() from the type SomeType is deprecated",
"/path/to/job/job-name/module/src/main/java/com/example/Example.java",
getType(), "", Priority.NORMAL);
}

/**
* Parses a warning log with 2 previously undetected warnings.
*
* @throws IOException
* if the file could not be read
* @see <a href="http://issues.jenkins-ci.org/browse/JENKINS-13696">Issue 13696</a>
* @see <a href="http://issues.jenkins-ci.org/browse/JENKINS-13969">Issue 13969</a>
*/
@Test
public void issue13969() throws IOException {
Expand Down
@@ -0,0 +1,6 @@
[INFO] Compiling 5 source files to /path/to/job/job-name/module/target/classes
[WARNING] /path/to/job/job-name/module/src/main/java/com/example/Example.java:[13]
something.getOldValue();
^^^^^^^^^^^^^
The method getOldValue() from the type SomeType is deprecated
1 problem (1 warning)

0 comments on commit 5e1fc87

Please sign in to comment.