From 1bc87fe5aeb48cd7ec26dbd1237f09044c161946 Mon Sep 17 00:00:00 2001 From: Romain SOMMERARD Date: Sun, 24 Jan 2016 21:14:55 +0100 Subject: [PATCH] Add descriptors test --- .../checkstyle/CheckstyleDescriptorTest.java | 19 +++++++++++++ .../codenarc/CodenarcDescriptorTest.java | 19 +++++++++++++ .../types/cpd/CPDDescriptorTest.java | 19 +++++++++++++ .../types/csslint/CssLintDescriptorTest.java | 19 +++++++++++++ .../findbugs/FindBugsDescriptorTest.java | 20 ++++++++++++++ .../types/fxcop/FxCopDescriptorTest.java | 15 +++++++++++ .../gendarme/GendarmeDescriptorTest.java | 15 +++++++++++ .../jcreport/JcReportDescriptorTest.java | 27 +++++++++++++++++++ .../types/jslint/JsLintDescriptorTest.java | 27 +++++++++++++++++++ .../types/pmd/PMDDescriptorTest.java | 19 +++++++++++++ .../resharper/ReSharperDescriptorTest.java | 19 +++++++++++++ .../types/simian/SimianDescriptorTest.java | 15 +++++++++++ .../stylecop/StyleCopDescriptorTest.java | 27 +++++++++++++++++++ 13 files changed, 260 insertions(+) create mode 100644 src/test/java/hudson/plugins/violations/types/checkstyle/CheckstyleDescriptorTest.java create mode 100644 src/test/java/hudson/plugins/violations/types/codenarc/CodenarcDescriptorTest.java create mode 100644 src/test/java/hudson/plugins/violations/types/cpd/CPDDescriptorTest.java create mode 100644 src/test/java/hudson/plugins/violations/types/csslint/CssLintDescriptorTest.java create mode 100644 src/test/java/hudson/plugins/violations/types/findbugs/FindBugsDescriptorTest.java create mode 100644 src/test/java/hudson/plugins/violations/types/fxcop/FxCopDescriptorTest.java create mode 100644 src/test/java/hudson/plugins/violations/types/gendarme/GendarmeDescriptorTest.java create mode 100644 src/test/java/hudson/plugins/violations/types/jcreport/JcReportDescriptorTest.java create mode 100644 src/test/java/hudson/plugins/violations/types/jslint/JsLintDescriptorTest.java create mode 100644 src/test/java/hudson/plugins/violations/types/pmd/PMDDescriptorTest.java create mode 100644 src/test/java/hudson/plugins/violations/types/resharper/ReSharperDescriptorTest.java create mode 100644 src/test/java/hudson/plugins/violations/types/simian/SimianDescriptorTest.java create mode 100644 src/test/java/hudson/plugins/violations/types/stylecop/StyleCopDescriptorTest.java diff --git a/src/test/java/hudson/plugins/violations/types/checkstyle/CheckstyleDescriptorTest.java b/src/test/java/hudson/plugins/violations/types/checkstyle/CheckstyleDescriptorTest.java new file mode 100644 index 0000000..84c1678 --- /dev/null +++ b/src/test/java/hudson/plugins/violations/types/checkstyle/CheckstyleDescriptorTest.java @@ -0,0 +1,19 @@ +package hudson.plugins.violations.types.checkstyle; + +import org.junit.Test; + +import java.util.List; + +import static org.junit.Assert.assertTrue; + +public class CheckstyleDescriptorTest { + + @Test + public void testMavenTargets() { + CheckstyleDescriptor checkstyleDescriptor = new CheckstyleDescriptor(); + + List mavenTargets = checkstyleDescriptor.getMavenTargets(); + + assertTrue(mavenTargets.contains("checkstyle-result.xml")); + } +} diff --git a/src/test/java/hudson/plugins/violations/types/codenarc/CodenarcDescriptorTest.java b/src/test/java/hudson/plugins/violations/types/codenarc/CodenarcDescriptorTest.java new file mode 100644 index 0000000..5aee9c5 --- /dev/null +++ b/src/test/java/hudson/plugins/violations/types/codenarc/CodenarcDescriptorTest.java @@ -0,0 +1,19 @@ +package hudson.plugins.violations.types.codenarc; + +import org.junit.Test; + +import java.util.List; + +import static org.junit.Assert.assertTrue; + +public class CodenarcDescriptorTest { + + @Test + public void testMavenTargets() { + CodenarcDescriptor codenarcDescriptor = new CodenarcDescriptor(); + + List mavenTargets = codenarcDescriptor.getMavenTargets(); + + assertTrue(mavenTargets.contains("CodeNarcXmlReport.xml")); + } +} diff --git a/src/test/java/hudson/plugins/violations/types/cpd/CPDDescriptorTest.java b/src/test/java/hudson/plugins/violations/types/cpd/CPDDescriptorTest.java new file mode 100644 index 0000000..8dc416b --- /dev/null +++ b/src/test/java/hudson/plugins/violations/types/cpd/CPDDescriptorTest.java @@ -0,0 +1,19 @@ +package hudson.plugins.violations.types.cpd; + +import org.junit.Test; + +import java.util.List; + +import static org.junit.Assert.assertTrue; + +public class CPDDescriptorTest { + + @Test + public void testMavenTargets() { + CPDDescriptor cpdDescriptor = new CPDDescriptor(); + + List mavenTargets = cpdDescriptor.getMavenTargets(); + + assertTrue(mavenTargets.contains("cpd.xml")); + } +} diff --git a/src/test/java/hudson/plugins/violations/types/csslint/CssLintDescriptorTest.java b/src/test/java/hudson/plugins/violations/types/csslint/CssLintDescriptorTest.java new file mode 100644 index 0000000..3c8b4fe --- /dev/null +++ b/src/test/java/hudson/plugins/violations/types/csslint/CssLintDescriptorTest.java @@ -0,0 +1,19 @@ +package hudson.plugins.violations.types.csslint; + +import org.junit.Test; + +import java.util.List; + +import static org.junit.Assert.assertTrue; + +public class CssLintDescriptorTest { + + @Test + public void testMavenTargets() { + CssLintDescriptor cssLintDescriptor = new CssLintDescriptor(); + + List mavenTargets = cssLintDescriptor.getMavenTargets(); + + assertTrue(mavenTargets.contains("csslint.xml")); + } +} diff --git a/src/test/java/hudson/plugins/violations/types/findbugs/FindBugsDescriptorTest.java b/src/test/java/hudson/plugins/violations/types/findbugs/FindBugsDescriptorTest.java new file mode 100644 index 0000000..8ee2710 --- /dev/null +++ b/src/test/java/hudson/plugins/violations/types/findbugs/FindBugsDescriptorTest.java @@ -0,0 +1,20 @@ +package hudson.plugins.violations.types.findbugs; + +import org.junit.Test; + +import java.util.List; + +import static org.junit.Assert.assertTrue; + +public class FindBugsDescriptorTest { + + @Test + public void testMavenTargets() { + FindBugsDescriptor findBugsDescriptor = new FindBugsDescriptor(); + + List mavenTargets = findBugsDescriptor.getMavenTargets(); + + assertTrue(mavenTargets.contains("findbugsXml.xml")); + assertTrue(mavenTargets.contains("findbugs.xml")); + } +} diff --git a/src/test/java/hudson/plugins/violations/types/fxcop/FxCopDescriptorTest.java b/src/test/java/hudson/plugins/violations/types/fxcop/FxCopDescriptorTest.java new file mode 100644 index 0000000..b3e7fa4 --- /dev/null +++ b/src/test/java/hudson/plugins/violations/types/fxcop/FxCopDescriptorTest.java @@ -0,0 +1,15 @@ +package hudson.plugins.violations.types.fxcop; + +import org.junit.Test; + +import static org.junit.Assert.assertNotNull; + +public class FxCopDescriptorTest { + + @Test + public void testParserCreation() { + FxCopDescriptor fxCopDescriptor = new FxCopDescriptor(); + + assertNotNull(fxCopDescriptor.createParser()); + } +} diff --git a/src/test/java/hudson/plugins/violations/types/gendarme/GendarmeDescriptorTest.java b/src/test/java/hudson/plugins/violations/types/gendarme/GendarmeDescriptorTest.java new file mode 100644 index 0000000..403d7d7 --- /dev/null +++ b/src/test/java/hudson/plugins/violations/types/gendarme/GendarmeDescriptorTest.java @@ -0,0 +1,15 @@ +package hudson.plugins.violations.types.gendarme; + +import org.junit.Test; + +import static org.junit.Assert.assertNotNull; + +public class GendarmeDescriptorTest { + + @Test + public void testParserCreation() { + GendarmeDescriptor gendarmeDescriptor = new GendarmeDescriptor(); + + assertNotNull(gendarmeDescriptor.createParser()); + } +} diff --git a/src/test/java/hudson/plugins/violations/types/jcreport/JcReportDescriptorTest.java b/src/test/java/hudson/plugins/violations/types/jcreport/JcReportDescriptorTest.java new file mode 100644 index 0000000..7c4b4b2 --- /dev/null +++ b/src/test/java/hudson/plugins/violations/types/jcreport/JcReportDescriptorTest.java @@ -0,0 +1,27 @@ +package hudson.plugins.violations.types.jcreport; + +import org.junit.Test; + +import java.util.List; + +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +public class JcReportDescriptorTest { + + @Test + public void testParserCreation() { + JcReportDescriptor jcReportDescriptor = new JcReportDescriptor(); + + assertNotNull(jcReportDescriptor.createParser()); + } + + @Test + public void testMavenTargets() { + JcReportDescriptor jcReportDescriptor = new JcReportDescriptor(); + + List mavenTargets = jcReportDescriptor.getMavenTargets(); + + assertTrue(mavenTargets.contains("jcoderz-report.xml")); + } +} diff --git a/src/test/java/hudson/plugins/violations/types/jslint/JsLintDescriptorTest.java b/src/test/java/hudson/plugins/violations/types/jslint/JsLintDescriptorTest.java new file mode 100644 index 0000000..980bbcd --- /dev/null +++ b/src/test/java/hudson/plugins/violations/types/jslint/JsLintDescriptorTest.java @@ -0,0 +1,27 @@ +package hudson.plugins.violations.types.jslint; + +import org.junit.Test; + +import java.util.List; + +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +public class JsLintDescriptorTest { + + @Test + public void testParserCreation() { + JsLintDescriptor jsLintDescriptor = new JsLintDescriptor(); + + assertNotNull(jsLintDescriptor.createParser()); + } + + @Test + public void testMavenTargets() { + JsLintDescriptor jsLintDescriptor = new JsLintDescriptor(); + + List mavenTargets = jsLintDescriptor.getMavenTargets(); + + assertTrue(mavenTargets.contains("jslint.xml")); + } +} diff --git a/src/test/java/hudson/plugins/violations/types/pmd/PMDDescriptorTest.java b/src/test/java/hudson/plugins/violations/types/pmd/PMDDescriptorTest.java new file mode 100644 index 0000000..ba37002 --- /dev/null +++ b/src/test/java/hudson/plugins/violations/types/pmd/PMDDescriptorTest.java @@ -0,0 +1,19 @@ +package hudson.plugins.violations.types.pmd; + +import org.junit.Test; + +import java.util.List; + +import static org.junit.Assert.assertTrue; + +public class PMDDescriptorTest { + + @Test + public void testMavenTargets() { + PMDDescriptor pmdDescriptor = new PMDDescriptor(); + + List mavenTargets = pmdDescriptor.getMavenTargets(); + + assertTrue(mavenTargets.contains("pmd.xml")); + } +} diff --git a/src/test/java/hudson/plugins/violations/types/resharper/ReSharperDescriptorTest.java b/src/test/java/hudson/plugins/violations/types/resharper/ReSharperDescriptorTest.java new file mode 100644 index 0000000..7b98401 --- /dev/null +++ b/src/test/java/hudson/plugins/violations/types/resharper/ReSharperDescriptorTest.java @@ -0,0 +1,19 @@ +package hudson.plugins.violations.types.resharper; + +import org.junit.Test; + +import java.util.List; + +import static org.junit.Assert.assertTrue; + +public class ReSharperDescriptorTest { + + @Test + public void testMavenTargets() { + ReSharperDescriptor reSharperDescriptor = new ReSharperDescriptor(); + + List mavenTargets = reSharperDescriptor.getMavenTargets(); + + assertTrue(mavenTargets.contains("resharper.xml")); + } +} diff --git a/src/test/java/hudson/plugins/violations/types/simian/SimianDescriptorTest.java b/src/test/java/hudson/plugins/violations/types/simian/SimianDescriptorTest.java new file mode 100644 index 0000000..89f0dd7 --- /dev/null +++ b/src/test/java/hudson/plugins/violations/types/simian/SimianDescriptorTest.java @@ -0,0 +1,15 @@ +package hudson.plugins.violations.types.simian; + +import org.junit.Test; + +import static org.junit.Assert.assertNotNull; + +public class SimianDescriptorTest { + + @Test + public void testParserCreation() { + SimianDescriptor simianDescriptor = new SimianDescriptor(); + + assertNotNull(simianDescriptor.createParser()); + } +} diff --git a/src/test/java/hudson/plugins/violations/types/stylecop/StyleCopDescriptorTest.java b/src/test/java/hudson/plugins/violations/types/stylecop/StyleCopDescriptorTest.java new file mode 100644 index 0000000..7b0b6fb --- /dev/null +++ b/src/test/java/hudson/plugins/violations/types/stylecop/StyleCopDescriptorTest.java @@ -0,0 +1,27 @@ +package hudson.plugins.violations.types.stylecop; + +import org.junit.Test; + +import java.util.List; + +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +public class StyleCopDescriptorTest { + + @Test + public void testParserCreation() { + StyleCopDescriptor styleCopDescriptor = new StyleCopDescriptor(); + + assertNotNull(styleCopDescriptor.createParser()); + } + + @Test + public void testMavenTargets() { + StyleCopDescriptor styleCopDescriptor = new StyleCopDescriptor(); + + List mavenTargets = styleCopDescriptor.getMavenTargets(); + + assertTrue(mavenTargets.contains("SourceAnalysisViolations.xml")); + } +}