File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed
spring-beans/src/test/java/org/springframework/beans/propertyeditors Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -84,11 +84,18 @@ public void testWindowsAbsolutePath() {
8484 @ Test
8585 public void testWindowsAbsoluteFilePath () {
8686 PropertyEditor pathEditor = new PathEditor ();
87- pathEditor .setAsText ("file://C:\\ no_way_this_file_is_found.doc" );
88- Object value = pathEditor .getValue ();
89- assertThat (value instanceof Path ).isTrue ();
90- Path path = (Path ) value ;
91- assertThat (!path .toFile ().exists ()).isTrue ();
87+ try {
88+ pathEditor .setAsText ("file://C:\\ no_way_this_file_is_found.doc" );
89+ Object value = pathEditor .getValue ();
90+ assertThat (value instanceof Path ).isTrue ();
91+ Path path = (Path ) value ;
92+ assertThat (!path .toFile ().exists ()).isTrue ();
93+ }
94+ catch (IllegalArgumentException ex ) {
95+ if (File .separatorChar == '\\' ) { // on Windows, otherwise silently ignore
96+ throw ex ;
97+ }
98+ }
9299 }
93100
94101 @ Test
You can’t perform that action at this time.
0 commit comments