<?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><![CDATA[
simple failure case
     ]]></description>
        <expected-problems>1</expected-problems>
        <code><![CDATA[
public class Foo {
 public Foo() {}
}
     ]]></code>
    </test-code>
    <test-code>
        <description><![CDATA[
private constructor
     ]]></description>
        <expected-problems>0</expected-problems>
        <code><![CDATA[
public class Foo {
 private Foo() {}
}
     ]]></code>
    </test-code>
    <test-code>
        <description><![CDATA[
constructor with arguments
     ]]></description>
        <expected-problems>0</expected-problems>
        <code><![CDATA[
public class Foo {
 public Foo(int x) {}
}
     ]]></code>
    </test-code>
    <test-code>
        <description><![CDATA[
constructor with contents
     ]]></description>
        <expected-problems>0</expected-problems>
        <code><![CDATA[
public class Foo {
 public Foo() {  
  int x = 2;
 }
}
     ]]></code>
    </test-code>
    <test-code>
        <description><![CDATA[
constructor throws exception
     ]]></description>
        <expected-problems>0</expected-problems>
        <code><![CDATA[
public class Foo {
 public Foo() throws IOException {  
 }
}
     ]]></code>
    </test-code>
    <test-code>
        <description><![CDATA[
two constructors
     ]]></description>
        <expected-problems>0</expected-problems>
        <code><![CDATA[
public class Foo {
 public Foo() {
 }
 public Foo(String foo) {}
}
     ]]></code>
    </test-code>
    <test-code>
        <description><![CDATA[
inner class with unnecessary constructor
     ]]></description>
        <expected-problems>1</expected-problems>
        <code><![CDATA[
public class Foo {
 public class Inner {
  public Inner() {}
 }
}
     ]]></code>
    </test-code>
    <test-code>
        <description><![CDATA[
inner and outer both have unnecessary constructors
     ]]></description>
        <expected-problems>2</expected-problems>
        <code><![CDATA[
public class Foo {
 public class Inner {
  public Inner() {}
 }
 public Foo() {}
}
     ]]></code>
    </test-code>
    <test-code>
        <description><![CDATA[
inner and outer, both ok
     ]]></description>
        <expected-problems>0</expected-problems>
        <code><![CDATA[
public class Foo {
 public class Inner {
 }
}
     ]]></code>
    </test-code>
    <test-code>
        <description><![CDATA[
inner ok, outer bad
     ]]></description>
        <expected-problems>1</expected-problems>
        <code><![CDATA[
public class Foo {
 public class Inner {
 }
 public Foo() {}
}
     ]]></code>
    </test-code>
    <test-code>
        <description><![CDATA[
inner ok due to nonpublic constructor
     ]]></description>
        <expected-problems>0</expected-problems>
        <code><![CDATA[
public class Foo {
 public class Inner {
  private Inner() {}
 }
}
     ]]></code>
    </test-code>
    <test-code>
        <description><![CDATA[
constructor calls super
     ]]></description>
        <expected-problems>0</expected-problems>
        <code><![CDATA[
public class Foo {
  public Foo() {super(7);}
}
     ]]></code>
    </test-code>
    <test-code>
        <description><![CDATA[
constructor calls super, no args
     ]]></description>
        <expected-problems>1</expected-problems>
        <code><![CDATA[
public class Foo {
  public Foo() {super();}
}
     ]]></code>
    </test-code>
</test-data>
