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

JENKINS-21377 adapt to tycho-compiler-jdt 0.19.0 #35

Merged
merged 2 commits into from Jan 17, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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)