// Path: sorter/src/main/java/sortpom/exception/FailureException.java
// public class FailureException extends RuntimeException {
//     public FailureException(String msg, Throwable cause) {
//         super(msg, cause);
//     }
// 
//     public FailureException(String msg) {
//         super(msg);
//     }
// }
// 
// Path: sorter/src/main/java/sortpom/logger/SortPomLogger.java
// public interface SortPomLogger {
//     /**
//      * Send a message to the log in the <b>warn</b> error level.
//      *
//      * @param content warning message
//      */
//     void warn(String content);
// 
//     /**
//      * Send a message to the log in the <b>info</b> error level.
//      *
//      * @param content info message
//      */
//     void info(String content);
// 
//     /**
//      * Send a message to the log in the <b>error</b> error level.
//      *
//      * @param content error message
//      */
//     void error(String content);
// }


import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.function.Executable;
import sortpom.exception.FailureException;
import sortpom.logger.SortPomLogger;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
        parser = new XmlProcessingInstructionParser();
        parser.setup(logger);
    }

    @Test
    void multipleErrorsShouldBeReportedInLogger() {
        String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
                "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd\">\n" +
                "  <artifactId>sortpom</artifactId>\n" +
                "  <description name=\"pelle\" id=\"id\" other=\"övrigt\">Här använder vi åäö</description>\n" +
                "  <groupId>sortpom</groupId>\n" +
                "  <modelVersion>4.0.0</modelVersion>\n" +
                "  <name>SortPom</name>\n" +
                "  <!-- Egenskaper för projektet -->\n" +
                "  <properties>\n" +
                "    <?sortpom resume?>" +
                "<compileSource>1.6</compileSource>\n" +
                "    <?sortpom ignore?>" +
                "    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n" +
                "    <?sortpom resume?>" +
                "  </properties>\n" +
                "    <?sortpom token='0'?>" +
                "    <?sortpom gurka?>" +
                "  <reporting />\n" +
                "    <?sortpom ignore?>" +
                "  <version>1.0.0-SNAPSHOT</version>\n" +
                "</project>";

        final Executable testMethod = () -> parser.scanForIgnoredSections(xml);

// Path: sorter/src/main/java/sortpom/exception/FailureException.java
// public class FailureException extends RuntimeException {
//     public FailureException(String msg, Throwable cause) {
//         super(msg, cause);
//     }
// 
//     public FailureException(String msg) {
//         super(msg);
//     }
// }
// 
// Path: sorter/src/main/java/sortpom/logger/SortPomLogger.java
// public interface SortPomLogger {
//     /**
//      * Send a message to the log in the <b>warn</b> error level.
//      *
//      * @param content warning message
//      */
//     void warn(String content);
// 
//     /**
//      * Send a message to the log in the <b>info</b> error level.
//      *
//      * @param content info message
//      */
//     void info(String content);
// 
//     /**
//      * Send a message to the log in the <b>error</b> error level.
//      *
//      * @param content error message
//      */
//     void error(String content);
// }


// Path: sorter/src/test/java/sortpom/processinstruction/XmlProcessingInstructionParserTest.java
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.function.Executable;
import sortpom.exception.FailureException;
import sortpom.logger.SortPomLogger;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;

        parser = new XmlProcessingInstructionParser();
        parser.setup(logger);
    }

    @Test
    void multipleErrorsShouldBeReportedInLogger() {
        String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
                "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd\">\n" +
                "  <artifactId>sortpom</artifactId>\n" +
                "  <description name=\"pelle\" id=\"id\" other=\"övrigt\">Här använder vi åäö</description>\n" +
                "  <groupId>sortpom</groupId>\n" +
                "  <modelVersion>4.0.0</modelVersion>\n" +
                "  <name>SortPom</name>\n" +
                "  <!-- Egenskaper för projektet -->\n" +
                "  <properties>\n" +
                "    <?sortpom resume?>" +
                "<compileSource>1.6</compileSource>\n" +
                "    <?sortpom ignore?>" +
                "    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n" +
                "    <?sortpom resume?>" +
                "  </properties>\n" +
                "    <?sortpom token='0'?>" +
                "    <?sortpom gurka?>" +
                "  <reporting />\n" +
                "    <?sortpom ignore?>" +
                "  <version>1.0.0-SNAPSHOT</version>\n" +
                "</project>";

        final Executable testMethod = () -> parser.scanForIgnoredSections(xml);

        final FailureException thrown = assertThrows(FailureException.class, testMethod);