Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
[FIXED JENKINS-38557] Don' use an empty category or type anymore.
  • Loading branch information
uhafner committed Jan 4, 2017
1 parent 5e3f481 commit ec25a5f01a868eef89f43094d69578b50c69400e
Showing with 177 additions and 114 deletions.
  1. +1 −1 pom.xml
  2. +3 −3 src/test/java/hudson/plugins/warnings/parser/AbstractEclipseParserTest.java
  3. +6 −7 src/test/java/hudson/plugins/warnings/parser/AcuCobolParserTest.java
  4. +7 −7 src/test/java/hudson/plugins/warnings/parser/AjcParserTest.java
  5. +1 −1 src/test/java/hudson/plugins/warnings/parser/AntJavacParserTest.java
  6. +3 −4 src/test/java/hudson/plugins/warnings/parser/Armcc5CompilerParserTest.java
  7. +3 −4 src/test/java/hudson/plugins/warnings/parser/ArmccCompilerParserTest.java
  8. +6 −5 src/test/java/hudson/plugins/warnings/parser/BuckminsterParserTest.java
  9. +4 −5 src/test/java/hudson/plugins/warnings/parser/ClangParserTest.java
  10. +3 −3 src/test/java/hudson/plugins/warnings/parser/CoolfluxChessccParserTest.java
  11. +3 −4 src/test/java/hudson/plugins/warnings/parser/DoxygenParserTest.java
  12. +11 −9 src/test/java/hudson/plugins/warnings/parser/EclipseParserTest.java
  13. +8 −7 src/test/java/hudson/plugins/warnings/parser/FlexSDKParserTest.java
  14. +10 −9 src/test/java/hudson/plugins/warnings/parser/GoLintParserTest.java
  15. +4 −4 src/test/java/hudson/plugins/warnings/parser/GoVetParserTest.java
  16. +16 −16 src/test/java/hudson/plugins/warnings/parser/JavaDocParserTest.java
  17. +2 −2 src/test/java/hudson/plugins/warnings/parser/JavacParserTest.java
  18. +42 −5 src/test/java/hudson/plugins/warnings/parser/ParserRegistryIntegrationTest.java
  19. +2 −0 src/test/java/hudson/plugins/warnings/parser/ParserTester.java
  20. +3 −3 src/test/java/hudson/plugins/warnings/parser/SbtScalacParserTest.java
  21. +5 −4 src/test/java/hudson/plugins/warnings/parser/SunCParserTest.java
  22. +11 −10 src/test/java/hudson/plugins/warnings/parser/TiCcsParserTest.java
  23. +22 −0 src/test/resources/hudson/plugins/warnings/parser/issue38557.txt
  24. +1 −1 warnings.iml
@@ -44,7 +44,7 @@
<dependency>
<groupId>org.jvnet.hudson.plugins</groupId>
<artifactId>analysis-core</artifactId>
<version>1.80</version>
<version>1.82-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
@@ -1,13 +1,13 @@
package hudson.plugins.warnings.parser;

import static org.junit.Assert.*;

import java.io.IOException;
import java.util.Collection;
import java.util.Iterator;

import org.junit.Test;

import static org.junit.Assert.*;

import hudson.plugins.analysis.util.model.FileAnnotation;
import hudson.plugins.analysis.util.model.Priority;

@@ -58,6 +58,6 @@ public void parseDeprecation() throws IOException {
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);
getType(), DEFAULT_CATEGORY, Priority.NORMAL);
}
}
@@ -1,14 +1,13 @@
package hudson.plugins.warnings.parser;

import static org.junit.Assert.*;

import java.io.IOException;
import java.util.Collection;
import java.util.Iterator;

import org.apache.commons.lang.StringUtils;
import org.junit.Test;

import static org.junit.Assert.*;

import hudson.plugins.analysis.util.model.FileAnnotation;
import hudson.plugins.analysis.util.model.Priority;

