File tree Expand file tree Collapse file tree
src/test/java/org/apache/commons/cli Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6262 <artifactId >junit-jupiter-params</artifactId >
6363 <scope >test</scope >
6464 </dependency >
65+ <dependency >
66+ <groupId >commons-io</groupId >
67+ <artifactId >commons-io</artifactId >
68+ <version >2.16.0</version >
69+ <scope >test</scope >
70+ </dependency >
6571 </dependencies >
6672
6773 <properties >
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
2424
2525import java .io .File ;
2626import java .io .FileInputStream ;
27+ import java .io .IOException ;
2728import java .math .BigDecimal ;
2829import java .math .BigInteger ;
2930import java .net .MalformedURLException ;
@@ -40,6 +41,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
4041import java .util .Map ;
4142import java .util .stream .Stream ;
4243
44+ import org .apache .commons .io .IOUtils ;
4345import org .junit .jupiter .api .Test ;
4446import org .junit .jupiter .params .ParameterizedTest ;
4547import org .junit .jupiter .params .provider .Arguments ;
@@ -185,9 +187,10 @@ public void testCreateFile() {
185187 }
186188
187189 @ Test
188- public void testOpenFile () {
189- final File file = new File ("" ).getAbsoluteFile ();
190- assertEquals (file , TypeHandler .createFile (file .toString ()));
190+ public void testOpenFile () throws ParseException , IOException {
191+ try (FileInputStream fis = TypeHandler .openFile ("src/test/resources/org/apache/commons/cli/existing-readable.file" )) {
192+ IOUtils .consume (fis );
193+ }
191194 }
192195
193196 @ Test
You can’t perform that action at this time.
0 commit comments