<?xml version="1.0" encoding="UTF-8"?>
<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>OneDeclarationPerLine's basic test case</description>
        <expected-problems>1</expected-problems>
        <code><![CDATA[
public class Foo
{
    public void bar()
    {
        String name, lastname, adress;
    }
}
        ]]></code>
    </test-code>

    <test-code>
        <description>OneDeclarationPerLine's potential false+</description>
        <expected-problems>0</expected-problems>
        <code><![CDATA[
public class Foo
{
    public void bar(String otherName, int age)
    {
        String name;
        String lastname;
    }
}
        ]]></code>
    </test-code>

    <test-code>
        <description>#1221 OneDeclarationPerLine really checks for one declaration each statement</description>
        <rule-property name="strictMode">false</rule-property>
        <expected-problems>0</expected-problems>
        <code><![CDATA[
public class Foo {
    public void bar() {
        String name,
               lastname;
    }
}
        ]]></code>
    </test-code>

    <test-code>
        <description>#1221 OneDeclarationPerLine really checks for one declaration each statement</description>
        <rule-property name="strictMode">true</rule-property>
        <expected-problems>1</expected-problems>
        <code><![CDATA[
public class Foo {
    public void bar() {
        String name,
               lastname;
    }
}
        ]]></code>
    </test-code>

    <test-code>
        <description>Check for field declarations without strictMode</description>
        <rule-property name="strictMode">false</rule-property>
        <expected-problems>0</expected-problems>
        <code><![CDATA[
public class Foo {
    String name,
           lastname;
}
        ]]></code>
    </test-code>

    <test-code>
        <description>Check for field declarations with strictMode</description>
        <rule-property name="strictMode">true</rule-property>
        <expected-problems>1</expected-problems>
        <code><![CDATA[
public class Foo {
    String name,
           lastname;
}
        ]]></code>
    </test-code>

    <test-code>
        <description>Don't report multiple variables in a for statement, see #658</description>
        <expected-problems>0</expected-problems>
        <code><![CDATA[
public class Foo {
    void bar() {
        for (int i = 0, j = 0; i < 10; i++, j +=2) {
        }
    }
}
        ]]></code>
    </test-code>
</test-data>
