diff --git a/compat/maven-compat/src/test/java/org/apache/maven/project/inheritance/t02/ProjectInheritanceTest.java b/compat/maven-compat/src/test/java/org/apache/maven/project/inheritance/t02/ProjectInheritanceTest.java index b277dad26d7f..b103b3f660e5 100644 --- a/compat/maven-compat/src/test/java/org/apache/maven/project/inheritance/t02/ProjectInheritanceTest.java +++ b/compat/maven-compat/src/test/java/org/apache/maven/project/inheritance/t02/ProjectInheritanceTest.java @@ -30,11 +30,11 @@ import org.apache.maven.project.inheritance.AbstractProjectInheritanceTestCase; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.DisabledOnOs; -import org.junit.jupiter.api.condition.OS; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.condition.OS.WINDOWS; /** * A test which demonstrates maven's recursive inheritance where @@ -64,7 +64,7 @@ class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase { // ---------------------------------------------------------------------- @Test - @DisabledOnOs(OS.WINDOWS) // need to investigate why it fails on windows + @DisabledOnOs(value = WINDOWS, disabledReason = "need to investigate why it fails on windows") void testProjectInheritance() throws Exception { File localRepo = getLocalRepositoryPath(); diff --git a/impl/maven-executor/src/test/java/org/apache/maven/cling/executor/MavenExecutorTestSupport.java b/impl/maven-executor/src/test/java/org/apache/maven/cling/executor/MavenExecutorTestSupport.java index 98a0d641d2ec..bbfbbcb402b8 100644 --- a/impl/maven-executor/src/test/java/org/apache/maven/cling/executor/MavenExecutorTestSupport.java +++ b/impl/maven-executor/src/test/java/org/apache/maven/cling/executor/MavenExecutorTestSupport.java @@ -32,15 +32,16 @@ import org.apache.maven.cling.executor.embedded.EmbeddedMavenExecutor; import org.apache.maven.cling.executor.forked.ForkedMavenExecutor; import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; +import org.junit.jupiter.api.condition.DisabledOnOs; import org.junit.jupiter.api.io.CleanupMode; import org.junit.jupiter.api.io.TempDir; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.condition.OS.WINDOWS; public abstract class MavenExecutorTestSupport { @Timeout(15) @@ -63,7 +64,9 @@ void mvnenc( System.out.println(Files.readString(cwd.resolve(logfile))); } - @Disabled("JUnit on Windows fails to clean up as mvn3 seems does not close log file properly") + @DisabledOnOs( + value = WINDOWS, + disabledReason = "JUnit on Windows fails to clean up as mvn3 does not close log file properly") @Timeout(15) @Test void dump3( @@ -126,7 +129,9 @@ void version() throws Exception { mavenVersion(mvn4ExecutorRequestBuilder().build())); } - @Disabled("JUnit on Windows fails to clean up as mvn3 seems does not close log file properly") + @DisabledOnOs( + value = WINDOWS, + disabledReason = "JUnit on Windows fails to clean up as mvn3 does not close log file properly") @Timeout(15) @Test void defaultFs3x(@TempDir(cleanup = CleanupMode.ON_SUCCESS) Path tempDir) throws Exception { diff --git a/impl/maven-impl/src/test/java/org/apache/maven/impl/DefaultPluginXmlFactoryTest.java b/impl/maven-impl/src/test/java/org/apache/maven/impl/DefaultPluginXmlFactoryTest.java index 73d15c816284..37e320cb3237 100644 --- a/impl/maven-impl/src/test/java/org/apache/maven/impl/DefaultPluginXmlFactoryTest.java +++ b/impl/maven-impl/src/test/java/org/apache/maven/impl/DefaultPluginXmlFactoryTest.java @@ -36,8 +36,8 @@ import org.apache.maven.api.services.xml.XmlWriterException; import org.apache.maven.api.services.xml.XmlWriterRequest; import org.apache.maven.impl.model.DefaultModelProcessor; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.DisabledOnOs; import org.junit.jupiter.api.io.TempDir; import static java.util.UUID.randomUUID; @@ -45,6 +45,7 @@ import static org.assertj.core.api.AssertionsForClassTypes.assertThatExceptionOfType; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.condition.OS.WINDOWS; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -251,7 +252,9 @@ void locateExistingPomWithFilePathShouldReturnSameFileIfRegularFile() throws IOE } @Test - @Disabled("maybe bug in JUnit, as MS-DOS only https://github.com/apache/maven/pull/2312#issuecomment-2876291814") + @DisabledOnOs( + value = WINDOWS, + disabledReason = "windows related issue https://github.com/apache/maven/pull/2312#issuecomment-2876291814") void readFromUrlParsesPluginDescriptorCorrectly() throws Exception { Path xmlFile = tempDir.resolve("plugin.xml"); Files.write(xmlFile, SAMPLE_PLUGIN_XML.getBytes());