diff --git a/pmd-apex/pom.xml b/pmd-apex/pom.xml index 8e607d3441..9e1d37e0be 100644 --- a/pmd-apex/pom.xml +++ b/pmd-apex/pom.xml @@ -72,11 +72,6 @@ hamcrest test - - junit - junit - test - org.junit.jupiter junit-jupiter diff --git a/pmd-cpp/pom.xml b/pmd-cpp/pom.xml index 06093bc6d9..beb01403db 100644 --- a/pmd-cpp/pom.xml +++ b/pmd-cpp/pom.xml @@ -74,8 +74,8 @@ - junit - junit + org.junit.jupiter + junit-jupiter test diff --git a/pmd-cpp/src/test/java/net/sourceforge/pmd/cpd/CPPTokenizerTest.java b/pmd-cpp/src/test/java/net/sourceforge/pmd/cpd/CPPTokenizerTest.java index 899f7f3af8..b4746b7f64 100644 --- a/pmd-cpp/src/test/java/net/sourceforge/pmd/cpd/CPPTokenizerTest.java +++ b/pmd-cpp/src/test/java/net/sourceforge/pmd/cpd/CPPTokenizerTest.java @@ -4,17 +4,17 @@ package net.sourceforge.pmd.cpd; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.util.Properties; -import org.junit.Test; +import org.junit.jupiter.api.Test; import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest; -public class CPPTokenizerTest extends CpdTextComparisonTest { +class CPPTokenizerTest extends CpdTextComparisonTest { - public CPPTokenizerTest() { + CPPTokenizerTest() { super(".cpp"); } @@ -36,106 +36,106 @@ public class CPPTokenizerTest extends CpdTextComparisonTest { } @Test - public void testUTFwithBOM() { + void testUTFwithBOM() { Tokenizer tokenizer = newTokenizer(dontSkipBlocks()); Tokens tokens = tokenize(tokenizer, "\ufeffint start()\n{ int ret = 1;\nreturn ret;\n}\n"); assertEquals(15, tokens.size()); } @Test - public void testContinuation() { + void testContinuation() { doTest("continuation"); } @Test - public void testContinuationInIdent() { + void testContinuationInIdent() { doTest("continuation_intra_token"); } @Test - public void testContinuationBetweenTokens() { + void testContinuationBetweenTokens() { doTest("continuation_inter_token"); } @Test - public void testUnicodeStringSupport() { + void testUnicodeStringSupport() { doTest("unicodeStrings"); } @Test - public void testIgnoreBetweenSpecialComments() { + void testIgnoreBetweenSpecialComments() { doTest("specialComments"); } @Test - public void testMultiLineMacros() { + void testMultiLineMacros() { doTest("multilineMacros"); } @Test - public void testIdentifierValidChars() { + void testIdentifierValidChars() { doTest("identifierChars"); } @Test - public void testWrongUnicodeInIdentifier() { + void testWrongUnicodeInIdentifier() { expectTokenMgrError(" void main() { int ⚜ = __; }"); } @Test - public void testTokenizerWithSkipBlocks() { + void testTokenizerWithSkipBlocks() { doTest("simpleSkipBlocks", "_skipDefault", skipBlocks()); } @Test - public void testTokenizerWithSkipBlocksPattern() { + void testTokenizerWithSkipBlocksPattern() { doTest("simpleSkipBlocks", "_skipDebug", skipBlocks("#if debug|#endif")); } @Test - public void testTokenizerWithoutSkipBlocks() { + void testTokenizerWithoutSkipBlocks() { doTest("simpleSkipBlocks", "_noSkip", dontSkipBlocks()); } @Test - public void testAsm() { + void testAsm() { // ASM code containing the '@' character doTest("asm", "", dontSkipBlocks()); } @Test - public void testPreprocessingDirectives() { + void testPreprocessingDirectives() { doTest("preprocessorDirectives"); } @Test - public void testLiterals() { + void testLiterals() { doTest("literals"); } @Test - public void testLexicalErrorFilename() { + void testLexicalErrorFilename() { expectTokenMgrError(sourceText("issue-1559"), dontSkipBlocks()); } @Test - public void testRawStringLiterals() { + void testRawStringLiterals() { doTest("issue-1784"); } @Test - public void testTabWidth() { + void testTabWidth() { doTest("tabWidth"); } @Test - public void testLongListsOfNumbersAreNotIgnored() { + void testLongListsOfNumbersAreNotIgnored() { doTest("listOfNumbers"); } @Test - public void testLongListsOfNumbersAreIgnored() { + void testLongListsOfNumbersAreIgnored() { doTest("listOfNumbers", "_ignored", skipLiteralSequences()); } diff --git a/pmd-cpp/src/test/java/net/sourceforge/pmd/lang/cpp/ast/CppCharStreamTest.java b/pmd-cpp/src/test/java/net/sourceforge/pmd/lang/cpp/ast/CppCharStreamTest.java index 49b256550b..aa2243a3cd 100644 --- a/pmd-cpp/src/test/java/net/sourceforge/pmd/lang/cpp/ast/CppCharStreamTest.java +++ b/pmd-cpp/src/test/java/net/sourceforge/pmd/lang/cpp/ast/CppCharStreamTest.java @@ -4,29 +4,29 @@ package net.sourceforge.pmd.lang.cpp.ast; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.io.IOException; import java.io.StringReader; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class CppCharStreamTest { +class CppCharStreamTest { @Test - public void testContinuationUnix() throws IOException { + void testContinuationUnix() throws IOException { CppCharStream stream = CppCharStream.newCppCharStream(new StringReader("a\\\nb")); assertStream(stream, "ab"); } @Test - public void testContinuationWindows() throws IOException { + void testContinuationWindows() throws IOException { CppCharStream stream = CppCharStream.newCppCharStream(new StringReader("a\\\r\nb")); assertStream(stream, "ab"); } @Test - public void testBackup() throws IOException { + void testBackup() throws IOException { CppCharStream stream = CppCharStream.newCppCharStream(new StringReader("a\\b\\\rc")); assertStream(stream, "a\\b\\\rc"); }