@@ -36,25 +35,25 @@ public void parseFile() throws IOException {
39,
"Imperative statement required",
"COPY/zzz.CPY",
TYPE, StringUtils.EMPTY, Priority.NORMAL);
TYPE, DEFAULT_CATEGORY, Priority.NORMAL);
annotation = iterator.next();
checkWarning(annotation,
111,
"Don't run with knives",
"C:/Documents and Settings/xxxx/COB/bbb.COB",
TYPE, StringUtils.EMPTY, Priority.NORMAL);
TYPE, DEFAULT_CATEGORY, Priority.NORMAL);
annotation = iterator.next();
checkWarning(annotation,
115,
"Don't run with knives",
"C:/Documents and Settings/xxxx/COB/bbb.COB",
TYPE, StringUtils.EMPTY, Priority.NORMAL);
TYPE, DEFAULT_CATEGORY, Priority.NORMAL);
annotation = iterator.next();
checkWarning(annotation,
123,
"I'm a green banana",
"C:/Documents and Settings/xxxx/COB/ccc.COB",
TYPE, StringUtils.EMPTY, Priority.NORMAL);
TYPE, DEFAULT_CATEGORY, Priority.NORMAL);
}

@Override
@@ -1,16 +1,16 @@
package hudson.plugins.warnings.parser;

import hudson.plugins.analysis.util.model.FileAnnotation;
import hudson.plugins.analysis.util.model.Priority;
import org.junit.Test;

import java.io.IOException;
import java.util.Collection;
import java.util.Iterator;
import java.util.Locale;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import org.junit.Test;

import static org.junit.Assert.*;

import hudson.plugins.analysis.util.model.FileAnnotation;
import hudson.plugins.analysis.util.model.Priority;

