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

Commit

Permalink
JENKINS-21377 add test
Browse files Browse the repository at this point in the history
  • Loading branch information
codesimplicity committed Jan 17, 2014
1 parent d47a3ad commit e8d420a
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
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 e8d420a

Please sign in to comment.