Skip to content

Commit

Permalink
Fix CheckStyle empty line warnings in tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
uhafner committed Dec 13, 2023
1 parent d7a9346 commit fa4e7c7
Show file tree
Hide file tree
Showing 24 changed files with 3 additions and 57 deletions.
1 change: 0 additions & 1 deletion src/test/java/edu/hm/hafner/analysis/IssueBuilderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ class IssueBuilderTest {
@Test
void shouldCreateAbsolutePath() {
try (IssueBuilder builder = new IssueBuilder()) {

builder.setFileName(RELATIVE_FILE);

assertThat(builder.build())
Expand Down
13 changes: 0 additions & 13 deletions src/test/java/edu/hm/hafner/analysis/ReportPrinterTest.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
* Tests the class {@link AquaScannerParser}.
*/
class AquaScannerParserTest extends AbstractParserTest {

private static final String EXPECTED_FILENAME = "/opt/app/app-runner.jar:org/jose4j/json/JsonHeaderUtil.class";

AquaScannerParserTest() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ protected Armcc5CompilerParserTest() {

@Override
protected void assertThatIssuesArePresent(final Report report, final SoftAssertions softly) {

softly.assertThat(report).hasSize(3);

softly.assertThat(report.get(0)).hasSeverity(Severity.WARNING_HIGH)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
* @author Andreas Mandel
*/
class ClairParserTest extends AbstractParserTest {

ClairParserTest() {
super("clair.json");
}
Expand Down Expand Up @@ -77,4 +76,4 @@ void brokenInput() {
assertThatThrownBy(() -> parse("eclipse.txt"))
.isInstanceOf(ParsingException.class);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
* Tests the class {@link CodeAnalysisParser}.
*/
class CodeAnalysisParserTest extends AbstractParserTest {

/**
* Creates a new CodeAnalysisParserTest.
*/
CodeAnalysisParserTest() {
super("codeanalysis.txt");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import static edu.hm.hafner.analysis.assertions.Assertions.*;

class CodeCheckerParserTest extends AbstractParserTest {

CodeCheckerParserTest() {
super("CodeChecker_with_linux_paths.txt");
}
Expand Down Expand Up @@ -63,7 +62,6 @@ protected void assertThatIssuesArePresent(final Report report, final SoftAsserti
.hasMessage("misra violation (use --rule-texts=<file> to get proper output)")
.hasCategory("cppcheck-misra-c2012-11.3")
.hasSeverity(Severity.WARNING_LOW);

}

@Test
Expand Down Expand Up @@ -109,6 +107,5 @@ void shouldParseWindowsPaths() {
.hasMessage("suspicious usage of 'sizeof(A*)'; pointer to aggregate")
.hasCategory("bugprone-sizeof-expression")
.hasSeverity(Severity.WARNING_HIGH);

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
* Tests the class {@link CoolfluxChessccParserTest}.
*/
class CoolfluxChessccParserTest extends AbstractParserTest {

/**
* Creates a new CoolfluxChessccParserTest.
*/
CoolfluxChessccParserTest() {
super("coolfluxchesscc.txt");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
* @author Andreas Mandel
*/
class DockerLintParserTest extends AbstractParserTest {

DockerLintParserTest() {
super("dockerlint.json");
}
Expand Down Expand Up @@ -62,4 +61,4 @@ void accepts() {
assertThat(new DockerLintParser().accepts(
new FileReaderFactory(FileSystems.getDefault().getPath("foo.txt")))).isFalse();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@
* Tests the class {@link DrMemoryParser}.
*/
class DrMemoryParserTest extends AbstractParserTest {

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ protected void assertThatIssuesArePresent(final Report report, final SoftAsserti
"The CSS type selector 'Book' was not processed, because the type was not used in the application.")
.hasFileName(
"D:/workspaces/flexcompo_trunkdev_nightly/src/flexcompo/samples/ugv_helloExtensibility_flex/src/main/HelloExtensibleWorld.mxml");

}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ protected void assertThatIssuesArePresent(final Report report, final SoftAsserti
"errno: TLS definition in /lib/libc.so.6 section .tbss mismatches non-TLS reference in /tmp/ccgdbGtN.o")
.hasFileName(FILE_NAME)
.hasSeverity(Severity.WARNING_HIGH);

}

/** Should not report warnings already detected by {@link Gcc4CompilerParser}. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,8 @@ void issue9926() {
}
}

/**
* Parses a file with two GCC warnings.
*/
@Override
protected void assertThatIssuesArePresent(final Report report, final SoftAssertions softly) {

softly.assertThat(report).hasSize(8);

Iterator<Issue> iterator = report.iterator();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ protected void assertThatIssuesArePresent(final Report report, final SoftAsserti
.hasLineStart(42)
.hasMessage("warning at the end of the file")
.hasFileName("D:/workspace/TEST/mytest.c");

}

/**
Expand Down Expand Up @@ -121,6 +120,5 @@ void issue66130() {
protected GhsMultiParser createParser() {
return new GhsMultiParser();
}

}

Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,13 @@
import edu.hm.hafner.analysis.assertions.SoftAssertions;

import static edu.hm.hafner.analysis.assertions.Assertions.*;
import static org.assertj.core.api.Assertions.*;

/**
* Tests the class {@link HadoLintParser}.
*
* @author Andreas Mandel
*/
class HadoLintParserTest extends AbstractParserTest {

HadoLintParserTest() {
super("hadolint.json");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ void issue19127() {
assertThat(warnings).hasSize(197);

try (SoftAssertions softly = new SoftAssertions()) {

softly.assertThat(warnings.get(0))
.hasSeverity(Severity.WARNING_HIGH)
.hasCategory(LintParser.JSLintXmlSaxParser.CATEGORY_UNDEFINED_VARIABLE)
Expand All @@ -42,7 +41,6 @@ void issue19127() {
.hasMessage("'window' is not defined.")
.hasFileName("C:/DVR/lint_Mobile-Localization_ws/evWebService/WebClientApi/api-v1.js")
.hasColumnStart(5);

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ void testReportParserProperties() {
void testSAXEception() throws ParsingCanceledException {
assertThatThrownBy(() -> parse("jcreport/testCorrupt.xml"))
.isInstanceOf(ParsingException.class);

}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ void issue54736() {
+ "\tat net.sourceforge.pmd.SourceCodeProcessor.processSource(SourceCodeProcessor.java:175)\n"
+ "\tat net.sourceforge.pmd.SourceCodeProcessor.processSourceCode(SourceCodeProcessor.java:96)\n"
+ "\t... 9 more");

}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
* @author Fabian Kaupp - [email protected]
*/
class PnpmAuditParserTest extends AbstractParserTest {

protected PnpmAuditParserTest() {
super("pnpm-audit.json");
}
Expand Down Expand Up @@ -72,7 +71,6 @@ void shouldMapCorrectly() {
assertThat(description).doesNotContain("Installed Version");
assertThat(description).contains("Patched Versions");
assertThat(description).contains("Vulnerable Versions");

}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* @author Jan Vansteenkiste
*/
class PuppetLintParserTest extends AbstractParserTest {

PuppetLintParserTest() {
super("puppet-lint.txt");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@ protected void assertThatIssuesArePresent(final Report report, final SoftAsserti
.hasPackageName(packageName)
.hasCategory(OTHER_CATEGORY)
.hasSeverity(Severity.WARNING_NORMAL);

}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
* Tests the class {@link VeraCodePipelineScannerParserTest}.
*/
class VeraCodePipelineScannerParserTest extends StructuredFileParserTest {

VeraCodePipelineScannerParserTest() {
super("veracode_pipeline_scanner_result.json");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ protected void assertThatIssuesArePresent(final Report report, final SoftAsserti
.hasFingerprint("fingerprint")
.hasAdditionalProperties("")
.hasOnlyLineRanges(new LineRange(5, 6));

}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,4 @@ void shouldReportDifferentSeverities() {
protected SarifAdapter createParser() {
return new SarifAdapter();
}

}

0 comments on commit fa4e7c7

Please sign in to comment.