/**
* Tests the class {@link hudson.plugins.warnings.parser.AjcParser}.
@@ -41,7 +41,7 @@ public void parseDeprecation() throws IOException {
0,
"incorrect classpath: /home/hudson/.m2/repository/org/apache/cxf/cxf/2.6.1/cxf-2.6.1.pom",
"<unknown source file>",
WARNING_TYPE, "", Priority.NORMAL);
WARNING_TYPE, DEFAULT_CATEGORY, Priority.NORMAL);

annotation = iterator.next();
checkWarning(annotation,
@@ -95,7 +95,7 @@ public void issue2133() throws IOException {
86,
"non-varargs call of varargs method with inexact argument type for last parameter;",
"/home/hudson/hudson/data/jobs/Mockito/workspace/trunk/test/org/mockitousage/misuse/DescriptiveMessagesOnMisuseTest.java",
WARNING_TYPE, "", Priority.NORMAL);
WARNING_TYPE, DEFAULT_CATEGORY, Priority.NORMAL);
checkWarning(iterator.next(),
51,
"<T>stubVoid(T) in org.mockito.Mockito has been deprecated",
@@ -1,22 +1,21 @@
package hudson.plugins.warnings.parser;

import static org.junit.Assert.*;

import java.io.IOException;
import java.util.Collection;
import java.util.Iterator;

import org.apache.commons.lang.StringUtils;
import org.junit.Test;

import static org.junit.Assert.*;

import hudson.plugins.analysis.util.model.FileAnnotation;
import hudson.plugins.analysis.util.model.Priority;

/**
* Tests the class {@link Armcc5CompilerParser}.
*/
public class Armcc5CompilerParserTest extends ParserTester {
private static final String WARNING_CATEGORY = StringUtils.EMPTY;
private static final String WARNING_CATEGORY = DEFAULT_CATEGORY;
private static final String WARNING_TYPE = new Armcc5CompilerParser().getGroup();

/**
@@ -1,22 +1,21 @@
package hudson.plugins.warnings.parser;

import static org.junit.Assert.*;

import java.io.IOException;
import java.util.Collection;
import java.util.Iterator;

import org.apache.commons.lang.StringUtils;
import org.junit.Test;

import static org.junit.Assert.*;

import hudson.plugins.analysis.util.model.FileAnnotation;
import hudson.plugins.analysis.util.model.Priority;

/**
* Tests the class {@link ArmccCompilerParser}.
*/
public class ArmccCompilerParserTest extends ParserTester {
private static final String WARNING_CATEGORY = StringUtils.EMPTY;
private static final String WARNING_CATEGORY = DEFAULT_CATEGORY;
private static final String WARNING_TYPE = new ArmccCompilerParser().getGroup();

/**
@@ -1,13 +1,13 @@
package hudson.plugins.warnings.parser;

import static org.junit.Assert.*;

import java.io.IOException;
import java.util.Collection;
import java.util.Iterator;

import org.junit.Test;

import static org.junit.Assert.*;

import hudson.plugins.analysis.util.model.FileAnnotation;
import hudson.plugins.analysis.util.model.Priority;

@@ -16,6 +16,7 @@
*/
public class BuckminsterParserTest extends ParserTester {
private static final String TYPE = new BuckminsterParser().getGroup();
private static final String CATEGORY = DEFAULT_CATEGORY;

/**
* Parses a file with three Buckminster warnings.
@@ -35,19 +36,19 @@ public void testWarningsParser() throws IOException {
43,
"ArrayList is a raw type. References to generic type ArrayList<E> should be parameterized",
"/var/lib/hudson/jobs/MailApp/workspace/plugins/org.eclipse.buckminster.tutorial.mailapp/src/org/eclipse/buckminster/tutorial/mailapp/NavigationView.java",
TYPE, "", Priority.NORMAL);
TYPE, CATEGORY, Priority.NORMAL);
annotation = iterator.next();
checkWarning(annotation,
57,
"Type safety: The method toArray(Object[]) belongs to the raw type ArrayList. References to generic type ArrayList<E> should be parameterized",
"/var/lib/hudson/jobs/MailApp/workspace/plugins/org.eclipse.buckminster.tutorial.mailapp/src/org/eclipse/buckminster/tutorial/mailapp/NavigationView.java",
TYPE, "", Priority.HIGH);
TYPE, CATEGORY, Priority.HIGH);
annotation = iterator.next();
checkWarning(annotation,
0,
"Build path specifies execution environment J2SE-1.5. There are no JREs installed in the workspace that are strictly compatible with this environment.",
"/var/lib/hudson/jobs/MailApp/workspace/plugins/org.eclipse.buckminster.tutorial.mailapp",
TYPE, "", Priority.NORMAL);
TYPE, CATEGORY, Priority.NORMAL);
}

@Override
@@ -4,7 +4,6 @@
import java.util.Collection;
import java.util.Iterator;

import org.apache.commons.lang.StringUtils;
import org.junit.Test;

import static org.junit.Assert.*;
@@ -52,7 +51,7 @@ public void issue18084() throws IOException {
assertEquals(WRONG_NUMBER_OF_WARNINGS_DETECTED, 1, warnings.size());
FileAnnotation annotation = warnings.iterator().next();
checkWarning(annotation, 10, 10, "'test.h' file not found",
"./test.h", StringUtils.EMPTY, Priority.HIGH);
"./test.h", DEFAULT_CATEGORY, Priority.HIGH);
}

/**
@@ -69,7 +68,7 @@ public void issue14333() throws IOException {
assertEquals(WRONG_NUMBER_OF_WARNINGS_DETECTED, 1, warnings.size());
FileAnnotation annotation = warnings.iterator().next();
checkWarning(annotation, 1518, 28, "Array access (via field 'yy_buffer_stack') results in a null pointer dereference",
"scanner.cpp", StringUtils.EMPTY, Priority.NORMAL);
"scanner.cpp", DEFAULT_CATEGORY, Priority.NORMAL);
}

/**
@@ -108,7 +107,7 @@ public void testWarningsParser() throws IOException {
28,
"extra tokens at end of #endif directive",
"test.c",
TYPE, "", Priority.NORMAL);
TYPE, DEFAULT_CATEGORY, Priority.NORMAL);
annotation = iterator.next();
checkWarning(annotation,
3, 11,
@@ -133,7 +132,7 @@ public void testWarningsParser() throws IOException {
47, 15,
"invalid operands to binary expression ('int *' and '_Complex float')",
"exprs.c",
TYPE, "", Priority.NORMAL);
TYPE, DEFAULT_CATEGORY, Priority.NORMAL);
}

@Override
@@ -1,13 +1,13 @@
package hudson.plugins.warnings.parser;

import static org.junit.Assert.*;

import java.io.IOException;
import java.util.Collection;
import java.util.Iterator;

import org.junit.Test;

import static org.junit.Assert.*;

import hudson.plugins.analysis.util.model.FileAnnotation;
import hudson.plugins.analysis.util.model.Priority;

@@ -33,7 +33,7 @@ public void testWarningsParser() throws IOException {
150,
"function `unsigned configureRealCh(unsigned)' was declared static, but was not defined",
"/nfs/autofs/nett/nessie6/dailies/Monday/src/n6/heidrun/dsp/Modules/LocalChAdmin.c",
new CoolfluxChessccParser().getGroup(), "", Priority.HIGH);
new CoolfluxChessccParser().getGroup(), DEFAULT_CATEGORY, Priority.HIGH);

}

@@ -1,15 +1,14 @@
package hudson.plugins.warnings.parser;

import static org.junit.Assert.*;

import java.io.IOException;
import java.util.Collection;
import java.util.Iterator;

import org.apache.commons.lang.StringUtils;
import org.junit.Ignore;
import org.junit.Test;

import static org.junit.Assert.*;

import hudson.plugins.analysis.util.model.FileAnnotation;
import hudson.plugins.analysis.util.model.Priority;

@@ -18,7 +17,7 @@
*/
public class DoxygenParserTest extends ParserTester {
private static final String WARNING_TYPE = new DoxygenParser().getGroup();
private static final String WARNING_CATEGORY = StringUtils.EMPTY;
private static final String WARNING_CATEGORY = DEFAULT_CATEGORY;

/**
* Parses a file with Doxygen warnings.
@@ -1,7 +1,5 @@
package hudson.plugins.warnings.parser;

import static org.junit.Assert.*;

import java.io.IOException;
import java.util.Collection;
import java.util.Collections;
@@ -12,6 +10,8 @@

import com.google.common.collect.Lists;

import static org.junit.Assert.*;

import hudson.plugins.analysis.core.ParserResult;
import hudson.plugins.analysis.util.model.FileAnnotation;
import hudson.plugins.analysis.util.model.Priority;
@@ -20,6 +20,8 @@
* Tests the class {@link EclipseParser}.
*/
public class EclipseParserTest extends AbstractEclipseParserTest {
private static final String CATEGORY = DEFAULT_CATEGORY;

/**
* Parses a warning log with previously undetected warnings.
*
@@ -41,7 +43,7 @@ public void issue21377() throws IOException {
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);
getType(), CATEGORY, Priority.NORMAL);
}

/**
@@ -65,17 +67,17 @@ public void issue13969() throws IOException {
369,
"The method compare(List<String>, List<String>) from the type PmModelImporter is never used locally",
"/media/ssd/multi-x-processor/workspace/msgPM_Access/com.faktorzehn.pa2msgpm.core/src/com/faktorzehn/pa2msgpm/core/loader/PmModelImporter.java",
getType(), "", Priority.NORMAL);
getType(), CATEGORY, Priority.NORMAL);
checkWarning(iterator.next(),
391,
"The method getTableValues(PropertyRestrictionType) from the type PmModelImporter is never used locally",
"/media/ssd/multi-x-processor/workspace/msgPM_Access/com.faktorzehn.pa2msgpm.core/src/com/faktorzehn/pa2msgpm/core/loader/PmModelImporter.java",
getType(), "", Priority.NORMAL);
getType(), CATEGORY, Priority.NORMAL);
checkWarning(iterator.next(),
56,
"The value of the field PropertyImporterTest.ERROR_RESPONSE is not used",
"/media/ssd/multi-x-processor/workspace/msgPM_Access/com.faktorzehn.pa2msgpm.core.test/src/com/faktorzehn/pa2msgpm/core/importer/PropertyImporterTest.java",
getType(), "", Priority.NORMAL);
getType(), CATEGORY, Priority.NORMAL);
}

/**
@@ -136,7 +138,7 @@ public void issue6427() throws IOException {
10,
"The import com.bombardier.oldinfra.export.dataAccess.InfrastructureDiagramAPI is never used",
"/srv/hudson/workspace/Ebitool Trunk/build/plugins/com.bombardier.oldInfra.export.jet/jet2java/org/eclipse/jet/compiled/_jet_infraSoe.java",
getType(), "", Priority.NORMAL);
getType(), CATEGORY, Priority.NORMAL);
}

/**
@@ -158,12 +160,12 @@ public void issue7077() throws IOException {
90,
"Type safety: The method setBoHandler(BoHandler) belongs to the raw type BoQuickSearchControl.Builder. References to generic type BoQuickSearchControl<S>.Builder<T> should be parameterized",
"/ige/hudson/work/jobs/esvclient__development/workspace/target/rcp-build/plugins/ch.ipi.esv.client.customer/src/main/java/ch/ipi/esv/client/customer/search/CustomerQuickSearch.java",
getType(), "", Priority.NORMAL);
getType(), CATEGORY, Priority.NORMAL);
checkWarning(sorted.get(1),
90,
"Type safety: The expression of type BoQuickSearchControl needs unchecked conversion to conform to BoQuickSearchControl<CustomerBO>",
"/ige/hudson/work/jobs/esvclient__development/workspace/target/rcp-build/plugins/ch.ipi.esv.client.customer/src/main/java/ch/ipi/esv/client/customer/search/CustomerQuickSearch.java",
getType(), "", Priority.NORMAL);
getType(), CATEGORY, Priority.NORMAL);
}

/**

0 comments on commit ec25a5f

Please sign in to comment.