<?xml version="1.0" encoding="UTF-8"?>
<test-data>
    <test-code>
        <description><![CDATA[
Guarded call - OK
     ]]></description>
        <expected-problems>0</expected-problems>
        <code><![CDATA[
public class Foo {

 private void foo(Logger logger) { 
 	if ( logger.isLoggable(Level.FINE) ) {
 		logger.fine("debug message" + ""); 
 	} 
 }  
}
     ]]></code>
    </test-code>
        <test-code>
        <description><![CDATA[
Unguarded call - KO
     ]]></description>
        <expected-problems>1</expected-problems>
        <code><![CDATA[
public class Foo {

 private void foo(Logger logger) { 
 	logger.fine("debug message" + ""); 
 }  
}
     ]]></code>
    </test-code>
    <test-code>
        <description>#1203 GuardLogStatementJavaUtil issues warning for severe level not being specified as property</description>
        <expected-problems>0</expected-problems>
        <rule-property name="logLevels">finest,finer,fine,info</rule-property>
        <rule-property name="guardsMethods">isLoggable</rule-property>
        <code><![CDATA[
import java.util.logging.Logger;
import java.util.logging.Level;

public class Foo {
    Logger LOGGER;

    public void foo() {
        LOGGER.severe("This is a severe message" + " and concat");
    }
}
        ]]></code>
    </test-code>
    <test-code>
        <description>#1227 GuardLogStatementJavaUtil doesn't catch log(Level.FINE, "msg" + " msg") calls</description>
        <expected-problems>1</expected-problems>
        <expected-linenumbers>8</expected-linenumbers>
        <code><![CDATA[
import java.util.logging.Logger;
import java.util.logging.Level;

public class Foo {
    Logger LOGGER;

    public void foo() {
        LOGGER.log(Level.FINE, "This is a severe message" + " and concat"); // violation
        if (LOGGER.isLoggable(Level.FINE)) {
            LOGGER.log(Level.FINE, "This is a severe message" + " and concat"); // no violation
        }
    }
}
        ]]></code>
    </test-code>
    <test-code>
        <description>#1335 GuardLogStatementJavaUtil should not apply to SLF4J Logger</description>
        <expected-problems>0</expected-problems>
        <code><![CDATA[
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class GuardLogTest {
    Logger LOGGER = LoggerFactory.getLogger(getClass());

    public void foo() {
        LOGGER.info("foo" + "bar");
    }
}
        ]]></code>
    </test-code>
    <test-code>
        <description>#1347 False positive for GuardLogStatementJavaUtil</description>
        <expected-problems>0</expected-problems>
        <code><![CDATA[
import org.slf4j.Logger;

public class GuardLogTest {
    Logger LOG;
    public void foo() {
        if (LOG.isInfoEnabled()) {
            LOG.info("update: After spool map size: " + map.size());
        }
    }
}
        ]]></code>
    </test-code>
</test-data>
