Skip to content

Commit 5876acf

Browse files
author
Vincent Potucek
committed
downgrade generic Disabled to DisabledOnOs(WINDOWS)
1 parent e19aa49 commit 5876acf

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

compat/maven-compat/src/test/java/org/apache/maven/project/inheritance/t02/ProjectInheritanceTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@
3030
import org.apache.maven.project.inheritance.AbstractProjectInheritanceTestCase;
3131
import org.junit.jupiter.api.Test;
3232
import org.junit.jupiter.api.condition.DisabledOnOs;
33-
import org.junit.jupiter.api.condition.OS;
3433

3534
import static org.junit.jupiter.api.Assertions.assertEquals;
3635
import static org.junit.jupiter.api.Assertions.assertNotNull;
3736
import static org.junit.jupiter.api.Assertions.assertTrue;
37+
import static org.junit.jupiter.api.condition.OS.WINDOWS;
3838

3939
/**
4040
* A test which demonstrates maven's recursive inheritance where
@@ -64,7 +64,7 @@ class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
6464
// ----------------------------------------------------------------------
6565

6666
@Test
67-
@DisabledOnOs(OS.WINDOWS) // need to investigate why it fails on windows
67+
@DisabledOnOs(value = WINDOWS, disabledReason = "need to investigate why it fails on windows")
6868
void testProjectInheritance() throws Exception {
6969
File localRepo = getLocalRepositoryPath();
7070

impl/maven-executor/src/test/java/org/apache/maven/cling/executor/MavenExecutorTestSupport.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,16 @@
3232
import org.apache.maven.cling.executor.embedded.EmbeddedMavenExecutor;
3333
import org.apache.maven.cling.executor.forked.ForkedMavenExecutor;
3434
import org.junit.jupiter.api.AfterAll;
35-
import org.junit.jupiter.api.Disabled;
3635
import org.junit.jupiter.api.Test;
3736
import org.junit.jupiter.api.Timeout;
37+
import org.junit.jupiter.api.condition.DisabledOnOs;
3838
import org.junit.jupiter.api.io.CleanupMode;
3939
import org.junit.jupiter.api.io.TempDir;
4040

4141
import static org.junit.jupiter.api.Assertions.assertEquals;
4242
import static org.junit.jupiter.api.Assertions.assertFalse;
4343
import static org.junit.jupiter.api.Assertions.assertTrue;
44+
import static org.junit.jupiter.api.condition.OS.WINDOWS;
4445

4546
public abstract class MavenExecutorTestSupport {
4647
@Timeout(15)
@@ -63,7 +64,9 @@ void mvnenc(
6364
System.out.println(Files.readString(cwd.resolve(logfile)));
6465
}
6566

66-
@Disabled("JUnit on Windows fails to clean up as mvn3 seems does not close log file properly")
67+
@DisabledOnOs(
68+
value = WINDOWS,
69+
disabledReason = "JUnit on Windows fails to clean up as mvn3 seems does not close log file properly")
6770
@Timeout(15)
6871
@Test
6972
void dump3(
@@ -126,7 +129,9 @@ void version() throws Exception {
126129
mavenVersion(mvn4ExecutorRequestBuilder().build()));
127130
}
128131

129-
@Disabled("JUnit on Windows fails to clean up as mvn3 seems does not close log file properly")
132+
@DisabledOnOs(
133+
value = WINDOWS,
134+
disabledReason = "JUnit on Windows fails to clean up as mvn3 seems does not close log file properly")
130135
@Timeout(15)
131136
@Test
132137
void defaultFs3x(@TempDir(cleanup = CleanupMode.ON_SUCCESS) Path tempDir) throws Exception {

impl/maven-impl/src/test/java/org/apache/maven/impl/DefaultPluginXmlFactoryTest.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,16 @@
3636
import org.apache.maven.api.services.xml.XmlWriterException;
3737
import org.apache.maven.api.services.xml.XmlWriterRequest;
3838
import org.apache.maven.impl.model.DefaultModelProcessor;
39-
import org.junit.jupiter.api.Disabled;
4039
import org.junit.jupiter.api.Test;
40+
import org.junit.jupiter.api.condition.DisabledOnOs;
4141
import org.junit.jupiter.api.io.TempDir;
4242

4343
import static java.util.UUID.randomUUID;
4444
import static org.assertj.core.api.Assertions.assertThat;
4545
import static org.assertj.core.api.AssertionsForClassTypes.assertThatExceptionOfType;
4646
import static org.junit.jupiter.api.Assertions.assertNotNull;
4747
import static org.junit.jupiter.api.Assertions.assertThrows;
48+
import static org.junit.jupiter.api.condition.OS.WINDOWS;
4849
import static org.mockito.Mockito.mock;
4950
import static org.mockito.Mockito.when;
5051

@@ -251,7 +252,10 @@ void locateExistingPomWithFilePathShouldReturnSameFileIfRegularFile() throws IOE
251252
}
252253

253254
@Test
254-
@Disabled("maybe bug in JUnit, as MS-DOS only https://github.com/apache/maven/pull/2312#issuecomment-2876291814")
255+
@DisabledOnOs(
256+
value = WINDOWS,
257+
disabledReason =
258+
"maybe bug in JUnit, as MS-DOS only https://github.com/apache/maven/pull/2312#issuecomment-2876291814")
255259
void readFromUrlParsesPluginDescriptorCorrectly() throws Exception {
256260
Path xmlFile = tempDir.resolve("plugin.xml");
257261
Files.write(xmlFile, SAMPLE_PLUGIN_XML.getBytes());

0 commit comments

Comments
 (0)