<commit_before>package edu.hm.hafner.analysis.parser;

import java.util.Iterator;

import org.junit.jupiter.api.Test;

import edu.hm.hafner.analysis.AbstractParserTest;
import edu.hm.hafner.analysis.Issue;
import edu.hm.hafner.analysis.IssueParser;
import edu.hm.hafner.analysis.Report;
import edu.hm.hafner.analysis.Severity;
import edu.hm.hafner.analysis.assertions.SoftAssertions;

import static edu.hm.hafner.analysis.assertions.Assertions.*;

/**
 * Tests the class {@link Gcc4CompilerParser} using input files of Doxygen.
 */
class DoxygenParserTest extends AbstractParserTest {
    private static final String NO_FILE_NAME = "<unknown>";

    /**
     * Creates a new instance of {@link DoxygenParserTest}.
     */
    protected DoxygenParserTest() {
        super("doxygen.txt");
    }

    /**
     * Verifies that errors and warnings at the start of the line are matches as well.
     *
     * @see <a href="https://issues.jenkins-ci.org/browse/JENKINS-64657">Issue 64657</a>
     */
    @Test
    void issue64657() {
        Report report = parse("issue64657.txt");
        assertThat(report).hasSize(3);

        assertThat(report.get(0))
                .hasLineStart(0)
                .hasMessage(
                        "doxygen no longer ships with the FreeSans font.\n"
                                + "         You may want to clear or change DOT_FONTNAME.\n"
                                + "         Otherwise you run the risk that the wrong font is being used for dot generated graphs.")
                .hasFileName(
                        "-")
                .hasSeverity(Severity.WARNING_NORMAL);

        assertThat(report.get(1))
                .hasLineStart(0)
                .hasMessage("source ../path/to/file is not a readable file or directory... skipping.")
                .hasFileName(
                        "-")
                .hasSeverity(Severity.WARNING_NORMAL);

        assertThat(report.get(2))
                .hasLineStart(0)
                .hasMessage("tag INPUT: input source `../../example/inc/example2.h' does not exist")
                .hasFileName(
                        "-")
                .hasSeverity(Severity.WARNING_NORMAL);
    }
<commit_msg>[JENKINS-64657] minor style changes<commit_after>package edu.hm.hafner.analysis.parser;

import java.util.Iterator;

import org.junit.jupiter.api.Test;

import edu.hm.hafner.analysis.AbstractParserTest;
import edu.hm.hafner.analysis.Issue;
import edu.hm.hafner.analysis.IssueParser;
import edu.hm.hafner.analysis.Report;
import edu.hm.hafner.analysis.Severity;
import edu.hm.hafner.analysis.assertions.SoftAssertions;

import static edu.hm.hafner.analysis.assertions.Assertions.*;

/**
 * Tests the class {@link Gcc4CompilerParser} using input files of Doxygen.
 */
class DoxygenParserTest extends AbstractParserTest {
    private static final String NO_FILE_NAME = "<unknown>";

    /**
     * Creates a new instance of {@link DoxygenParserTest}.
     */
    protected DoxygenParserTest() {
        super("doxygen.txt");
    }

    /**
     * Verifies that errors and warnings at the start of the line are matches as well.
     *
     * @see <a href="https://issues.jenkins-ci.org/browse/JENKINS-64657">Issue 64657</a>
     */
    @Test
    void issue64657() {
        Report report = parse("issue64657.txt");
        assertThat(report).hasSize(3);

        assertThat(report.get(0))
                .hasLineStart(0)
                .hasMessage(
                        "doxygen no longer ships with the FreeSans font.\n"
                                + "         You may want to clear or change DOT_FONTNAME.\n"
                                + "         Otherwise you run the risk that the wrong font is being used for dot generated graphs.")
                .hasFileName("-")
                .hasSeverity(Severity.WARNING_NORMAL);

        assertThat(report.get(1))
                .hasLineStart(0)
                .hasMessage("source ../path/to/file is not a readable file or directory... skipping.")
                .hasFileName("-")
                .hasSeverity(Severity.WARNING_NORMAL);

        assertThat(report.get(2))
                .hasLineStart(0)
                .hasMessage("tag INPUT: input source `../../example/inc/example2.h' does not exist")
                .hasFileName("-")
                .hasSeverity(Severity.WARNING_NORMAL);
    }

{'fraction_non_alphanumeric': 0.11080648846241718, 'fraction_numerical': 0.01439342015078821, 'mean_word_length': 2.015151515151515, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3633572', 'n_tokens_mistral': 1339, 'n_tokens_neox': 1252, 'n_words': 283}