Merge branch '7.0.x' into update-all-properties

This commit is contained in:
Clément Fournier
2020-06-12 17:32:30 +02:00
682 changed files with 45808 additions and 47509 deletions

View File

@@ -8,6 +8,7 @@
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd</artifactId>
<version>7.0.0-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<build>

View File

@@ -3,6 +3,7 @@
xmlns="http://pmd.sourceforge.net/rule-tests"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sourceforge.net/rule-tests http://pmd.sourceforge.net/rule-tests_1_0_0.xsd">
<test-code>
<description>Simple POM file - no violation</description>
<expected-problems>0</expected-problems>
@@ -13,20 +14,19 @@
<artifactId>xml-pom</artifactId>
<version>1.0.0-SNAPSHOT</version>
<dependencyManagement>
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-bom</artifactId>
<version>${arquillian.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencyManagement>
<dependencyManagement>
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-bom</artifactId>
<version>${arquillian.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencyManagement>
</project>
]]></code>
<source-type>pom</source-type>
]]></code>
</test-code>
<test-code>
<description>Simple POM file with violation</description>
<expected-problems>1</expected-problems>
@@ -37,23 +37,21 @@
<artifactId>xml-pom</artifactId>
<version>1.0.0-SNAPSHOT</version>
<dependencyManagement>
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-bom</artifactId>
<version>${arquillian.version}</version>
<type>bom</type>
<scope>import</scope>
</dependency>
</dependencyManagement>
<dependencyManagement>
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-bom</artifactId>
<version>${arquillian.version}</version>
<type>bom</type>
<scope>import</scope>
</dependency>
</dependencyManagement>
</project>
]]></code>
<source-type>pom</source-type>
]]></code>
</test-code>
<test-code>
<description>Simple POM file with violation</description>
<description>Simple POM file with bom</description>
<rule-property name="validTypes">bom</rule-property>
<expected-problems>0</expected-problems>
<code><![CDATA[
@@ -63,18 +61,16 @@
<artifactId>xml-pom</artifactId>
<version>1.0.0-SNAPSHOT</version>
<dependencyManagement>
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-bom</artifactId>
<version>${arquillian.version}</version>
<type>bom</type>
<scope>import</scope>
</dependency>
</dependencyManagement>
<dependencyManagement>
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-bom</artifactId>
<version>${arquillian.version}</version>
<type>bom</type>
<scope>import</scope>
</dependency>
</dependencyManagement>
</project>
]]></code>
<source-type>pom</source-type>
]]></code>
</test-code>
</test-data>

View File

@@ -3,6 +3,7 @@
xmlns="http://pmd.sourceforge.net/rule-tests"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sourceforge.net/rule-tests http://pmd.sourceforge.net/rule-tests_1_0_0.xsd">
<test-code>
<description>Simple POM file</description>
<expected-problems>0</expected-problems>
@@ -21,9 +22,9 @@
</dependency>
</dependencies>
</project>
]]></code>
<source-type>pom</source-type>
]]></code>
</test-code>
<test-code>
<description>Simple POM file with violation</description>
<expected-problems>1</expected-problems>
@@ -42,9 +43,9 @@
</dependency>
</dependencies>
</project>
]]></code>
<source-type>pom</source-type>
]]></code>
</test-code>
<test-code>
<description>#715 [xml] ProjectVersionAsDependencyVersion false positive: Valid usage child modules</description>
<expected-problems>1</expected-problems>

View File

@@ -3,73 +3,74 @@
xmlns="http://pmd.sourceforge.net/rule-tests"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sourceforge.net/rule-tests http://pmd.sourceforge.net/rule-tests_1_0_0.xsd">
<test-code>
<description>No CDATASection</description>
<expected-problems>0</expected-problems>
<code><![CDATA[
<test-code>
<description>No CDATASection</description>
<expected-problems>0</expected-problems>
<code><![CDATA[
<root>
<child>
</child>
<child>
</child>
</root>
]]></code>
<source-type>xml</source-type>
</test-code>
<test-code>
<description>Valid CDATASection</description>
<expected-problems>0</expected-problems>
<code><![CDATA[
]]></code>
</test-code>
<test-code>
<description>Valid CDATASection</description>
<expected-problems>0</expected-problems>
<code><![CDATA[
<root>
<child>
<![CDATA[
some text data
]]><![CDATA[]]]]><![CDATA[>]]><![CDATA[
</child>
<child>
<![CDATA[
some text data
]]><![CDATA[]]]]><![CDATA[>]]><![CDATA[
</child>
</root>
]]></code>
<source-type>xml</source-type>
</test-code>
<test-code>
<description>CDATASection with [ and ] in it, but not at the ends</description>
<expected-problems>0</expected-problems>
<code><![CDATA[
]]></code>
</test-code>
<test-code>
<description>CDATASection with [ and ] in it, but not at the ends</description>
<expected-problems>0</expected-problems>
<code><![CDATA[
<root>
<child>
<![CDATA[
some [text] data
]]><![CDATA[]]]]><![CDATA[>]]><![CDATA[
</child>
<child>
<![CDATA[
some [text] data
]]><![CDATA[]]]]><![CDATA[>]]><![CDATA[
</child>
</root>
]]></code>
<source-type>xml</source-type>
</test-code>
<test-code>
<description>CDATASection with [ at the beginning</description>
<expected-problems>1</expected-problems>
<code><![CDATA[
]]></code>
</test-code>
<test-code>
<description>CDATASection with [ at the beginning</description>
<expected-problems>1</expected-problems>
<code><![CDATA[
<root>
<child>
<![CDATA[[
some text data
]]><![CDATA[]]]]><![CDATA[>]]><![CDATA[
</child>
<child>
<![CDATA[[
some text data
]]><![CDATA[]]]]><![CDATA[>]]><![CDATA[
</child>
</root>
]]></code>
<source-type>xml</source-type>
</test-code>
<test-code>
<description>CDATASection with ] at the end</description>
<expected-problems>1</expected-problems>
<code><![CDATA[
]]></code>
</test-code>
<test-code>
<description>CDATASection with ] at the end</description>
<expected-problems>1</expected-problems>
<code><![CDATA[
<root>
<child>
<![CDATA[
some text data
]]]><![CDATA[]]]]><![CDATA[>]]><![CDATA[
</child>
<child>
<![CDATA[
some text data
]]]><![CDATA[]]]]><![CDATA[>]]><![CDATA[
</child>
</root>
]]></code>
<source-type>xml</source-type>
</test-code>
]]></code>
</test-code>
<test-code>
<description>Example code</description>
<expected-problems>2</expected-problems>
@@ -89,6 +90,7 @@
</root>
]]></code>
</test-code>
<test-code>
<description>Square bracket at end separate by space is ok</description>
<expected-problems>0</expected-problems>

