<?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>ShortClassName basic test case</description>
        <expected-problems>1</expected-problems>
        <code><![CDATA[
public class Foo {
}
        ]]></code>
    </test-code>

    <test-code>
        <description>ShortClassName basic test case 2 : More code and other declarations</description>
        <expected-problems>0</expected-problems>
        <code><![CDATA[
public class NotFoo {
    public void m() {
        String bar;
        int x;
    }

    private class ValidName {
    }
}
        ]]></code>
    </test-code>

    <test-code>
        <description>ShortClassName works with private classes.</description>
        <expected-problems>1</expected-problems>
        <code><![CDATA[
public class YetAnotherFoo {
    private class bar {
    }
}
        ]]></code>
    </test-code>

    <test-code>
        <description>#1143 ShortClassName fires with a 5-letter class name</description>
        <expected-problems>0</expected-problems>
        <code><![CDATA[
public class Timer {
}
        ]]></code>
    </test-code>

    <test-code>
        <description>#1232 Make ShortClassName configurable (default = 5)</description>
        <expected-problems>1</expected-problems>
        <expected-linenumbers>2</expected-linenumbers>
        <expected-messages>
            <message>Avoid short class names like Bar</message>
        </expected-messages>
        <code><![CDATA[
public class ThisIsALongName { }
class Bar { }
        ]]></code>
    </test-code>

    <test-code>
        <description>#1232 Make ShortClassName configurable (minimum length = 2)</description>
        <rule-property name="minimum">2</rule-property>
        <expected-problems>0</expected-problems>
        <code><![CDATA[
public class ThisIsALongName { }
class Bar { }
        ]]></code>
    </test-code>

    <test-code>
        <description>#1232 Make ShortClassName configurable (minimum length = 4)</description>
        <rule-property name="minimum">4</rule-property>
        <expected-problems>0</expected-problems>
        <code><![CDATA[
public class Isbn { }
class Card { }
        ]]></code>
    </test-code>
</test-data>
