summaryrefslogtreecommitdiffstats
path: root/sched/tests
diff options
context:
space:
mode:
authorBenoit Lamarche <benoitlamarche@google.com>2015-01-23 18:46:58 +0100
committerBenoit Lamarche <benoitlamarche@google.com>2015-01-27 13:08:14 +0000
commit3a234ceb43fe28206490354441170e64d8e8b7bd (patch)
tree43cadb2664da81a4d43a6c993d79111ca8947afd /sched/tests
parent235381f6db35c99efd11ffe28465278ed8f91646 (diff)
downloadtoolchain_jack-3a234ceb43fe28206490354441170e64d8e8b7bd.zip
toolchain_jack-3a234ceb43fe28206490354441170e64d8e8b7bd.tar.gz
toolchain_jack-3a234ceb43fe28206490354441170e64d8e8b7bd.tar.bz2
Add new WriteZipVFS
Change-Id: Id80de67d1063a608b3a8cab47126b4ed15bfe07f
Diffstat (limited to 'sched/tests')
-rw-r--r--sched/tests/com/android/sched/vfs/VFSTest.java35
1 files changed, 35 insertions, 0 deletions
diff --git a/sched/tests/com/android/sched/vfs/VFSTest.java b/sched/tests/com/android/sched/vfs/VFSTest.java
index 307d3da..c9b1981 100644
--- a/sched/tests/com/android/sched/vfs/VFSTest.java
+++ b/sched/tests/com/android/sched/vfs/VFSTest.java
@@ -335,6 +335,41 @@ public class VFSTest {
}
@Test
+ public void testWriteZipVFS()
+ throws NotDirectoryException,
+ CannotCreateFileException,
+ WrongPermissionException,
+ CannotSetPermissionException,
+ NoSuchFileException,
+ FileAlreadyExistsException,
+ IOException {
+ File file = null;
+ InputOutputVFS outputZipVFS = null;
+ InputZipVFS inputZipVFS = null;
+ try {
+ file = File.createTempFile("vfs", ".zip");
+ String path = file.getAbsolutePath();
+ outputZipVFS = new GenericInputOutputVFS(new WriteZipFS(
+ new OutputZipFile(path, null, Existence.MAY_EXIST, ChangePermission.NOCHANGE)));
+ testOutputVFS(outputZipVFS);
+ outputZipVFS.close();
+ inputZipVFS = new InputZipVFS(
+ new InputZipFile(path, null, Existence.MUST_EXIST, ChangePermission.NOCHANGE));
+ testInputVFS(inputZipVFS);
+ } finally {
+ if (outputZipVFS != null) {
+ outputZipVFS.close();
+ }
+ if (inputZipVFS != null) {
+ inputZipVFS.close();
+ }
+ if (file != null) {
+ Assert.assertTrue(file.delete());
+ }
+ }
+ }
+
+ @Test
public void testInputOutputZipVFS()
throws NotDirectoryException,
CannotCreateFileException,