View File

@@ -3,26 +3,26 @@
xmlns="http://pmd.sourceforge.net/rule-tests"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sourceforge.net/rule-tests http://pmd.sourceforge.net/rule-tests_1_0_0.xsd">
<test-code>
<description>Basic scenario</description>
<expected-problems>1</expected-problems>
<code><![CDATA[
<test-code>
<description>Basic scenario</description>
<expected-problems>1</expected-problems>
<code><![CDATA[
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:variable name="var" select="concat('abc',concat('cd','ef'))"/>
<xsl:variable name="var" select="concat('abc',concat('cd','ef'))"/>
</xsl:stylesheet>
]]></code>
<source-type>xsl</source-type>
</test-code>
<test-code>
<description>Valid use of concat()</description>
<expected-problems>0</expected-problems>
<code><![CDATA[
]]></code>
</test-code>
<test-code>
<description>Valid use of concat()</description>
<expected-problems>0</expected-problems>
<code><![CDATA[
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:variable name="var" select="concat('abc','cd','ef')"/>
<xsl:variable name="var" select="concat('abc','cd','ef')"/>
</xsl:stylesheet>
]]></code>
<source-type>xsl</source-type>
</test-code>
]]></code>
</test-code>
</test-data>

View File

@@ -3,41 +3,41 @@
xmlns="http://pmd.sourceforge.net/rule-tests"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sourceforge.net/rule-tests http://pmd.sourceforge.net/rule-tests_1_0_0.xsd">
<test-code>
<description>Basic scenario</description>
<expected-problems>3</expected-problems>
<code><![CDATA[
<test-code>
<description>Basic scenario</description>
<expected-problems>3</expected-problems>
<code><![CDATA[
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:variable select="descendant::book"/>
<xsl:variable select="following::book"/>
<xsl:variable select="preceeding::book"/>
<xsl:variable select="descendant::book"/>
<xsl:variable select="following::book"/>
<xsl:variable select="preceeding::book"/>
</xsl:stylesheet>
]]></code>
<source-type>xsl</source-type>
</test-code>
<test-code>
<description>using an axis name as an node name</description>
<expected-problems>0</expected-problems>
<code><![CDATA[
]]></code>
</test-code>
<test-code>
<description>using an axis name as an node name</description>
<expected-problems>0</expected-problems>
<code><![CDATA[
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- a node called 'descendant', probably a bad idea but shouldn't be a problem -->
<xsl:variable name="var" select="//descendant"/>
<!-- a node called 'descendant', probably a bad idea but shouldn't be a problem -->
<xsl:variable name="var" select="//descendant"/>
</xsl:stylesheet>
]]></code>
<source-type>xsl</source-type>
</test-code>
<test-code>
<description>using an axis descendant::self abreviation with checkSelfDescendantAbreviation @true</description>
<rule-property name="checkSelfDescendantAbreviation">true</rule-property>
<expected-problems>1</expected-problems>
<code><![CDATA[
]]></code>
</test-code>
<test-code>
<description>using an axis descendant::self abreviation with checkSelfDescendantAbreviation @true</description>
<rule-property name="checkSelfDescendantAbreviation">true</rule-property>
<expected-problems>1</expected-problems>
<code><![CDATA[
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:variable name="var" select="//child"/>
<xsl:variable name="var" select="//child"/>
</xsl:stylesheet>
]]></code>
<source-type>xsl</source-type>
</test-code>
]]></code>
</test-code>
</test-data>