<?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>non-static is bad</description>
        <expected-problems>1</expected-problems>
        <code><![CDATA[
import junit.framework.TestCase;
import junit.framework.TestSuite;

public class Foo extends TestCase {
    public TestSuite suite() {} // oops, should be static
}
        ]]></code>
    </test-code>

    <test-code>
        <description>public static with no params is OK</description>
        <expected-problems>0</expected-problems>
        <code><![CDATA[
import junit.framework.TestCase;
import junit.framework.TestSuite;

public class Foo extends TestCase {
    public static TestSuite suite() {}
}
        ]]></code>
    </test-code>

    <test-code>
        <description>private suite() is bad</description>
        <expected-problems>1</expected-problems>
        <code><![CDATA[
import junit.framework.TestCase;
import junit.framework.TestSuite;
public class Foo extends TestCase {
    private static TestSuite suite() {} // oops, should be public
}
        ]]></code>
    </test-code>

    <test-code>
        <description>if there are params, just skip it</description>
        <expected-problems>0</expected-problems>
        <code><![CDATA[
import junit.framework.TestCase;
import junit.framework.Test;
public class Foo extends TestCase {
    protected static Test suite(Foo foo) {}
}
        ]]></code>
    </test-code>

    <test-code>
        <description>Not a JUnit test (nonstatic is bad)</description>
        <expected-problems>0</expected-problems>
        <code><![CDATA[
import junit.framework.TestSuite;
public class Foo {
    public TestSuite suite() {}
}
        ]]></code>
    </test-code>

    <test-code>
        <description>should be static - void suite()</description>
        <expected-problems>1</expected-problems>
        <code><![CDATA[
import junit.framework.*;

public class Foo extends TestCase {
    public void suite() {}         // oops, should be static
}
]]></code>
    </test-code>

    <test-code>
        <description>should be public - void suite()</description>
        <expected-problems>1</expected-problems>
        <code><![CDATA[
import junit.framework.*;

public class Foo extends TestCase {
    private static void suite() {} // oops, should be public
}
]]></code>
    </test-code>
</test-data>
