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 2020/12/05 16:38:22 UTC
[commons-vfs] branch master updated: Clean up new test method.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-vfs.git
The following commit(s) were added to refs/heads/master by this push:
new 0625e67 Clean up new test method.
0625e67 is described below
commit 0625e67d46533d83754e77ffb8f8d1b196806074
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Dec 5 11:38:18 2020 -0500
Clean up new test method.
---
.../vfs2/provider/local/test/FileNameTests.java | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)
diff --git a/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/local/test/FileNameTests.java b/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/local/test/FileNameTests.java
index f3da521..d58201d 100644
--- a/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/local/test/FileNameTests.java
+++ b/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/local/test/FileNameTests.java
@@ -57,17 +57,14 @@ public class FileNameTests extends AbstractProviderTestCase {
*/
@Test
public void testLocalFile() throws Exception {
- final String prefix = new String(new char[] { '\u0074', '\u0065', '\u0074' });
- final File f = File.createTempFile(prefix + "-", "-" + prefix);
- assertTrue(f.exists());
-
- final URI uri = f.toURI();
-
- try (final FileSystemManager m = VFS.getManager()) {
- try (final FileObject s = m.resolveFile(uri)) {
- try (final FileContent sourceContent = s.getContent()) {
- final long size = sourceContent.getSize();
- assertEquals(size, f.length());
+ final String prefix = new String("\u0074\u0065\u0074");
+ final File file = File.createTempFile(prefix + "-", "-" + prefix);
+ assertTrue(file.exists());
+ final URI uri = file.toURI();
+ try (final FileSystemManager manager = getManager()) {
+ try (final FileObject fileObject = manager.resolveFile(uri)) {
+ try (final FileContent sourceContent = fileObject.getContent()) {
+ assertEquals(sourceContent.getSize(), file.length());
}
}
}