This is an automated email from the ASF dual-hosted git repository. slachiewicz pushed a commit to branch MCLEAN-106 in repository https://gitbox.apache.org/repos/asf/maven-clean-plugin.git
commit 59aefbef0f98dae3a5ce83ea8c5bdeb259e279cd Author: Sylwester Lachiewicz <[email protected]> AuthorDate: Wed Jun 7 18:31:23 2023 +0200 [MCLEAN-106] Switch to JUnit5 --- pom.xml | 23 +++++++++++++----- .../apache/maven/plugins/clean/CleanMojoTest.java | 27 ++++++++++++++-------- 2 files changed, 35 insertions(+), 15 deletions(-) diff --git a/pom.xml b/pom.xml index 03220fc..7d43a7d 100644 --- a/pom.xml +++ b/pom.xml @@ -65,6 +65,18 @@ under the License. <project.build.outputTimestamp>2022-04-01T21:20:42Z</project.build.outputTimestamp> </properties> + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.junit</groupId> + <artifactId>junit-bom</artifactId> + <version>5.9.3</version> + <type>pom</type> + <scope>import</scope> + </dependency> + </dependencies> + </dependencyManagement> + <dependencies> <dependency> <groupId>org.apache.maven</groupId> @@ -92,6 +104,11 @@ under the License. <version>3.3.0</version> <scope>test</scope> </dependency> + <dependency> + <groupId>org.junit.jupiter</groupId> + <artifactId>junit-jupiter</artifactId> + <scope>test</scope> + </dependency> <dependency> <groupId>org.apache.maven</groupId> <artifactId>maven-compat</artifactId> @@ -104,12 +121,6 @@ under the License. <version>${mavenVersion}</version> <scope>provided</scope> </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.13.2</version> - <scope>test</scope> - </dependency> </dependencies> <profiles> diff --git a/src/test/java/org/apache/maven/plugins/clean/CleanMojoTest.java b/src/test/java/org/apache/maven/plugins/clean/CleanMojoTest.java index 48fa782..d46aab0 100644 --- a/src/test/java/org/apache/maven/plugins/clean/CleanMojoTest.java +++ b/src/test/java/org/apache/maven/plugins/clean/CleanMojoTest.java @@ -25,6 +25,7 @@ import java.nio.channels.FileLock; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.testing.AbstractMojoTestCase; +import org.junit.jupiter.api.Test; import static org.apache.commons.io.FileUtils.copyDirectory; @@ -33,13 +34,14 @@ import static org.apache.commons.io.FileUtils.copyDirectory; * * @author <a href="mailto:[email protected]">Vincent Siveton</a> */ -public class CleanMojoTest extends AbstractMojoTestCase { +class CleanMojoTest extends AbstractMojoTestCase { /** * Tests the simple removal of directories * * @throws Exception in case of an error. */ - public void testBasicClean() throws Exception { + @Test + void testBasicClean() throws Exception { String pluginPom = getBasedir() + "/src/test/resources/unit/basic-clean-test/plugin-pom.xml"; // safety @@ -68,7 +70,8 @@ public class CleanMojoTest extends AbstractMojoTestCase { * * @throws Exception in case of an error. */ - public void testCleanNestedStructure() throws Exception { + @Test + void testCleanNestedStructure() throws Exception { String pluginPom = getBasedir() + "/src/test/resources/unit/nested-clean-test/plugin-pom.xml"; // safety @@ -92,7 +95,8 @@ public class CleanMojoTest extends AbstractMojoTestCase { * * @throws Exception in case of an error. */ - public void testCleanEmptyDirectories() throws Exception { + @Test + void testCleanEmptyDirectories() throws Exception { String pluginPom = getBasedir() + "/src/test/resources/unit/empty-clean-test/plugin-pom.xml"; // safety @@ -119,7 +123,8 @@ public class CleanMojoTest extends AbstractMojoTestCase { * * @throws Exception in case of an error. */ - public void testFilesetsClean() throws Exception { + @Test + void testFilesetsClean() throws Exception { String pluginPom = getBasedir() + "/src/test/resources/unit/fileset-clean-test/plugin-pom.xml"; // safety @@ -154,7 +159,8 @@ public class CleanMojoTest extends AbstractMojoTestCase { * * @throws Exception in case of an error. */ - public void testCleanInvalidDirectory() throws Exception { + @Test + void testCleanInvalidDirectory() throws Exception { String pluginPom = getBasedir() + "/src/test/resources/unit/invalid-directory-test/plugin-pom.xml"; // safety @@ -179,7 +185,8 @@ public class CleanMojoTest extends AbstractMojoTestCase { * * @throws Exception in case of an error. */ - public void testMissingDirectory() throws Exception { + @Test + void testMissingDirectory() throws Exception { String pluginPom = getBasedir() + "/src/test/resources/unit/missing-directory-test/plugin-pom.xml"; // safety @@ -203,7 +210,8 @@ public class CleanMojoTest extends AbstractMojoTestCase { * * @throws Exception in case of an error. */ - public void testCleanLockedFile() throws Exception { + @Test + void testCleanLockedFile() throws Exception { if (!System.getProperty("os.name").toLowerCase().contains("windows")) { assertTrue("Ignored this test on none Windows based systems", true); return; @@ -237,7 +245,8 @@ public class CleanMojoTest extends AbstractMojoTestCase { * * @throws Exception in case of an error. */ - public void testCleanLockedFileWithNoError() throws Exception { + @Test + void testCleanLockedFileWithNoError() throws Exception { if (!System.getProperty("os.name").toLowerCase().contains("windows")) { assertTrue("Ignored this test on none Windows based systems", true); return;
