<?xml version="1.0" encoding="UTF-8"?>
<test-data>
    <test-code>
        <description><![CDATA[
simple failure
     ]]></description>
        <expected-problems>1</expected-problems>
        <rule-property name="ignoreExplicitConstructorInvocation">true</rule-property>
        <code><![CDATA[
public class Foo {
 Foo() {
 }
}
     ]]></code>
    </test-code>
    <test-code>
        <description><![CDATA[
only 'this(...)' is OK
     ]]></description>
        <expected-problems>0</expected-problems>
        <rule-property name="ignoreExplicitConstructorInvocation">false</rule-property>
        <code><![CDATA[
public class Foo {
 Foo() {
  this();
 }
}
     ]]></code>
    </test-code>
    <test-code>
        <description><![CDATA[
only 'this(...)' is not OK, if ignoring explicit constructor calls
     ]]></description>
        <expected-problems>1</expected-problems>
        <rule-property name="ignoreExplicitConstructorInvocation">true</rule-property>
        <code><![CDATA[
public class Foo {
 Foo() {
  this();
 }
}
     ]]></code>
    </test-code>
    <test-code>
        <description><![CDATA[
only 'super(...)' is OK
     ]]></description>
        <expected-problems>0</expected-problems>
        <rule-property name="ignoreExplicitConstructorInvocation">false</rule-property>
        <code><![CDATA[
public class Foo {
 Foo() {
  super();
 }
}
     ]]></code>
    </test-code>
    <test-code>
        <description><![CDATA[
single-line comment is OK
     ]]></description>
        <expected-problems>0</expected-problems>
        <rule-property name="ignoreExplicitConstructorInvocation">true</rule-property>
        <code><![CDATA[
public class Foo {
 Foo() {
  // Comment
 }
}
     ]]></code>
    </test-code>
    <test-code>
        <description><![CDATA[
multiple-line comment is OK
     ]]></description>
        <expected-problems>0</expected-problems>
        <rule-property name="ignoreExplicitConstructorInvocation">true</rule-property>
        <code><![CDATA[
public class Foo {
 Foo() {
  this();
  /* Comment */
 }
}
     ]]></code>
    </test-code>
    <test-code>
        <description><![CDATA[
Javadoc comment is OK
     ]]></description>
        <expected-problems>0</expected-problems>
        <rule-property name="ignoreExplicitConstructorInvocation">true</rule-property>
        <code><![CDATA[
public class Foo {
 Foo() {
  super();
  /** Comment */
 }
}
     ]]></code>
    </test-code>
    <test-code>
        <description><![CDATA[
ok
     ]]></description>
        <expected-problems>0</expected-problems>
        <rule-property name="ignoreExplicitConstructorInvocation">true</rule-property>
        <code><![CDATA[
public class Foo {
 Foo() {
  int bar;
 }
}
     ]]></code>
    </test-code>
    <test-code>
        <description><![CDATA[
with 'this(...)' ok
     ]]></description>
        <expected-problems>0</expected-problems>
        <rule-property name="ignoreExplicitConstructorInvocation">true</rule-property>
        <code><![CDATA[
public class Foo {
 Foo() {
  this();
  bar();
 }
}
     ]]></code>
    </test-code>
    <test-code>
        <description><![CDATA[
with 'super(...)' ok
     ]]></description>
        <expected-problems>0</expected-problems>
        <rule-property name="ignoreExplicitConstructorInvocation">true</rule-property>
        <code><![CDATA[
public class Foo {
 Foo() {
  super();
  bar++;
 }
}
     ]]></code>
    </test-code>
    <test-code>
        <description><![CDATA[
private is ok
     ]]></description>
        <expected-problems>0</expected-problems>
        <rule-property name="ignoreExplicitConstructorInvocation">true</rule-property>
        <code><![CDATA[
public class Foo {
 private Foo() {
 }
}
     ]]></code>
    </test-code>
    <test-code>
        <description>Empty constructor with documenting javadoc still triggers</description>
        <expected-problems>1</expected-problems>
        <rule-property name="ignoreExplicitConstructorInvocation">true</rule-property>
        <code><![CDATA[
public class WebAgent {
  /**
     <p>Instantiate a WebAgent.</p>
     <p>Call {@link #configure configure()} before calling {@link #retrieve retrieve()}.</p>
  */
  public WebAgent() {}
}
        ]]></code>
    </test-code>
</test-data>
