diff options
author | Benoit Lamarche <benoitlamarche@google.com> | 2015-01-19 16:59:06 +0100 |
---|---|---|
committer | Benoit Lamarche <benoitlamarche@google.com> | 2015-01-26 19:18:02 +0100 |
commit | 0f560d93473dcee618d3cfa85d9f4b14ddf8b8fb (patch) | |
tree | 8b0a4a41c1e8b2e4888ce4a831ab64cbd4c2e685 /sched/tests/com | |
parent | 1c8c646006df3b4e854403f3b2c18b0dcb479028 (diff) | |
download | toolchain_jack-0f560d93473dcee618d3cfa85d9f4b14ddf8b8fb.zip toolchain_jack-0f560d93473dcee618d3cfa85d9f4b14ddf8b8fb.tar.gz toolchain_jack-0f560d93473dcee618d3cfa85d9f4b14ddf8b8fb.tar.bz2 |
Add new PrefixedFS
Change-Id: I4b71e032221ccfe2ebc4fd5d110aa1b389dc4812
Diffstat (limited to 'sched/tests/com')
-rw-r--r-- | sched/tests/com/android/sched/vfs/VFSTest.java | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/sched/tests/com/android/sched/vfs/VFSTest.java b/sched/tests/com/android/sched/vfs/VFSTest.java index 6b21bd7..9b8c9e9 100644 --- a/sched/tests/com/android/sched/vfs/VFSTest.java +++ b/sched/tests/com/android/sched/vfs/VFSTest.java @@ -290,6 +290,51 @@ public class VFSTest { } @Test + public void testPrefixFS() + throws NotDirectoryException, + CannotCreateFileException, + WrongPermissionException, + CannotSetPermissionException, + NoSuchFileException, + FileAlreadyExistsException, + IOException { + File file = null; + InputOutputVFS directVFS = null; + InputOutputVFS directVFS2 = null; + try { + file = File.createTempFile("vfs", "dir"); + String path = file.getAbsolutePath(); + Assert.assertTrue(file.delete()); + + directVFS = + new GenericInputOutputVFS(new PrefixedFS(new DirectFS(new Directory(path, null, + Existence.NOT_EXIST, Permission.WRITE, ChangePermission.NOCHANGE), Permission.READ + | Permission.WRITE), new VPath("stuff", '/'))); + + testOutputVFS(directVFS); + testInputVFS(directVFS); + directVFS.close(); + + directVFS2 = + new GenericInputOutputVFS(new PrefixedFS(new DirectFS(new Directory(path, null, + Existence.MUST_EXIST, Permission.WRITE, ChangePermission.NOCHANGE), Permission.READ + | Permission.WRITE), new VPath("stuff", '/'))); + testInputVFS(directVFS2); + + } finally { + if (directVFS != null) { + directVFS.close(); + } + if (directVFS2 != null) { + directVFS2.close(); + } + if (file != null) { + FileUtils.deleteDir(file); + } + } + } + + @Test public void testInputOutputZipVFS() throws NotDirectoryException, CannotCreateFileException, |