Apply schema for java rules tests

This commit is contained in:
Andreas Dangel
2017-09-10 21:13:35 +02:00
parent ef3d3a87c6
commit 4f5cae32d9
303 changed files with 1346 additions and 437 deletions

View File

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<test-data>
<test-data
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><![CDATA[
XPath should match Foo

View File

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<test-data>
<test-data
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">
<code-fragment id="full-example"><![CDATA[
public class StatementAndBraceFinder extends JavaParserVisitorAdapter {
@ -139,8 +142,8 @@ public class StatementAndBraceFinder extends JavaParserVisitorAdapter {
<test-code regressionTest="false">
<description>TODO: known limitation, should report 1</description>
<expected-problems>1</expected-problems>
<rule-property name="reportClasses">false</rule-property>
<expected-problems>1</expected-problems>
<expected-messages>
<message>'.Foo#bar()' has value 1.</message>
</expected-messages>

View File

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<test-data>
<test-data
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">
<code-fragment id="full-example">
<![CDATA[
@ -78,8 +81,8 @@
<test-code>
<description>Full example - Ignore boolean path option</description>
<expected-problems>2</expected-problems>
<rule-property name="metricOptions">ignoreBooleanPaths</rule-property>
<expected-problems>2</expected-problems>
<expected-messages>
<message>'.Complicated#exception()' has value 4.</message>
<message>'.Complicated#example()' has value 14.</message>
@ -89,8 +92,8 @@
<test-code>
<description>Full example - Consider assert option</description>
<expected-problems>2</expected-problems>
<rule-property name="metricOptions">considerAssert</rule-property>
<expected-problems>2</expected-problems>
<expected-messages>
<message>'.Complicated#exception()' has value 4.</message>
<message>'.Complicated#example()' has value 28.</message>
@ -100,8 +103,8 @@
<test-code>
<description>Full example - considerAssert + ignoreBooleanPaths</description>
<expected-problems>2</expected-problems>
<rule-property name="metricOptions">ignoreBooleanPaths|considerAssert</rule-property>
<expected-problems>2</expected-problems>
<expected-messages>
<message>'.Complicated#exception()' has value 4.</message>
<message>'.Complicated#example()' has value 18.</message>
@ -198,8 +201,8 @@
<test-code>
<description>Standard Cyclo should count boolean paths</description>
<expected-problems>1</expected-problems>
<rule-property name="reportClasses">false</rule-property>
<expected-problems>1</expected-problems>
<expected-messages>
<message>'.Foo#foo()' has value 8.</message>
</expected-messages>

View File

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<test-data>
<test-data
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">
<code-fragment id="full-example">
<![CDATA[

View File

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<test-data>
<test-data
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">
<code-fragment id="full-example"><![CDATA[
public class Foo {

View File

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<test-data>
<test-data
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">
<!-- All these tests have been validated against JavaNCSS. -->

View File

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<test-data>
<test-data
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">
<code-fragment id="full-example"><![CDATA[
public class Foo {

View File

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<test-data>
<test-data
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">
<code-fragment id="full-example"><![CDATA[
public class Foo {

View File

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<test-data>
<test-data
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">
<code-fragment id="full-example"><![CDATA[

View File

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<test-data>
<test-data
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">
<code-fragment id="full-example">
<![CDATA[

View File

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<test-data>
<test-data
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">
<code-fragment id="full-example"><![CDATA[

View File

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<test-data>
<test-data
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><![CDATA[
Success

View File

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<test-data>
<test-data
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><![CDATA[
Success

View File

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<test-data>
<test-data
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 /sdcard test</description>
<expected-problems>1</expected-problems>

View File

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<test-data>
<test-data
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><![CDATA[
Success

View File

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<test-data>
<test-data
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><![CDATA[
Success

View File

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<test-data>
<test-data
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">
<code-fragment id="ok"><![CDATA[
public class Foo {
// These are all okay

View File

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<test-data>
<test-data
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><![CDATA[
bad, new BigDecimal(.1)

View File

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<test-data>
<test-data
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><![CDATA[
Simple duplicate typos

View File

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<test-data>
<test-data
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><![CDATA[
bad, using new ThreadGroup()

View File

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<test-data>
<test-data
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">
<code-fragment id="addresses"><![CDATA[
public class Foo {
String[] literals = {

View File

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<test-data>
<test-data
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><![CDATA[
bad, 012
@ -81,8 +84,8 @@ public class Foo {
<description><![CDATA[
BAD, 06 if strict is set
]]></description>
<expected-problems>1</expected-problems>
<rule-property name="strict">true</rule-property>
<expected-problems>1</expected-problems>
<code><![CDATA[
public class Foo {
int x = 06;

View File

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<test-data>
<test-data
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><![CDATA[
Fail, BigInteger(1)

View File

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<test-data>
<test-data
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><![CDATA[
simple failure case

View File

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<test-data>
<test-data
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><![CDATA[
should be &&

View File

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<test-data>
<test-data
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>
<![CDATA[

View File

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<test-data>
<test-data
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><![CDATA[
failure case

View File

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<test-data>
<test-data
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><![CDATA[
bad, toArray() with cast

View File

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<test-data>
<test-data
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><![CDATA[
failure case

View File

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<test-data>
<test-data
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><![CDATA[
basic use case - calls to run()

Some files were not shown because too many files have changed in this diff Show More