From 5005ae56cb23e923a79a3ed075962b7a5195db9b Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Mon, 3 Oct 2022 10:25:24 +0200 Subject: [PATCH] [velocity] Migrate tests to JUnit5 --- pmd-vm/pom.xml | 4 ++-- .../java/net/sourceforge/pmd/lang/vm/VmParserTest.java | 10 +++++----- .../bestpractices/AvoidReassigningParametersTest.java | 2 +- .../rule/bestpractices/UnusedMacroParameterTest.java | 2 +- .../vm/rule/design/AvoidDeeplyNestedIfStmtsTest.java | 2 +- .../vm/rule/design/CollapsibleIfStatementsTest.java | 2 +- .../vm/rule/design/ExcessiveTemplateLengthTest.java | 2 +- .../lang/vm/rule/design/NoInlineJavaScriptTest.java | 2 +- .../pmd/lang/vm/rule/design/NoInlineStylesTest.java | 2 +- .../lang/vm/rule/errorprone/EmptyForeachStmtTest.java | 2 +- .../pmd/lang/vm/rule/errorprone/EmptyIfStmtTest.java | 2 +- 11 files changed, 16 insertions(+), 16 deletions(-) diff --git a/pmd-vm/pom.xml b/pmd-vm/pom.xml index b2a7c48e4e..493832e65d 100644 --- a/pmd-vm/pom.xml +++ b/pmd-vm/pom.xml @@ -91,8 +91,8 @@ - junit - junit + org.junit.jupiter + junit-jupiter test diff --git a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/VmParserTest.java b/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/VmParserTest.java index 5a9fa53587..8351901201 100644 --- a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/VmParserTest.java +++ b/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/VmParserTest.java @@ -4,14 +4,14 @@ package net.sourceforge.pmd.lang.vm; -import org.junit.Test; +import org.junit.jupiter.api.Test; import net.sourceforge.pmd.lang.vm.ast.VmParsingHelper; /** * Unit test for VM parsing. */ -public class VmParserTest { +class VmParserTest { private static final String VM_SRC = "Hello $customer.Name " + "#foreach($mud in $mudsOnSpecial)" + " #if ( $customer.hasPurchased($mud) )" + " " + "
" @@ -29,17 +29,17 @@ public class VmParserTest { // 2) stuff #end #end"; @Test - public void testParser() { + void testParser() { VmParsingHelper.DEFAULT.parse(VM_SRC); } @Test - public void testParser2() { + void testParser2() { VmParsingHelper.DEFAULT.parse(SRC2); } @Test - public void testParser3() { + void testParser3() { VmParsingHelper.DEFAULT.parse(SRC3); } diff --git a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/bestpractices/AvoidReassigningParametersTest.java b/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/bestpractices/AvoidReassigningParametersTest.java index f2ad8234e9..4fb9224dae 100644 --- a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/bestpractices/AvoidReassigningParametersTest.java +++ b/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/bestpractices/AvoidReassigningParametersTest.java @@ -6,6 +6,6 @@ package net.sourceforge.pmd.lang.vm.rule.bestpractices; import net.sourceforge.pmd.testframework.PmdRuleTst; -public class AvoidReassigningParametersTest extends PmdRuleTst { +class AvoidReassigningParametersTest extends PmdRuleTst { // no additional unit tests } diff --git a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/bestpractices/UnusedMacroParameterTest.java b/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/bestpractices/UnusedMacroParameterTest.java index 7c21276a2a..997bea144e 100644 --- a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/bestpractices/UnusedMacroParameterTest.java +++ b/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/bestpractices/UnusedMacroParameterTest.java @@ -6,6 +6,6 @@ package net.sourceforge.pmd.lang.vm.rule.bestpractices; import net.sourceforge.pmd.testframework.PmdRuleTst; -public class UnusedMacroParameterTest extends PmdRuleTst { +class UnusedMacroParameterTest extends PmdRuleTst { // no additional unit tests } diff --git a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/AvoidDeeplyNestedIfStmtsTest.java b/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/AvoidDeeplyNestedIfStmtsTest.java index 6fabea1dda..698bc4711f 100644 --- a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/AvoidDeeplyNestedIfStmtsTest.java +++ b/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/AvoidDeeplyNestedIfStmtsTest.java @@ -6,6 +6,6 @@ package net.sourceforge.pmd.lang.vm.rule.design; import net.sourceforge.pmd.testframework.PmdRuleTst; -public class AvoidDeeplyNestedIfStmtsTest extends PmdRuleTst { +class AvoidDeeplyNestedIfStmtsTest extends PmdRuleTst { // no additional unit tests } diff --git a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/CollapsibleIfStatementsTest.java b/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/CollapsibleIfStatementsTest.java index 09e81ec347..9eb705dabb 100644 --- a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/CollapsibleIfStatementsTest.java +++ b/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/CollapsibleIfStatementsTest.java @@ -6,6 +6,6 @@ package net.sourceforge.pmd.lang.vm.rule.design; import net.sourceforge.pmd.testframework.PmdRuleTst; -public class CollapsibleIfStatementsTest extends PmdRuleTst { +class CollapsibleIfStatementsTest extends PmdRuleTst { // no additional unit tests } diff --git a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/ExcessiveTemplateLengthTest.java b/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/ExcessiveTemplateLengthTest.java index b37cdfeb19..64142b26ca 100644 --- a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/ExcessiveTemplateLengthTest.java +++ b/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/ExcessiveTemplateLengthTest.java @@ -6,6 +6,6 @@ package net.sourceforge.pmd.lang.vm.rule.design; import net.sourceforge.pmd.testframework.PmdRuleTst; -public class ExcessiveTemplateLengthTest extends PmdRuleTst { +class ExcessiveTemplateLengthTest extends PmdRuleTst { // no additional unit tests } diff --git a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/NoInlineJavaScriptTest.java b/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/NoInlineJavaScriptTest.java index 6e1bbc8620..42a2739945 100644 --- a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/NoInlineJavaScriptTest.java +++ b/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/NoInlineJavaScriptTest.java @@ -6,6 +6,6 @@ package net.sourceforge.pmd.lang.vm.rule.design; import net.sourceforge.pmd.testframework.PmdRuleTst; -public class NoInlineJavaScriptTest extends PmdRuleTst { +class NoInlineJavaScriptTest extends PmdRuleTst { // no additional unit tests } diff --git a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/NoInlineStylesTest.java b/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/NoInlineStylesTest.java index 244567d2fd..2d5c7b65b4 100644 --- a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/NoInlineStylesTest.java +++ b/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/design/NoInlineStylesTest.java @@ -6,6 +6,6 @@ package net.sourceforge.pmd.lang.vm.rule.design; import net.sourceforge.pmd.testframework.PmdRuleTst; -public class NoInlineStylesTest extends PmdRuleTst { +class NoInlineStylesTest extends PmdRuleTst { // no additional unit tests } diff --git a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/errorprone/EmptyForeachStmtTest.java b/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/errorprone/EmptyForeachStmtTest.java index 9429d3cdf2..56a4b90477 100644 --- a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/errorprone/EmptyForeachStmtTest.java +++ b/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/errorprone/EmptyForeachStmtTest.java @@ -6,6 +6,6 @@ package net.sourceforge.pmd.lang.vm.rule.errorprone; import net.sourceforge.pmd.testframework.PmdRuleTst; -public class EmptyForeachStmtTest extends PmdRuleTst { +class EmptyForeachStmtTest extends PmdRuleTst { // no additional unit tests } diff --git a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/errorprone/EmptyIfStmtTest.java b/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/errorprone/EmptyIfStmtTest.java index 2583b7581b..63fe618db2 100644 --- a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/errorprone/EmptyIfStmtTest.java +++ b/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/rule/errorprone/EmptyIfStmtTest.java @@ -6,6 +6,6 @@ package net.sourceforge.pmd.lang.vm.rule.errorprone; import net.sourceforge.pmd.testframework.PmdRuleTst; -public class EmptyIfStmtTest extends PmdRuleTst { +class EmptyIfStmtTest extends PmdRuleTst { // no additional unit tests }