Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
JENKINS-21377 add test
  • Loading branch information
codesimplicity committed Jan 17, 2014
1 parent d47a3ad commit e8d420a8e8802579139ecdc44317900f21481b68
Showing with 31 additions and 1 deletion.
  1. +25 −1 src/test/java/hudson/plugins/warnings/parser/EclipseParserTest.java
  2. +6 −0 src/test/resources/hudson/plugins/warnings/parser/issue21377.txt
@@ -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 {
@@ -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 e8d420a

Please sign in to comment.