Ignore testWindowsAbsoluteFilePath exception if not on Windows
See gh-26702
This commit is contained in:
parent
29955a2898
commit
e05b584623
|
|
@ -84,11 +84,18 @@ public class PathEditorTests {
|
||||||
@Test
|
@Test
|
||||||
public void testWindowsAbsoluteFilePath() {
|
public void testWindowsAbsoluteFilePath() {
|
||||||
PropertyEditor pathEditor = new PathEditor();
|
PropertyEditor pathEditor = new PathEditor();
|
||||||
pathEditor.setAsText("file://C:\\no_way_this_file_is_found.doc");
|
try {
|
||||||
Object value = pathEditor.getValue();
|
pathEditor.setAsText("file://C:\\no_way_this_file_is_found.doc");
|
||||||
assertThat(value instanceof Path).isTrue();
|
Object value = pathEditor.getValue();
|
||||||
Path path = (Path) value;
|
assertThat(value instanceof Path).isTrue();
|
||||||
assertThat(!path.toFile().exists()).isTrue();
|
Path path = (Path) value;
|
||||||
|
assertThat(!path.toFile().exists()).isTrue();
|
||||||
|
}
|
||||||
|
catch (IllegalArgumentException ex) {
|
||||||
|
if (File.separatorChar == '\\') { // on Windows, otherwise silently ignore
|
||||||
|
throw ex;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue