This repository has been archived by the owner on Apr 6, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[JENKINS-13969] Update of regexp to support Eclipse 3.8 warnings.
- Loading branch information
Showing
5 changed files
with
126 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
src/test/java/hudson/plugins/warnings/parser/AbstractEclipseParserTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
package hudson.plugins.warnings.parser; | ||
|
||
import static junit.framework.Assert.*; | ||
import hudson.plugins.analysis.util.model.FileAnnotation; | ||
import hudson.plugins.analysis.util.model.Priority; | ||
|
||
import java.io.IOException; | ||
import java.util.Collection; | ||
import java.util.Iterator; | ||
|
||
import org.junit.Test; | ||
|
||
/** | ||
* Basic tests for the Eclipse parser. | ||
* | ||
* @author Ulli Hafner | ||
*/ | ||
public abstract class AbstractEclipseParserTest extends ParserTester { | ||
/** | ||
* Creates the parser under test. | ||
* | ||
* @return the created parser | ||
*/ | ||
protected AbstractWarningsParser createParser() { | ||
return new EclipseParser(); | ||
} | ||
|
||
/** | ||
* Returns the type of the parser. | ||
* | ||
* @return the type of the parser | ||
*/ | ||
protected String getType() { | ||
return new EclipseParser().getGroup(); | ||
} | ||
|
||
@Override | ||
protected String getWarningsFile() { | ||
return "eclipse.txt"; | ||
} | ||
|
||
/** | ||
* Parses a file with two deprecation warnings. | ||
* | ||
* @throws IOException | ||
* if the file could not be read | ||
*/ | ||
@Test | ||
public void parseDeprecation() throws IOException { | ||
Collection<FileAnnotation> warnings = createParser().parse(openFile()); | ||
|
||
assertEquals(WRONG_NUMBER_OF_WARNINGS_DETECTED, 8, warnings.size()); | ||
|
||
Iterator<FileAnnotation> iterator = warnings.iterator(); | ||
FileAnnotation annotation = iterator.next(); | ||
checkWarning(annotation, | ||
3, | ||
"The serializable class AttributeException does not declare a static final serialVersionUID field of type long", | ||
"C:/Desenvolvimento/Java/jfg/src/jfg/AttributeException.java", | ||
getType(), "", Priority.NORMAL); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/test/resources/hudson/plugins/warnings/parser/issue13969.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[INFO] Compiling 5 source files to /media/ssd/multi-x-processor/workspace/msgPM_Access/com.faktorzehn.pa2msgpm.core/target/classes | ||
[WARNING] /media/ssd/multi-x-processor/workspace/msgPM_Access/com.faktorzehn.pa2msgpm.core/src/com/faktorzehn/pa2msgpm/core/loader/PmModelImporter.java:[369,0] | ||
private boolean compare(List<String> rowTableValues, List<String> allowedValues) { | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
The method compare(List<String>, List<String>) from the type PmModelImporter is never used locally | ||
[WARNING] /media/ssd/multi-x-processor/workspace/msgPM_Access/com.faktorzehn.pa2msgpm.core/src/com/faktorzehn/pa2msgpm/core/loader/PmModelImporter.java:[391,0] | ||
private List<String> getTableValues(PropertyRestrictionType restrictionType) { | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
The method getTableValues(PropertyRestrictionType) from the type PmModelImporter is never used locally | ||
2 problems (2 warnings) | ||
|
||
|
||
[WARNING] /media/ssd/multi-x-processor/workspace/msgPM_Access/com.faktorzehn.pa2msgpm.core.test/src/com/faktorzehn/pa2msgpm/core/importer/PropertyImporterTest.java:[56,0] | ||
private static final OperationResponseType ERROR_RESPONSE = new OperationResponseType(1, "ERROR"); | ||
^^^^^^^^^^^^^^ | ||
The value of the field PropertyImporterTest.ERROR_RESPONSE is not used | ||
1 problem (1 warning) |