You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2017/10/26 14:44:12 UTC
svn commit: r1813412 -
/commons/proper/vfs/trunk/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/local/test/FileNameTests.java
Author: ggregory
Date: Thu Oct 26 14:44:12 2017
New Revision: 1813412
URL: http://svn.apache.org/viewvc?rev=1813412&view=rev
Log:
Release test resource.
Modified:
commons/proper/vfs/trunk/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/local/test/FileNameTests.java
Modified: commons/proper/vfs/trunk/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/local/test/FileNameTests.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/local/test/FileNameTests.java?rev=1813412&r1=1813411&r2=1813412&view=diff
==============================================================================
--- commons/proper/vfs/trunk/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/local/test/FileNameTests.java (original)
+++ commons/proper/vfs/trunk/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/local/test/FileNameTests.java Thu Oct 26 14:44:12 2017
@@ -27,7 +27,7 @@ import org.junit.Assert;
* Additional naming tests for local file system.
*/
public class FileNameTests extends AbstractProviderTestCase {
-
+
/**
* Tests resolution of an absolute file name.
*/
@@ -35,13 +35,14 @@ public class FileNameTests extends Abstr
// Locate file by absolute file name
final String fileName = new File("testdir").getAbsolutePath();
DefaultFileSystemManager manager = getManager();
- final FileObject absFile = manager.resolveFile(fileName);
- Assert.assertNotNull("Unexpected null manager for test " + this, manager);
-
- // Locate file by URI
- final String uri = "file://" + fileName.replace(File.separatorChar, '/');
- final FileObject uriFile = manager.resolveFile(uri);
+ try (final FileObject absFile = manager.resolveFile(fileName)) {
+ Assert.assertNotNull("Unexpected null manager for test " + this, manager);
+
+ // Locate file by URI
+ final String uri = "file://" + fileName.replace(File.separatorChar, '/');
+ final FileObject uriFile = manager.resolveFile(uri);
- assertSame("file object", absFile, uriFile);
+ assertSame("file object", absFile, uriFile);
+ }
}
}