From 4b864c0ed63353882e6c667c875d5f244adff60b Mon Sep 17 00:00:00 2001 From: Sebastiaan Speck Date: Mon, 18 Nov 2024 06:29:53 +0100 Subject: [PATCH] Revert change --- .../magik/checks/checks/CommentedCodeCheckTest.java | 7 ++++--- .../checks/checks/DuplicateMethodInFileCheckTest.java | 5 +++-- .../sw/magik/checks/checks/EmptyBlockCheckTest.java | 5 +++-- .../checks/checks/FileNotInLoadListCheckTest.java | 5 +++-- .../magik/checks/checks/ForbiddenCallCheckTest.java | 5 +++-- .../sw/magik/checks/checks/FormattingCheckTest.java | 11 ++++++----- .../magik/checks/checks/HidesVariableCheckTest.java | 5 +++-- .../checks/ImportMissingDefinitionCheckTest.java | 5 +++-- .../checks/checks/LhsRhsComparatorCheckTest.java | 5 +++-- .../sw/magik/checks/checks/LineLengthCheckTest.java | 5 +++-- .../checks/checks/LocalImportProcedureCheckTest.java | 5 +++-- .../checks/checks/MethodComplexityCheckTest.java | 3 ++- .../magik/checks/checks/MethodLineCountCheckTest.java | 3 ++- .../sw/magik/checks/checks/NoSelfUseCheckTest.java | 5 +++-- .../checks/NoStatementAfterBodyExitCheckTest.java | 5 +++-- .../sw/magik/checks/checks/SimplifyIfCheckTest.java | 5 +++-- .../magik/checks/checks/SizeZeroEmptyCheckTest.java | 5 +++-- .../sw/magik/checks/checks/SwMethodDocCheckTest.java | 7 ++++--- .../sw/magik/checks/checks/SyntaxErrorCheckTest.java | 5 +++-- .../sw/magik/checks/checks/TodoCommentCheckTest.java | 7 ++++--- .../checks/checks/TrailingWhitespaceCheckTest.java | 7 ++++--- .../sw/magik/checks/checks/TypeDocCheckTest.java | 5 +++-- .../checks/checks/UndefinedVariableCheckTest.java | 5 +++-- .../checks/UnsafeEvaluateInvocationCheckTest.java | 5 +++-- .../magik/checks/checks/UnusedVariableCheckTest.java | 7 ++++--- .../magik/checks/checks/UseValueCompareCheckTest.java | 5 +++-- .../magik/checks/checks/VariableNamingCheckTest.java | 9 +++++---- .../sw/magik/checks/checks/WarnedCallCheckTest.java | 5 +++-- .../checks/ComparedTypesDoNotMatchTypedCheckTest.java | 7 ++++--- .../checks/DeprecatedMethodUsageTypedCheckTest.java | 5 +++-- .../checks/DeprecatedTypeUsageTypedCheckTest.java | 5 +++-- .../checks/GlobalExistsTypedCheckTest.java | 5 +++-- .../checks/MethodExistsTypedCheckTest.java | 5 +++-- .../MethodReturnTypesMatchDocTypedCheckTest.java | 7 ++++--- .../checks/ModuleRequiredForGlobalTypedCheckTest.java | 5 +++-- .../typedchecks/checks/SlotExistsTypedCheckTest.java | 7 ++++--- .../checks/TypeDocTypeExistsTypedCheckTest.java | 5 +++-- .../UndefinedMethodCallResultTypedCheckTest.java | 9 +++++---- 38 files changed, 127 insertions(+), 89 deletions(-) diff --git a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/CommentedCodeCheckTest.java b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/CommentedCodeCheckTest.java index 20fb1154f..0577aea66 100644 --- a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/CommentedCodeCheckTest.java +++ b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/CommentedCodeCheckTest.java @@ -3,6 +3,7 @@ import static org.assertj.core.api.Assertions.assertThat; import java.util.List; +import nl.ramsolutions.sw.magik.checks.MagikCheck; import nl.ramsolutions.sw.magik.checks.MagikIssue; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; @@ -59,7 +60,7 @@ class CommentedCodeCheckTest extends MagikCheckTestBase { """, }) void testValid(final String code) { - final CommentedCodeCheck check = new CommentedCodeCheck(); + final MagikCheck check = new CommentedCodeCheck(); final List issues = this.runCheck(code, check); assertThat(issues).isEmpty(); } @@ -117,14 +118,14 @@ void testValid(final String code) { """, }) void testInvalid(final String code) { - final CommentedCodeCheck check = new CommentedCodeCheck(); + final MagikCheck check = new CommentedCodeCheck(); final List issues = this.runCheck(code, check); assertThat(issues).hasSize(1); } @Test void testInvalid2() { - final CommentedCodeCheck check = new CommentedCodeCheck(); + final MagikCheck check = new CommentedCodeCheck(); final String code = """ _method a.b diff --git a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/DuplicateMethodInFileCheckTest.java b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/DuplicateMethodInFileCheckTest.java index db33a9009..7349442d7 100644 --- a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/DuplicateMethodInFileCheckTest.java +++ b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/DuplicateMethodInFileCheckTest.java @@ -3,6 +3,7 @@ import static org.assertj.core.api.Assertions.assertThat; import java.util.List; +import nl.ramsolutions.sw.magik.checks.MagikCheck; import nl.ramsolutions.sw.magik.checks.MagikIssue; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; @@ -45,7 +46,7 @@ class DuplicateMethodInFileCheckTest extends MagikCheckTestBase { """, }) void testValid(final String code) { - final DuplicateMethodInFileCheck check = new DuplicateMethodInFileCheck(); + final MagikCheck check = new DuplicateMethodInFileCheck(); final List issues = this.runCheck(code, check); assertThat(issues).isEmpty(); } @@ -85,7 +86,7 @@ void testValid(final String code) { """, }) void testInvalid(final String code) { - final DuplicateMethodInFileCheck check = new DuplicateMethodInFileCheck(); + final MagikCheck check = new DuplicateMethodInFileCheck(); final List issues = this.runCheck(code, check); assertThat(issues).hasSize(2); } diff --git a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/EmptyBlockCheckTest.java b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/EmptyBlockCheckTest.java index bcb8cfbaf..949b02595 100644 --- a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/EmptyBlockCheckTest.java +++ b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/EmptyBlockCheckTest.java @@ -3,6 +3,7 @@ import static org.assertj.core.api.Assertions.assertThat; import java.util.List; +import nl.ramsolutions.sw.magik.checks.MagikCheck; import nl.ramsolutions.sw.magik.checks.MagikIssue; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; @@ -47,7 +48,7 @@ class EmptyBlockCheckTest extends MagikCheckTestBase { """, }) void testValid(final String code) { - final EmptyBlockCheck check = new EmptyBlockCheck(); + final MagikCheck check = new EmptyBlockCheck(); final List issues = this.runCheck(code, check); assertThat(issues).isEmpty(); } @@ -97,7 +98,7 @@ void testValid(final String code) { """, }) void testInvalid(final String code) { - final EmptyBlockCheck check = new EmptyBlockCheck(); + final MagikCheck check = new EmptyBlockCheck(); final List issues = this.runCheck(code, check); assertThat(issues).hasSize(1); } diff --git a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/FileNotInLoadListCheckTest.java b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/FileNotInLoadListCheckTest.java index f203306c3..7e88ce5c6 100644 --- a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/FileNotInLoadListCheckTest.java +++ b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/FileNotInLoadListCheckTest.java @@ -5,6 +5,7 @@ import java.io.IOException; import java.nio.file.Path; import java.util.List; +import nl.ramsolutions.sw.magik.checks.MagikCheck; import nl.ramsolutions.sw.magik.checks.MagikIssue; import org.junit.jupiter.api.Test; @@ -16,7 +17,7 @@ void testNotInLoadList() throws IllegalArgumentException, IOException { final Path path = Path.of( "magik-checks/src/test/resources/test_product/test_module/source/not_in_load_list.magik"); - final FileNotInLoadListCheck check = new FileNotInLoadListCheck(); + final MagikCheck check = new FileNotInLoadListCheck(); final List issues = this.runCheck(path, check); assertThat(issues).isNotEmpty(); } @@ -26,7 +27,7 @@ void testInLoadList() throws IllegalArgumentException, IOException { final Path path = Path.of( "magik-checks/src/test/resources/test_product/test_module/source/in_load_list.magik"); - final FileNotInLoadListCheck check = new FileNotInLoadListCheck(); + final MagikCheck check = new FileNotInLoadListCheck(); final List issues = this.runCheck(path, check); assertThat(issues).isEmpty(); } diff --git a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/ForbiddenCallCheckTest.java b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/ForbiddenCallCheckTest.java index 2ee8e3d32..0791c7d78 100644 --- a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/ForbiddenCallCheckTest.java +++ b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/ForbiddenCallCheckTest.java @@ -3,6 +3,7 @@ import static org.assertj.core.api.Assertions.assertThat; import java.util.List; +import nl.ramsolutions.sw.magik.checks.MagikCheck; import nl.ramsolutions.sw.magik.checks.MagikIssue; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; @@ -17,7 +18,7 @@ class ForbiddenCallCheckTest extends MagikCheckTestBase { "sw:do_something(1)", }) void testValid(final String code) { - final ForbiddenCallCheck check = new ForbiddenCallCheck(); + final MagikCheck check = new ForbiddenCallCheck(); final List issues = this.runCheck(code, check); assertThat(issues).isEmpty(); } @@ -26,7 +27,7 @@ void testValid(final String code) { @ValueSource( strings = {"show(1)", "sw:show(1)", "a.sys!slot(:a)", "a.sys!perform(:|xyz()|, x, y, z)"}) void testInvalid(final String code) { - final ForbiddenCallCheck check = new ForbiddenCallCheck(); + final MagikCheck check = new ForbiddenCallCheck(); final List issues = this.runCheck(code, check); assertThat(issues).hasSize(1); } diff --git a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/FormattingCheckTest.java b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/FormattingCheckTest.java index ff231175f..07ecce3dc 100644 --- a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/FormattingCheckTest.java +++ b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/FormattingCheckTest.java @@ -5,6 +5,7 @@ import java.io.IOException; import java.nio.file.Path; import java.util.List; +import nl.ramsolutions.sw.magik.checks.MagikCheck; import nl.ramsolutions.sw.magik.checks.MagikIssue; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; @@ -44,7 +45,7 @@ class FormattingCheckTest extends MagikCheckTestBase { """, }) void testProper(final String code) { - final FormattingCheck check = new FormattingCheck(); + final MagikCheck check = new FormattingCheck(); final List issues = this.runCheck(code, check); assertThat(issues).isEmpty(); } @@ -62,14 +63,14 @@ void testProper(final String code) { "$\n$", }) void testImproper(final String code) { - final FormattingCheck check = new FormattingCheck(); + final MagikCheck check = new FormattingCheck(); final List issues = this.runCheck(code, check); assertThat(issues).hasSize(1); } @Test void testFile() throws IllegalArgumentException, IOException { - final FormattingCheck check = new FormattingCheck(); + final MagikCheck check = new FormattingCheck(); final Path path = Path.of( "magik-checks/src/test/resources/test_product/test_module/source/in_load_list.magik"); @@ -139,14 +140,14 @@ void testSpaceIndentLineStrtWithSpaces() { }) @SuppressWarnings("java:S4144") void testMultipleWhitelines(final String code) { - final FormattingCheck check = new FormattingCheck(); + final MagikCheck check = new FormattingCheck(); final List issues = this.runCheck(code, check); assertThat(issues).hasSize(1); } @Test void testMultipleWhitelinesMethodDoc() { - final FormattingCheck check = new FormattingCheck(); + final MagikCheck check = new FormattingCheck(); final String code = """ _method object.method(param) diff --git a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/HidesVariableCheckTest.java b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/HidesVariableCheckTest.java index 5345fb24f..a6fe02731 100644 --- a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/HidesVariableCheckTest.java +++ b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/HidesVariableCheckTest.java @@ -3,6 +3,7 @@ import static org.assertj.core.api.Assertions.assertThat; import java.util.List; +import nl.ramsolutions.sw.magik.checks.MagikCheck; import nl.ramsolutions.sw.magik.checks.MagikIssue; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; @@ -39,7 +40,7 @@ class HidesVariableCheckTest extends MagikCheckTestBase { """, }) void testValid(final String code) { - final HidesVariableCheck check = new HidesVariableCheck(); + final MagikCheck check = new HidesVariableCheck(); final List issues = this.runCheck(code, check); assertThat(issues).isEmpty(); } @@ -89,7 +90,7 @@ void testValid(final String code) { """, }) void testInvalid(final String code) { - final HidesVariableCheck check = new HidesVariableCheck(); + final MagikCheck check = new HidesVariableCheck(); final List issues = this.runCheck(code, check); assertThat(issues).hasSize(1); } diff --git a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/ImportMissingDefinitionCheckTest.java b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/ImportMissingDefinitionCheckTest.java index 0463ed64b..65a0a16da 100644 --- a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/ImportMissingDefinitionCheckTest.java +++ b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/ImportMissingDefinitionCheckTest.java @@ -3,6 +3,7 @@ import static org.assertj.core.api.Assertions.assertThat; import java.util.List; +import nl.ramsolutions.sw.magik.checks.MagikCheck; import nl.ramsolutions.sw.magik.checks.MagikIssue; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; @@ -59,7 +60,7 @@ class ImportMissingDefinitionCheckTest extends MagikCheckTestBase { """, }) void testImportValid(final String code) { - final ImportMissingDefinitionCheck check = new ImportMissingDefinitionCheck(); + final MagikCheck check = new ImportMissingDefinitionCheck(); final List issues = this.runCheck(code, check); assertThat(issues).isEmpty(); } @@ -84,7 +85,7 @@ void testImportValid(final String code) { """, }) void testImportInvalid(final String code) { - final ImportMissingDefinitionCheck check = new ImportMissingDefinitionCheck(); + final MagikCheck check = new ImportMissingDefinitionCheck(); final List issues = this.runCheck(code, check); assertThat(issues).hasSize(1); } diff --git a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/LhsRhsComparatorCheckTest.java b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/LhsRhsComparatorCheckTest.java index 4443594d6..4c7e89368 100644 --- a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/LhsRhsComparatorCheckTest.java +++ b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/LhsRhsComparatorCheckTest.java @@ -3,6 +3,7 @@ import static org.assertj.core.api.Assertions.assertThat; import java.util.List; +import nl.ramsolutions.sw.magik.checks.MagikCheck; import nl.ramsolutions.sw.magik.checks.MagikIssue; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; @@ -20,7 +21,7 @@ class LhsRhsComparatorCheckTest extends MagikCheckTestBase { "a >= b", }) void testValid(final String code) { - final LhsRhsComparatorEqualCheck check = new LhsRhsComparatorEqualCheck(); + final MagikCheck check = new LhsRhsComparatorEqualCheck(); final List issues = this.runCheck(code, check); assertThat(issues).isEmpty(); } @@ -35,7 +36,7 @@ void testValid(final String code) { "a >= a", }) void testInvalid(final String code) { - final LhsRhsComparatorEqualCheck check = new LhsRhsComparatorEqualCheck(); + final MagikCheck check = new LhsRhsComparatorEqualCheck(); final List issues = this.runCheck(code, check); assertThat(issues).hasSize(1); } diff --git a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/LineLengthCheckTest.java b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/LineLengthCheckTest.java index d403dbd2a..094e7da64 100644 --- a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/LineLengthCheckTest.java +++ b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/LineLengthCheckTest.java @@ -3,6 +3,7 @@ import static org.assertj.core.api.Assertions.assertThat; import java.util.List; +import nl.ramsolutions.sw.magik.checks.MagikCheck; import nl.ramsolutions.sw.magik.checks.MagikIssue; import org.junit.jupiter.api.Test; @@ -12,7 +13,7 @@ class LineLengthCheckTest extends MagikCheckTestBase { @Test void testLineNotTooLong1() { - final LineLengthCheck check = new LineLengthCheck(); + final MagikCheck check = new LineLengthCheck(); final String code = """ # this is ok @@ -24,7 +25,7 @@ void testLineNotTooLong1() { @Test void testLineNotTooLong2() { - final LineLengthCheck check = new LineLengthCheck(); + final MagikCheck check = new LineLengthCheck(); final String code = """ l_23456789012345678901234567890 diff --git a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/LocalImportProcedureCheckTest.java b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/LocalImportProcedureCheckTest.java index c78ad67d1..47b8aa1ed 100644 --- a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/LocalImportProcedureCheckTest.java +++ b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/LocalImportProcedureCheckTest.java @@ -3,6 +3,7 @@ import static org.assertj.core.api.Assertions.assertThat; import java.util.List; +import nl.ramsolutions.sw.magik.checks.MagikCheck; import nl.ramsolutions.sw.magik.checks.MagikIssue; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; @@ -40,7 +41,7 @@ class LocalImportProcedureCheckTest extends MagikCheckTestBase { """, }) void testValid(final String code) { - final LocalImportProcedureCheck check = new LocalImportProcedureCheck(); + final MagikCheck check = new LocalImportProcedureCheck(); final List issues = this.runCheck(code, check); assertThat(issues).isEmpty(); } @@ -59,7 +60,7 @@ void testValid(final String code) { """, }) void testInvalid(final String code) { - final LocalImportProcedureCheck check = new LocalImportProcedureCheck(); + final MagikCheck check = new LocalImportProcedureCheck(); final List issues = this.runCheck(code, check); assertThat(issues).hasSize(1); } diff --git a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/MethodComplexityCheckTest.java b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/MethodComplexityCheckTest.java index 32b8f576b..d7aa9e1ba 100644 --- a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/MethodComplexityCheckTest.java +++ b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/MethodComplexityCheckTest.java @@ -3,6 +3,7 @@ import static org.assertj.core.api.Assertions.assertThat; import java.util.List; +import nl.ramsolutions.sw.magik.checks.MagikCheck; import nl.ramsolutions.sw.magik.checks.MagikIssue; import org.junit.jupiter.api.Test; @@ -41,7 +42,7 @@ void testTooComplex() { @Test void testNotTooComplex() { - final MethodComplexityCheck check = new MethodComplexityCheck(); + final MagikCheck check = new MethodComplexityCheck(); final String code = """ _method a.b diff --git a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/MethodLineCountCheckTest.java b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/MethodLineCountCheckTest.java index 23e46a949..71ed6206f 100644 --- a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/MethodLineCountCheckTest.java +++ b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/MethodLineCountCheckTest.java @@ -3,6 +3,7 @@ import static org.assertj.core.api.Assertions.assertThat; import java.util.List; +import nl.ramsolutions.sw.magik.checks.MagikCheck; import nl.ramsolutions.sw.magik.checks.MagikIssue; import org.junit.jupiter.api.Test; @@ -73,7 +74,7 @@ void testProcedureOk() { @Test void testSyntaxError() { - final MethodLineCountCheck check = new MethodLineCountCheck(); + final MagikCheck check = new MethodLineCountCheck(); final String code = """ _method a.b diff --git a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/NoSelfUseCheckTest.java b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/NoSelfUseCheckTest.java index a2fe5d668..f8570ec21 100644 --- a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/NoSelfUseCheckTest.java +++ b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/NoSelfUseCheckTest.java @@ -3,6 +3,7 @@ import static org.assertj.core.api.Assertions.assertThat; import java.util.List; +import nl.ramsolutions.sw.magik.checks.MagikCheck; import nl.ramsolutions.sw.magik.checks.MagikIssue; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; @@ -40,14 +41,14 @@ class NoSelfUseCheckTest extends MagikCheckTestBase { """, }) void testValid(final String code) { - final NoSelfUseCheck check = new NoSelfUseCheck(); + final MagikCheck check = new NoSelfUseCheck(); final List issues = this.runCheck(code, check); assertThat(issues).isEmpty(); } @Test void testInvalid() { - final NoSelfUseCheck check = new NoSelfUseCheck(); + final MagikCheck check = new NoSelfUseCheck(); final String code = """ _method a.b diff --git a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/NoStatementAfterBodyExitCheckTest.java b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/NoStatementAfterBodyExitCheckTest.java index ddd9ace6b..93c4611e2 100644 --- a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/NoStatementAfterBodyExitCheckTest.java +++ b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/NoStatementAfterBodyExitCheckTest.java @@ -3,6 +3,7 @@ import static org.assertj.core.api.Assertions.assertThat; import java.util.List; +import nl.ramsolutions.sw.magik.checks.MagikCheck; import nl.ramsolutions.sw.magik.checks.MagikIssue; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; @@ -36,7 +37,7 @@ class NoStatementAfterBodyExitCheckTest extends MagikCheckTestBase { _endloop""", }) void testValid(final String code) { - final NoStatementAfterBodyExitCheck check = new NoStatementAfterBodyExitCheck(); + final MagikCheck check = new NoStatementAfterBodyExitCheck(); final List issues = this.runCheck(code, check); assertThat(issues).isEmpty(); } @@ -57,7 +58,7 @@ void testValid(final String code) { _endloop""", }) void testInvalid(final String code) { - final NoStatementAfterBodyExitCheck check = new NoStatementAfterBodyExitCheck(); + final MagikCheck check = new NoStatementAfterBodyExitCheck(); final List issues = this.runCheck(code, check); assertThat(issues).hasSize(1); } diff --git a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/SimplifyIfCheckTest.java b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/SimplifyIfCheckTest.java index 181a794bb..b6dcd5222 100644 --- a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/SimplifyIfCheckTest.java +++ b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/SimplifyIfCheckTest.java @@ -3,6 +3,7 @@ import static org.assertj.core.api.Assertions.assertThat; import java.util.List; +import nl.ramsolutions.sw.magik.checks.MagikCheck; import nl.ramsolutions.sw.magik.checks.MagikIssue; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; @@ -70,7 +71,7 @@ class SimplifyIfCheckTest extends MagikCheckTestBase { """, }) void testValid(final String code) { - final SimplifyIfCheck check = new SimplifyIfCheck(); + final MagikCheck check = new SimplifyIfCheck(); final List issues = this.runCheck(code, check); assertThat(issues).isEmpty(); } @@ -105,7 +106,7 @@ void testValid(final String code) { """, }) void testInvalid(final String code) { - final SimplifyIfCheck check = new SimplifyIfCheck(); + final MagikCheck check = new SimplifyIfCheck(); final List issues = this.runCheck(code, check); assertThat(issues).hasSize(1); } diff --git a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/SizeZeroEmptyCheckTest.java b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/SizeZeroEmptyCheckTest.java index a5890fca1..95b0b1826 100644 --- a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/SizeZeroEmptyCheckTest.java +++ b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/SizeZeroEmptyCheckTest.java @@ -3,6 +3,7 @@ import static org.assertj.core.api.Assertions.assertThat; import java.util.List; +import nl.ramsolutions.sw.magik.checks.MagikCheck; import nl.ramsolutions.sw.magik.checks.MagikIssue; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; @@ -21,14 +22,14 @@ class SizeZeroEmptyCheckTest extends MagikCheckTestBase { "0 = a.size", }) void testInvalid(final String code) { - final SizeZeroEmptyCheck check = new SizeZeroEmptyCheck(); + final MagikCheck check = new SizeZeroEmptyCheck(); final List issues = this.runCheck(code, check); assertThat(issues).isNotEmpty(); } @Test void testValid() { - final SizeZeroEmptyCheck check = new SizeZeroEmptyCheck(); + final MagikCheck check = new SizeZeroEmptyCheck(); final String code = "a.empty?\n"; final List issues = this.runCheck(code, check); assertThat(issues).isEmpty(); diff --git a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/SwMethodDocCheckTest.java b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/SwMethodDocCheckTest.java index ba6094e79..67c86097d 100644 --- a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/SwMethodDocCheckTest.java +++ b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/SwMethodDocCheckTest.java @@ -3,6 +3,7 @@ import static org.assertj.core.api.Assertions.assertThat; import java.util.List; +import nl.ramsolutions.sw.magik.checks.MagikCheck; import nl.ramsolutions.sw.magik.checks.MagikIssue; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; @@ -35,14 +36,14 @@ class SwMethodDocCheckTest extends MagikCheckTestBase { """, }) void testValid(final String code) { - final SwMethodDocCheck check = new SwMethodDocCheck(); + final MagikCheck check = new SwMethodDocCheck(); final List issues = this.runCheck(code, check); assertThat(issues).isEmpty(); } @Test void testDocMissing() { - final SwMethodDocCheck check = new SwMethodDocCheck(); + final MagikCheck check = new SwMethodDocCheck(); final String code = """ _method a.b(param1, param2) @@ -69,7 +70,7 @@ void testDocMissing() { """, }) void testInvalid(final String code) { - final SwMethodDocCheck check = new SwMethodDocCheck(); + final MagikCheck check = new SwMethodDocCheck(); final List issues = this.runCheck(code, check); assertThat(issues).hasSize(1); } diff --git a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/SyntaxErrorCheckTest.java b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/SyntaxErrorCheckTest.java index 4db1a9d9c..3cbe2cc06 100644 --- a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/SyntaxErrorCheckTest.java +++ b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/SyntaxErrorCheckTest.java @@ -3,6 +3,7 @@ import static org.assertj.core.api.Assertions.assertThat; import java.util.List; +import nl.ramsolutions.sw.magik.checks.MagikCheck; import nl.ramsolutions.sw.magik.checks.MagikIssue; import org.junit.jupiter.api.Test; @@ -11,7 +12,7 @@ class SyntaxErrorCheckTest extends MagikCheckTestBase { @Test void testSyntaxError() { - final SyntaxErrorCheck check = new SyntaxErrorCheck(); + final MagikCheck check = new SyntaxErrorCheck(); final String code = """ _block @@ -22,7 +23,7 @@ void testSyntaxError() { @Test void testSytnaxError2() { - final SyntaxErrorCheck check = new SyntaxErrorCheck(); + final MagikCheck check = new SyntaxErrorCheck(); final String code = "_method"; final List issues = this.runCheck(code, check); assertThat(issues).isNotEmpty(); diff --git a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/TodoCommentCheckTest.java b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/TodoCommentCheckTest.java index 000b663e0..9133cfbd0 100644 --- a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/TodoCommentCheckTest.java +++ b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/TodoCommentCheckTest.java @@ -3,6 +3,7 @@ import static org.assertj.core.api.Assertions.assertThat; import java.util.List; +import nl.ramsolutions.sw.magik.checks.MagikCheck; import nl.ramsolutions.sw.magik.checks.MagikIssue; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; @@ -19,7 +20,7 @@ class TodoCommentCheckTest extends MagikCheckTestBase { "# NOTES: This should not trigger an issue as well", }) void testOk(final String code) { - final TodoCommentCheck check = new TodoCommentCheck(); + final MagikCheck check = new TodoCommentCheck(); final List issues = this.runCheck(code, check); assertThat(issues).isEmpty(); } @@ -31,7 +32,7 @@ void testOk(final String code) { "# XXX: This should trigger an issue", }) void testForbiddenWord(final String code) { - final TodoCommentCheck check = new TodoCommentCheck(); + final MagikCheck check = new TodoCommentCheck(); final List issues = this.runCheck(code, check); assertThat(issues).hasSize(1); } @@ -43,7 +44,7 @@ void testForbiddenWord(final String code) { "# XXX FIXME: This should trigger two issues", }) void testForbiddenWordTwice(final String code) { - final TodoCommentCheck check = new TodoCommentCheck(); + final MagikCheck check = new TodoCommentCheck(); final List issues = this.runCheck(code, check); assertThat(issues).hasSize(2); } diff --git a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/TrailingWhitespaceCheckTest.java b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/TrailingWhitespaceCheckTest.java index fd4a2ca8b..a8599a5d7 100644 --- a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/TrailingWhitespaceCheckTest.java +++ b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/TrailingWhitespaceCheckTest.java @@ -7,6 +7,7 @@ import nl.ramsolutions.sw.magik.MagikFile; import nl.ramsolutions.sw.magik.Position; import nl.ramsolutions.sw.magik.Range; +import nl.ramsolutions.sw.magik.checks.MagikCheck; import nl.ramsolutions.sw.magik.checks.MagikIssue; import org.junit.jupiter.api.Test; @@ -16,7 +17,7 @@ class TrailingWhitespaceCheckTest extends MagikCheckTestBase { @Test void testNoTrailingWhitespace() { - final TrailingWhitespaceCheck check = new TrailingWhitespaceCheck(); + final MagikCheck check = new TrailingWhitespaceCheck(); final String code = "a"; final List issues = this.runCheck(code, check); assertThat(issues).isEmpty(); @@ -24,7 +25,7 @@ void testNoTrailingWhitespace() { @Test void testTrailingWhitespace() { - final TrailingWhitespaceCheck check = new TrailingWhitespaceCheck(); + final MagikCheck check = new TrailingWhitespaceCheck(); final String code = "a "; final List issues = this.runCheck(code, check); assertThat(issues).hasSize(1); @@ -36,7 +37,7 @@ void testTrailingWhitespace() { @Test void testTrailingWhitespaceMultiline() { - final TrailingWhitespaceCheck check = new TrailingWhitespaceCheck(); + final MagikCheck check = new TrailingWhitespaceCheck(); final String code = """ a()\s\s\s\s diff --git a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/TypeDocCheckTest.java b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/TypeDocCheckTest.java index 1fd664c47..7de3fe3ac 100644 --- a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/TypeDocCheckTest.java +++ b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/TypeDocCheckTest.java @@ -3,6 +3,7 @@ import static org.assertj.core.api.Assertions.assertThat; import java.util.List; +import nl.ramsolutions.sw.magik.checks.MagikCheck; import nl.ramsolutions.sw.magik.checks.MagikIssue; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; @@ -26,7 +27,7 @@ class TypeDocCheckTest extends MagikCheckTestBase { """, }) void testValid(final String code) { - final TypeDocCheck check = new TypeDocCheck(); + final MagikCheck check = new TypeDocCheck(); final List issues = this.runCheck(code, check); assertThat(issues).isEmpty(); } @@ -56,7 +57,7 @@ void testValid(final String code) { """, }) void testInvalid(final String code) { - final TypeDocCheck check = new TypeDocCheck(); + final MagikCheck check = new TypeDocCheck(); final List issues = this.runCheck(code, check); assertThat(issues).hasSize(1); } diff --git a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/UndefinedVariableCheckTest.java b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/UndefinedVariableCheckTest.java index 6bd8ea020..dcb28e7a5 100644 --- a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/UndefinedVariableCheckTest.java +++ b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/UndefinedVariableCheckTest.java @@ -3,6 +3,7 @@ import static org.assertj.core.api.Assertions.assertThat; import java.util.List; +import nl.ramsolutions.sw.magik.checks.MagikCheck; import nl.ramsolutions.sw.magik.checks.MagikIssue; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; @@ -43,7 +44,7 @@ class UndefinedVariableCheckTest extends MagikCheckTestBase { """, }) void testValid(final String code) { - final UndefinedVariableCheck check = new UndefinedVariableCheck(); + final MagikCheck check = new UndefinedVariableCheck(); final List issues = this.runCheck(code, check); assertThat(issues).isEmpty(); } @@ -63,7 +64,7 @@ void testValid(final String code) { """, }) void testInvalid(final String code) { - final UndefinedVariableCheck check = new UndefinedVariableCheck(); + final MagikCheck check = new UndefinedVariableCheck(); final List issues = this.runCheck(code, check); assertThat(issues).hasSize(1); } diff --git a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/UnsafeEvaluateInvocationCheckTest.java b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/UnsafeEvaluateInvocationCheckTest.java index e193fbc81..48b8631ce 100644 --- a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/UnsafeEvaluateInvocationCheckTest.java +++ b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/UnsafeEvaluateInvocationCheckTest.java @@ -3,6 +3,7 @@ import static org.assertj.core.api.Assertions.assertThat; import java.util.List; +import nl.ramsolutions.sw.magik.checks.MagikCheck; import nl.ramsolutions.sw.magik.checks.MagikIssue; import org.junit.jupiter.api.Test; @@ -11,7 +12,7 @@ class UnsafeEvaluateInvocationCheckTest extends MagikCheckTestBase { @Test void testInvocationOk() { - final UnsafeEvaluateInvocationCheck check = new UnsafeEvaluateInvocationCheck(); + final MagikCheck check = new UnsafeEvaluateInvocationCheck(); final String code = "'abc'.p"; final List issues = this.runCheck(code, check); assertThat(issues).isEmpty(); @@ -19,7 +20,7 @@ void testInvocationOk() { @Test void testInvocationUnsafeEvaluate() { - final UnsafeEvaluateInvocationCheck check = new UnsafeEvaluateInvocationCheck(); + final MagikCheck check = new UnsafeEvaluateInvocationCheck(); final String code = "'abc'.unsafe_evaluate()"; final List issues = this.runCheck(code, check); assertThat(issues).hasSize(1); diff --git a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/UnusedVariableCheckTest.java b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/UnusedVariableCheckTest.java index da569b6f1..4a15ecb02 100644 --- a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/UnusedVariableCheckTest.java +++ b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/UnusedVariableCheckTest.java @@ -3,6 +3,7 @@ import static org.assertj.core.api.Assertions.assertThat; import java.util.List; +import nl.ramsolutions.sw.magik.checks.MagikCheck; import nl.ramsolutions.sw.magik.checks.MagikIssue; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; @@ -135,7 +136,7 @@ class UnusedVariableCheckTest extends MagikCheckTestBase { """, }) void testValid(final String code) { - final UnusedVariableCheck check = new UnusedVariableCheck(); + final MagikCheck check = new UnusedVariableCheck(); final List issues = this.runCheck(code, check); assertThat(issues).isEmpty(); } @@ -184,14 +185,14 @@ void testValid(final String code) { """, }) void testVariableNotUsed(final String code) { - final UnusedVariableCheck check = new UnusedVariableCheck(); + final MagikCheck check = new UnusedVariableCheck(); final List issues = this.runCheck(code, check); assertThat(issues).hasSize(1); } @Test void testVariableNotUsedMultiAssignment() { - final UnusedVariableCheck check = new UnusedVariableCheck(); + final MagikCheck check = new UnusedVariableCheck(); final String code = """ _method a.b diff --git a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/UseValueCompareCheckTest.java b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/UseValueCompareCheckTest.java index feaee7600..9df3c9fa2 100644 --- a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/UseValueCompareCheckTest.java +++ b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/UseValueCompareCheckTest.java @@ -3,6 +3,7 @@ import static org.assertj.core.api.Assertions.assertThat; import java.util.List; +import nl.ramsolutions.sw.magik.checks.MagikCheck; import nl.ramsolutions.sw.magik.checks.MagikIssue; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; @@ -18,7 +19,7 @@ class UseValueCompareCheckTest extends MagikCheckTestBase { "a _is 1", }) void testValid(final String code) { - final UseValueCompareCheck check = new UseValueCompareCheck(); + final MagikCheck check = new UseValueCompareCheck(); final List issues = this.runCheck(code, check); assertThat(issues).isEmpty(); } @@ -33,7 +34,7 @@ void testValid(final String code) { "a _is 16rffffffffffff", }) void testInvalid(final String code) { - final UseValueCompareCheck check = new UseValueCompareCheck(); + final MagikCheck check = new UseValueCompareCheck(); final List issues = this.runCheck(code, check); assertThat(issues).hasSize(1); } diff --git a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/VariableNamingCheckTest.java b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/VariableNamingCheckTest.java index 42504d7e9..5af7faff0 100644 --- a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/VariableNamingCheckTest.java +++ b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/VariableNamingCheckTest.java @@ -3,6 +3,7 @@ import static org.assertj.core.api.Assertions.assertThat; import java.util.List; +import nl.ramsolutions.sw.magik.checks.MagikCheck; import nl.ramsolutions.sw.magik.checks.MagikIssue; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; @@ -25,7 +26,7 @@ class VariableNamingCheckTest extends MagikCheckTestBase { "result +<< str << _self.a", }) void testValid(final String code) { - final VariableNamingCheck check = new VariableNamingCheck(); + final MagikCheck check = new VariableNamingCheck(); final List issues = this.runCheck(code, check); assertThat(issues).isEmpty(); } @@ -39,7 +40,7 @@ void testValid(final String code) { "_local l_c", }) void testInvalid(final String code) { - final VariableNamingCheck check = new VariableNamingCheck(); + final MagikCheck check = new VariableNamingCheck(); final List issues = this.runCheck(code, check); assertThat(issues).hasSize(1); } @@ -53,14 +54,14 @@ void testInvalid(final String code) { "_local l_this_is_the_very_long_variable_name", }) void testTooLongVariableName(final String code) { - final VariableNamingCheck check = new VariableNamingCheck(); + final MagikCheck check = new VariableNamingCheck(); final List issues = this.runCheck(code, check); assertThat(issues).hasSize(1); } @Test void testMultiVariableDeclarationInvalidName() { - final VariableNamingCheck check = new VariableNamingCheck(); + final MagikCheck check = new VariableNamingCheck(); final String code = "_local (l_i, l_r) << (1, 2)"; final List issues = this.runCheck(code, check); assertThat(issues).hasSize(2); diff --git a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/WarnedCallCheckTest.java b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/WarnedCallCheckTest.java index 78c8479db..2d3ff7083 100644 --- a/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/WarnedCallCheckTest.java +++ b/magik-checks/src/test/java/nl/ramsolutions/sw/magik/checks/checks/WarnedCallCheckTest.java @@ -3,6 +3,7 @@ import static org.assertj.core.api.Assertions.assertThat; import java.util.List; +import nl.ramsolutions.sw.magik.checks.MagikCheck; import nl.ramsolutions.sw.magik.checks.MagikIssue; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; @@ -18,7 +19,7 @@ class WarnedCallCheckTest extends MagikCheckTestBase { "show(1)", }) void testValid(final String code) { - final WarnedCallCheck check = new WarnedCallCheck(); + final MagikCheck check = new WarnedCallCheck(); final List issues = this.runCheck(code, check); assertThat(issues).isEmpty(); } @@ -34,7 +35,7 @@ void testValid(final String code) { "sw:remove_exemplar(:exemplar)", }) void testInvalid(final String code) { - final WarnedCallCheck check = new WarnedCallCheck(); + final MagikCheck check = new WarnedCallCheck(); final List issues = this.runCheck(code, check); assertThat(issues).hasSize(1); } diff --git a/magik-typed-checks/src/test/java/nl/ramsolutions/sw/magik/typedchecks/checks/ComparedTypesDoNotMatchTypedCheckTest.java b/magik-typed-checks/src/test/java/nl/ramsolutions/sw/magik/typedchecks/checks/ComparedTypesDoNotMatchTypedCheckTest.java index c42435d87..293f0944d 100644 --- a/magik-typed-checks/src/test/java/nl/ramsolutions/sw/magik/typedchecks/checks/ComparedTypesDoNotMatchTypedCheckTest.java +++ b/magik-typed-checks/src/test/java/nl/ramsolutions/sw/magik/typedchecks/checks/ComparedTypesDoNotMatchTypedCheckTest.java @@ -9,6 +9,7 @@ import nl.ramsolutions.sw.magik.analysis.definitions.IDefinitionKeeper; import nl.ramsolutions.sw.magik.analysis.typing.TypeString; import nl.ramsolutions.sw.magik.checks.MagikIssue; +import nl.ramsolutions.sw.magik.typedchecks.MagikTypedCheck; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; @@ -42,7 +43,7 @@ class ComparedTypesDoNotMatchTypedCheckTest extends MagikTypedCheckTestBase { }) void testDoesNotCheckUndefined(final String code) { final IDefinitionKeeper definitionKeeper = new DefinitionKeeper(); - final ComparedTypesDoNotMatchTypedCheck check = new ComparedTypesDoNotMatchTypedCheck(); + final MagikTypedCheck check = new ComparedTypesDoNotMatchTypedCheck(); final List checkResults = this.runCheck(code, definitionKeeper, check); assertThat(checkResults).isEmpty(); } @@ -119,7 +120,7 @@ void testTypeMatchable(final String code) { Collections.emptyList(), List.of(TypeString.ofIdentifier("parent", "user")), Collections.emptySet())); - final ComparedTypesDoNotMatchTypedCheck check = new ComparedTypesDoNotMatchTypedCheck(); + final MagikTypedCheck check = new ComparedTypesDoNotMatchTypedCheck(); final List checkResults = this.runCheck(code, definitionKeeper, check); assertThat(checkResults).isEmpty(); } @@ -163,7 +164,7 @@ void testTypeMatchable(final String code) { }) void testTypeNotMatchable(final String code) { final IDefinitionKeeper definitionKeeper = new DefinitionKeeper(); - final ComparedTypesDoNotMatchTypedCheck check = new ComparedTypesDoNotMatchTypedCheck(); + final MagikTypedCheck check = new ComparedTypesDoNotMatchTypedCheck(); final List checkResults = this.runCheck(code, definitionKeeper, check); assertThat(checkResults).hasSize(1); } diff --git a/magik-typed-checks/src/test/java/nl/ramsolutions/sw/magik/typedchecks/checks/DeprecatedMethodUsageTypedCheckTest.java b/magik-typed-checks/src/test/java/nl/ramsolutions/sw/magik/typedchecks/checks/DeprecatedMethodUsageTypedCheckTest.java index 362412bdd..c6b7bd10f 100644 --- a/magik-typed-checks/src/test/java/nl/ramsolutions/sw/magik/typedchecks/checks/DeprecatedMethodUsageTypedCheckTest.java +++ b/magik-typed-checks/src/test/java/nl/ramsolutions/sw/magik/typedchecks/checks/DeprecatedMethodUsageTypedCheckTest.java @@ -12,6 +12,7 @@ import nl.ramsolutions.sw.magik.analysis.typing.ExpressionResultString; import nl.ramsolutions.sw.magik.analysis.typing.TypeString; import nl.ramsolutions.sw.magik.checks.MagikIssue; +import nl.ramsolutions.sw.magik.typedchecks.MagikTypedCheck; import org.junit.jupiter.api.Test; /** Test {@link DeprecatedMethodUsageTypedCheck}. */ @@ -45,7 +46,7 @@ void testMethodDeprecated() { _block object.m() _endblock"""; - final DeprecatedMethodUsageTypedCheck check = new DeprecatedMethodUsageTypedCheck(); + final MagikTypedCheck check = new DeprecatedMethodUsageTypedCheck(); final List issues = this.runCheck(code, definitionKeeper, check); assertThat(issues).hasSize(1); } @@ -59,7 +60,7 @@ void testMethodNotDeprecated() { _block object.m() _endblock"""; - final DeprecatedMethodUsageTypedCheck check = new DeprecatedMethodUsageTypedCheck(); + final MagikTypedCheck check = new DeprecatedMethodUsageTypedCheck(); final List issues = this.runCheck(code, definitionKeeper, check); assertThat(issues).isEmpty(); } diff --git a/magik-typed-checks/src/test/java/nl/ramsolutions/sw/magik/typedchecks/checks/DeprecatedTypeUsageTypedCheckTest.java b/magik-typed-checks/src/test/java/nl/ramsolutions/sw/magik/typedchecks/checks/DeprecatedTypeUsageTypedCheckTest.java index ebff71ece..b9692dd71 100644 --- a/magik-typed-checks/src/test/java/nl/ramsolutions/sw/magik/typedchecks/checks/DeprecatedTypeUsageTypedCheckTest.java +++ b/magik-typed-checks/src/test/java/nl/ramsolutions/sw/magik/typedchecks/checks/DeprecatedTypeUsageTypedCheckTest.java @@ -10,6 +10,7 @@ import nl.ramsolutions.sw.magik.analysis.definitions.IDefinitionKeeper; import nl.ramsolutions.sw.magik.analysis.typing.TypeString; import nl.ramsolutions.sw.magik.checks.MagikIssue; +import nl.ramsolutions.sw.magik.typedchecks.MagikTypedCheck; import org.junit.jupiter.api.Test; /** Test {@link DeprecatedTypeUsageTypedCheck}. */ @@ -41,7 +42,7 @@ void testTypeDeprecated() { _block user:test.m() _endblock"""; - final DeprecatedTypeUsageTypedCheck check = new DeprecatedTypeUsageTypedCheck(); + final MagikTypedCheck check = new DeprecatedTypeUsageTypedCheck(); final List issues = this.runCheck(code, definitionKeeper, check); assertThat(issues).hasSize(1); } @@ -56,7 +57,7 @@ void testTypeNotDeprecated() { _block user:test.m() _endblock"""; - final DeprecatedTypeUsageTypedCheck check = new DeprecatedTypeUsageTypedCheck(); + final MagikTypedCheck check = new DeprecatedTypeUsageTypedCheck(); final List issues = this.runCheck(code, definitionKeeper, check); assertThat(issues).isEmpty(); } diff --git a/magik-typed-checks/src/test/java/nl/ramsolutions/sw/magik/typedchecks/checks/GlobalExistsTypedCheckTest.java b/magik-typed-checks/src/test/java/nl/ramsolutions/sw/magik/typedchecks/checks/GlobalExistsTypedCheckTest.java index b9b5063c2..1a66df647 100644 --- a/magik-typed-checks/src/test/java/nl/ramsolutions/sw/magik/typedchecks/checks/GlobalExistsTypedCheckTest.java +++ b/magik-typed-checks/src/test/java/nl/ramsolutions/sw/magik/typedchecks/checks/GlobalExistsTypedCheckTest.java @@ -6,6 +6,7 @@ import nl.ramsolutions.sw.magik.analysis.definitions.DefinitionKeeper; import nl.ramsolutions.sw.magik.analysis.definitions.IDefinitionKeeper; import nl.ramsolutions.sw.magik.checks.MagikIssue; +import nl.ramsolutions.sw.magik.typedchecks.MagikTypedCheck; import org.junit.jupiter.api.Test; /** Test {@link GlobalExistsTypedCheck}. */ @@ -16,7 +17,7 @@ void testKnownGlobal() { final String code = "float.m"; final IDefinitionKeeper definitionKeeper = new DefinitionKeeper(); - final GlobalExistsTypedCheck check = new GlobalExistsTypedCheck(); + final MagikTypedCheck check = new GlobalExistsTypedCheck(); final List checkResults = this.runCheck(code, definitionKeeper, check); assertThat(checkResults).isEmpty(); } @@ -26,7 +27,7 @@ void testUnknownGlobal() { final String code = "abc.m"; final IDefinitionKeeper definitionKeeper = new DefinitionKeeper(); - final GlobalExistsTypedCheck check = new GlobalExistsTypedCheck(); + final MagikTypedCheck check = new GlobalExistsTypedCheck(); final List checkResults = this.runCheck(code, definitionKeeper, check); assertThat(checkResults).hasSize(1); } diff --git a/magik-typed-checks/src/test/java/nl/ramsolutions/sw/magik/typedchecks/checks/MethodExistsTypedCheckTest.java b/magik-typed-checks/src/test/java/nl/ramsolutions/sw/magik/typedchecks/checks/MethodExistsTypedCheckTest.java index 3a5d3bc35..809fa196b 100644 --- a/magik-typed-checks/src/test/java/nl/ramsolutions/sw/magik/typedchecks/checks/MethodExistsTypedCheckTest.java +++ b/magik-typed-checks/src/test/java/nl/ramsolutions/sw/magik/typedchecks/checks/MethodExistsTypedCheckTest.java @@ -11,6 +11,7 @@ import nl.ramsolutions.sw.magik.analysis.typing.ExpressionResultString; import nl.ramsolutions.sw.magik.analysis.typing.TypeString; import nl.ramsolutions.sw.magik.checks.MagikIssue; +import nl.ramsolutions.sw.magik.typedchecks.MagikTypedCheck; import org.junit.jupiter.api.Test; /** Test MethodExistsTypedCheck. */ @@ -24,7 +25,7 @@ void testMethodUnknown() { object.m() _endblock"""; final IDefinitionKeeper definitionKeeper = new DefinitionKeeper(); - final MethodExistsTypedCheck check = new MethodExistsTypedCheck(); + final MagikTypedCheck check = new MethodExistsTypedCheck(); final List issues = this.runCheck(code, definitionKeeper, check); assertThat(issues).hasSize(1); } @@ -52,7 +53,7 @@ void testMethodKnown() { Collections.emptySet(), new ExpressionResultString(TypeString.SW_OBJECT), ExpressionResultString.EMPTY)); - final MethodExistsTypedCheck check = new MethodExistsTypedCheck(); + final MagikTypedCheck check = new MethodExistsTypedCheck(); final List issues = this.runCheck(code, definitionKeeper, check); assertThat(issues).isEmpty(); } diff --git a/magik-typed-checks/src/test/java/nl/ramsolutions/sw/magik/typedchecks/checks/MethodReturnTypesMatchDocTypedCheckTest.java b/magik-typed-checks/src/test/java/nl/ramsolutions/sw/magik/typedchecks/checks/MethodReturnTypesMatchDocTypedCheckTest.java index 2bf96ca33..3dbb3b0a5 100644 --- a/magik-typed-checks/src/test/java/nl/ramsolutions/sw/magik/typedchecks/checks/MethodReturnTypesMatchDocTypedCheckTest.java +++ b/magik-typed-checks/src/test/java/nl/ramsolutions/sw/magik/typedchecks/checks/MethodReturnTypesMatchDocTypedCheckTest.java @@ -6,6 +6,7 @@ import nl.ramsolutions.sw.magik.analysis.definitions.DefinitionKeeper; import nl.ramsolutions.sw.magik.analysis.definitions.IDefinitionKeeper; import nl.ramsolutions.sw.magik.checks.MagikIssue; +import nl.ramsolutions.sw.magik.typedchecks.MagikTypedCheck; import org.junit.jupiter.api.Test; /** Tests for {@link MethodReturnTypesMatchDocTypedCheck}. */ @@ -21,7 +22,7 @@ void testTypesMatches() { _endmethod """; final IDefinitionKeeper definitionKeeper = new DefinitionKeeper(); - final MethodReturnTypesMatchDocTypedCheck check = new MethodReturnTypesMatchDocTypedCheck(); + final MagikTypedCheck check = new MethodReturnTypesMatchDocTypedCheck(); final List issues = this.runCheck(code, definitionKeeper, check); assertThat(issues).isEmpty(); } @@ -36,7 +37,7 @@ void testTypesDiffer() { _endmethod """; final IDefinitionKeeper definitionKeeper = new DefinitionKeeper(); - final MethodReturnTypesMatchDocTypedCheck check = new MethodReturnTypesMatchDocTypedCheck(); + final MagikTypedCheck check = new MethodReturnTypesMatchDocTypedCheck(); final List issues = this.runCheck(code, definitionKeeper, check); assertThat(issues).hasSize(1); } @@ -50,7 +51,7 @@ void testIgnoreAbstractMethod() { _endmethod """; final IDefinitionKeeper definitionKeeper = new DefinitionKeeper(); - final MethodReturnTypesMatchDocTypedCheck check = new MethodReturnTypesMatchDocTypedCheck(); + final MagikTypedCheck check = new MethodReturnTypesMatchDocTypedCheck(); final List issues = this.runCheck(code, definitionKeeper, check); assertThat(issues).isEmpty(); } diff --git a/magik-typed-checks/src/test/java/nl/ramsolutions/sw/magik/typedchecks/checks/ModuleRequiredForGlobalTypedCheckTest.java b/magik-typed-checks/src/test/java/nl/ramsolutions/sw/magik/typedchecks/checks/ModuleRequiredForGlobalTypedCheckTest.java index 8284cc072..1886fda10 100644 --- a/magik-typed-checks/src/test/java/nl/ramsolutions/sw/magik/typedchecks/checks/ModuleRequiredForGlobalTypedCheckTest.java +++ b/magik-typed-checks/src/test/java/nl/ramsolutions/sw/magik/typedchecks/checks/ModuleRequiredForGlobalTypedCheckTest.java @@ -11,6 +11,7 @@ import nl.ramsolutions.sw.magik.analysis.definitions.IDefinitionKeeper; import nl.ramsolutions.sw.magik.analysis.typing.TypeString; import nl.ramsolutions.sw.magik.checks.MagikIssue; +import nl.ramsolutions.sw.magik.typedchecks.MagikTypedCheck; import nl.ramsolutions.sw.moduledef.ModuleDefFile; import nl.ramsolutions.sw.moduledef.ModuleDefFileScanner; import nl.ramsolutions.sw.moduledef.ModuleDefinition; @@ -60,7 +61,7 @@ void testModuleIsRequired() throws IllegalArgumentException, IOException { Collections.emptyList(), Collections.emptySet())); - final ModuleRequiredForGlobalTypedCheck check = new ModuleRequiredForGlobalTypedCheck(); + final MagikTypedCheck check = new ModuleRequiredForGlobalTypedCheck(); final List checkResults = this.runCheck(path, definitionKeeper, check); assertThat(checkResults).isEmpty(); } @@ -92,7 +93,7 @@ void testModuleIsNotRequired() throws IllegalArgumentException, IOException { Collections.emptyList(), Collections.emptySet())); - final ModuleRequiredForGlobalTypedCheck check = new ModuleRequiredForGlobalTypedCheck(); + final MagikTypedCheck check = new ModuleRequiredForGlobalTypedCheck(); final List checkResults = this.runCheck(path, definitionKeeper, check); assertThat(checkResults).hasSize(1); } diff --git a/magik-typed-checks/src/test/java/nl/ramsolutions/sw/magik/typedchecks/checks/SlotExistsTypedCheckTest.java b/magik-typed-checks/src/test/java/nl/ramsolutions/sw/magik/typedchecks/checks/SlotExistsTypedCheckTest.java index 4771062f1..4ef274b73 100644 --- a/magik-typed-checks/src/test/java/nl/ramsolutions/sw/magik/typedchecks/checks/SlotExistsTypedCheckTest.java +++ b/magik-typed-checks/src/test/java/nl/ramsolutions/sw/magik/typedchecks/checks/SlotExistsTypedCheckTest.java @@ -10,6 +10,7 @@ import nl.ramsolutions.sw.magik.analysis.definitions.SlotDefinition; import nl.ramsolutions.sw.magik.analysis.typing.TypeString; import nl.ramsolutions.sw.magik.checks.MagikIssue; +import nl.ramsolutions.sw.magik.typedchecks.MagikTypedCheck; import org.junit.jupiter.api.Test; /** Test {@link SlotExistsTypedCheck}. */ @@ -24,7 +25,7 @@ void testTypeUnknown() { _endmethod """; final IDefinitionKeeper definitionKeeper = new DefinitionKeeper(); - final SlotExistsTypedCheck check = new SlotExistsTypedCheck(); + final MagikTypedCheck check = new SlotExistsTypedCheck(); final List issues = this.runCheck(code, definitionKeeper, check); assertThat(issues).isEmpty(); } @@ -38,7 +39,7 @@ void testSlotUnknown() { _endmethod """; final IDefinitionKeeper definitionKeeper = new DefinitionKeeper(); - final SlotExistsTypedCheck check = new SlotExistsTypedCheck(); + final MagikTypedCheck check = new SlotExistsTypedCheck(); final List issues = this.runCheck(code, definitionKeeper, check); assertThat(issues).hasSize(1); } @@ -65,7 +66,7 @@ void testSlotKnown() { List.of(new SlotDefinition(null, null, null, null, null, "slot", TypeString.UNDEFINED)), Collections.emptyList(), Collections.emptySet())); - final SlotExistsTypedCheck check = new SlotExistsTypedCheck(); + final MagikTypedCheck check = new SlotExistsTypedCheck(); final List issues = this.runCheck(code, definitionKeeper, check); assertThat(issues).isEmpty(); } diff --git a/magik-typed-checks/src/test/java/nl/ramsolutions/sw/magik/typedchecks/checks/TypeDocTypeExistsTypedCheckTest.java b/magik-typed-checks/src/test/java/nl/ramsolutions/sw/magik/typedchecks/checks/TypeDocTypeExistsTypedCheckTest.java index 3983b82e6..f0f1f74ec 100644 --- a/magik-typed-checks/src/test/java/nl/ramsolutions/sw/magik/typedchecks/checks/TypeDocTypeExistsTypedCheckTest.java +++ b/magik-typed-checks/src/test/java/nl/ramsolutions/sw/magik/typedchecks/checks/TypeDocTypeExistsTypedCheckTest.java @@ -6,6 +6,7 @@ import nl.ramsolutions.sw.magik.analysis.definitions.DefinitionKeeper; import nl.ramsolutions.sw.magik.analysis.definitions.IDefinitionKeeper; import nl.ramsolutions.sw.magik.checks.MagikIssue; +import nl.ramsolutions.sw.magik.typedchecks.MagikTypedCheck; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; @@ -33,7 +34,7 @@ class TypeDocTypeExistsTypedCheckTest extends MagikTypedCheckTestBase { }) void testInvalid(final String code) { final IDefinitionKeeper definitionKeeper = new DefinitionKeeper(); - final TypeDocTypeExistsTypedCheck check = new TypeDocTypeExistsTypedCheck(); + final MagikTypedCheck check = new TypeDocTypeExistsTypedCheck(); final List issues = this.runCheck(code, definitionKeeper, check); assertThat(issues).hasSize(1); } @@ -54,7 +55,7 @@ void testInvalid(final String code) { }) void testValid(final String code) { final IDefinitionKeeper definitionKeeper = new DefinitionKeeper(); - final TypeDocTypeExistsTypedCheck check = new TypeDocTypeExistsTypedCheck(); + final MagikTypedCheck check = new TypeDocTypeExistsTypedCheck(); final List issues = this.runCheck(code, definitionKeeper, check); assertThat(issues).isEmpty(); } diff --git a/magik-typed-checks/src/test/java/nl/ramsolutions/sw/magik/typedchecks/checks/UndefinedMethodCallResultTypedCheckTest.java b/magik-typed-checks/src/test/java/nl/ramsolutions/sw/magik/typedchecks/checks/UndefinedMethodCallResultTypedCheckTest.java index 1a58259ef..f7ba320d1 100644 --- a/magik-typed-checks/src/test/java/nl/ramsolutions/sw/magik/typedchecks/checks/UndefinedMethodCallResultTypedCheckTest.java +++ b/magik-typed-checks/src/test/java/nl/ramsolutions/sw/magik/typedchecks/checks/UndefinedMethodCallResultTypedCheckTest.java @@ -11,6 +11,7 @@ import nl.ramsolutions.sw.magik.analysis.typing.ExpressionResultString; import nl.ramsolutions.sw.magik.analysis.typing.TypeString; import nl.ramsolutions.sw.magik.checks.MagikIssue; +import nl.ramsolutions.sw.magik.typedchecks.MagikTypedCheck; import org.junit.jupiter.api.Test; /** Test {@link UndefinedMethodCallResultTypedCheck}. */ @@ -25,7 +26,7 @@ void testMethodInvocationOnUndefined() { _endblock """; final IDefinitionKeeper definitionKeeper = new DefinitionKeeper(); - final UndefinedMethodCallResultTypedCheck check = new UndefinedMethodCallResultTypedCheck(); + final MagikTypedCheck check = new UndefinedMethodCallResultTypedCheck(); final List issues = this.runCheck(code, definitionKeeper, check); assertThat(issues).isEmpty(); } @@ -39,7 +40,7 @@ void testMethodInvocationUndefined() { _endblock """; final IDefinitionKeeper definitionKeeper = new DefinitionKeeper(); - final UndefinedMethodCallResultTypedCheck check = new UndefinedMethodCallResultTypedCheck(); + final MagikTypedCheck check = new UndefinedMethodCallResultTypedCheck(); final List issues = this.runCheck(code, definitionKeeper, check); assertThat(issues).isEmpty(); } @@ -69,7 +70,7 @@ void testMethodInvocationDefined() { new ExpressionResultString(TypeString.SW_OBJECT), ExpressionResultString.EMPTY)); - final UndefinedMethodCallResultTypedCheck check = new UndefinedMethodCallResultTypedCheck(); + final MagikTypedCheck check = new UndefinedMethodCallResultTypedCheck(); final List issues = this.runCheck(code, definitionKeeper, check); assertThat(issues).isEmpty(); } @@ -99,7 +100,7 @@ void testMethodInvocationUndefinedResults() { ExpressionResultString.UNDEFINED, ExpressionResultString.EMPTY)); - final UndefinedMethodCallResultTypedCheck check = new UndefinedMethodCallResultTypedCheck(); + final MagikTypedCheck check = new UndefinedMethodCallResultTypedCheck(); final List issues = this.runCheck(code, definitionKeeper, check); assertThat(issues).hasSize(1); }