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.
[FIXED JENKINS-11376] Don't show multiple warnings for duplicated block.
- Loading branch information
Showing
11 changed files
with
158 additions
and
31 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
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
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
29 changes: 29 additions & 0 deletions
29
src/main/resources/hudson/plugins/dry/DryTabDetail/dry-details.jelly
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,29 @@ | ||
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" | ||
xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" | ||
xmlns:i="jelly:fmt" xmlns:local="local" xmlns:u="/util"> | ||
<st:header name="Content-Type" value="text/html;charset=UTF-8" /> | ||
<j:forEach var="warning" items="${annotations.sortedAnnotations}"> | ||
<j:if test="${!warning.isDerived()}"> | ||
<table class="pane" id="details"> | ||
<tr> | ||
<td class="pane-header"> | ||
<u:sourceLink it="${it}" warning="${warning}" /> | ||
, | ||
${warning.type}, ${%Priority}: ${warning.priority.localizedString} | ||
<j:if test="${h.size2(warning.category) > 0}"> | ||
, ${%Category}: ${warning.category} | ||
</j:if> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td style="white-space: normal"> | ||
<p> | ||
<b>${warning.message}</b> | ||
</p> | ||
<p>${warning.toolTip}</p> | ||
</td> | ||
</tr> | ||
</table> | ||
</j:if> | ||
</j:forEach> | ||
</j:jelly> |
2 changes: 2 additions & 0 deletions
2
src/main/resources/hudson/plugins/dry/DryTabDetail/dry-details_de.properties
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,2 @@ | ||
Priority=Priorität | ||
Category=Kategorie |
2 changes: 2 additions & 0 deletions
2
src/main/resources/hudson/plugins/dry/DryTabDetail/dry-details_ja.properties
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,2 @@ | ||
Priority=\u91cd\u8981\u5ea6 | ||
Category=\u30ab\u30c6\u30b4\u30ea\u30fc |
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
30 changes: 30 additions & 0 deletions
30
src/test/java/hudson/plugins/dry/parser/AbstractDuplicationParserTest.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,30 @@ | ||
package hudson.plugins.dry.parser; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
import java.util.Collection; | ||
|
||
/** | ||
* Base class for duplication tests. | ||
* | ||
* @author Ulli Hafner | ||
*/ | ||
public class AbstractDuplicationParserTest { | ||
/** | ||
* Verifies that the number of derived duplications is correct. | ||
* | ||
* @param annotations | ||
* the annotations to check | ||
* @param expected | ||
* the expected number of derived duplications | ||
*/ | ||
protected void verifyDerivedDuplications(final Collection<DuplicateCode> annotations, final int expected) { | ||
int derivedCount = 0; | ||
for (DuplicateCode duplicateCode : annotations) { | ||
if (duplicateCode.isDerived()) { | ||
derivedCount++; | ||
} | ||
} | ||
assertEquals("Wrong number of derived duplications", expected, derivedCount); | ||
} | ||
} |
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