<?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>Few public fields</description>
		<rule-property name="minimum">50</rule-property>
		<expected-problems>0</expected-problems>
		<code><![CDATA[
public class Foo {
	public Integer foo;
}
		]]></code>
	</test-code>
    
	<test-code>
		<description>Too many public fields</description>
		<rule-property name="minimum">2</rule-property>
		<expected-problems>1</expected-problems>
		<code><![CDATA[
public class Foo {
	public Integer foo;
	public Integer bif;
	public Integer baz;
	public Integer bof;
}
		]]></code>
	</test-code>
    
	<test-code>
		<description>Static final</description>
		<rule-property name="minimum">1</rule-property>
		<expected-problems>0</expected-problems>
		<code><![CDATA[
public class Foo {
	public static final Integer foo;
	public static final Integer foo1;
	public static final Integer foo2;
	public static final Integer foo3;
}
		]]></code>
	</test-code>
	
	<code-fragment id="id-3-public-methods"><![CDATA[
public class Foo {
	public Integer foo1() {return 1;}
	public Integer foo2() {return 1;}
	public Integer foo3() {return 1;}
}
	]]></code-fragment>
	
	<test-code>
		<description>Some public methods</description>
		<rule-property name="minimum">50</rule-property>
		<expected-problems>0</expected-problems>
		<code-ref id="id-3-public-methods"/>
	</test-code>
	
	<test-code>
		<description>Reduced minimum</description>
		<rule-property name="minimum">2</rule-property>
		<expected-problems>1</expected-problems>
		<code-ref id="id-3-public-methods"/>
	</test-code>
    
	<test-code>
		<description>Private fields</description>
		<rule-property name="minimum">50</rule-property>
		<expected-problems>0</expected-problems>
		<code><![CDATA[
public class Foo {
	private static final Integer foo;
	private static final Integer foo1;
	private static final Integer foo2;
	private static final Integer foo3;
}
		]]></code>
	</test-code>
	
	<test-code>
		<description>Private methods</description>
		<rule-property name="minimum">50</rule-property>
		<expected-problems>0</expected-problems>
		<code><![CDATA[
public class Foo {
	private Integer foo1() {return 1;}
	private Integer foo2() {return 1;}
	private Integer foo3() {return 1;}
}
		]]></code>
	</test-code>
	
</test-data>
