<?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">

    <code-fragment id="full-example"><![CDATA[
import my.MutableInt;
public class Foo {
    private int value;
    private double speed;
    private MutableInt mutX;
    private boolean bool;
    private String words;

    public int getValue() {
        return value;
    }

    public boolean isBool() {
        return bool;
    }

    public int value() {
        return value;
    }

    protected int getValue() {
        return value;
    }

    boolean isBool() {
        return bool;
    }

    private int value() {
        return value;
    }

    @Override
    @TestAnnotation
    public String getWords() {
        return words;
    }
}
@interface TestAnnotation{}
    ]]></code-fragment>

    <test-code>
        <description>Full example</description>
        <expected-problems>2</expected-problems>
        <expected-messages>
            <message>'Foo' has value 7.</message>
            <message>'TestAnnotation' has value 0.</message>
        </expected-messages>
        <code-ref id="full-example"/>
    </test-code>

    <test-code>
        <description>Test empty class</description>
        <expected-problems>1</expected-problems>
        <expected-messages>
            <message>'Foo' has value 0.</message>
        </expected-messages>
        <code><![CDATA[
public class Foo {
}
        ]]></code>
    </test-code>

    <test-code>
        <description>NOAM supports enums, interfaces or annotations</description>
        <expected-problems>3</expected-problems>
        <code><![CDATA[
public interface Foo {

    public final int h;

    enum Bar{
        FOO;
        public int bel = 0;
    }

    @interface Tag {
        public static final int num = 0;
    }
}
        ]]></code>
    </test-code>
</test-data>
