Commit e05b584 1 parent 29955a2 commit e05b584 Copy full SHA for e05b584
File tree 1 file changed +12
-5
lines changed
spring-beans/src/test/java/org/springframework/beans/propertyeditors
1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -84,11 +84,18 @@ public void testWindowsAbsolutePath() {
84
84
@ Test
85
85
public void testWindowsAbsoluteFilePath () {
86
86
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
+ }
92
99
}
93
100
94
101
@ Test
You can’t perform that action at this time.
0 commit comments