- Revision
- 1332
- Author
- mauro
- Date
- 2009-10-14 03:33:11 -0500 (Wed, 14 Oct 2009)
Log Message
Cleanup test.
Modified Paths
Diff
Modified: trunk/web/web-io/src/test/java/org/jbehave/web/io/ZipFileArchiverTest.java (1331 => 1332)
--- trunk/web/web-io/src/test/java/org/jbehave/web/io/ZipFileArchiverTest.java 2009-10-13 22:49:59 UTC (rev 1331) +++ trunk/web/web-io/src/test/java/org/jbehave/web/io/ZipFileArchiverTest.java 2009-10-14 08:33:11 UTC (rev 1332) @@ -19,26 +19,38 @@ @Before public void setup() throws IOException { dir = new File("/tmp", "dir"); + dir.createNewFile(); } @Test public void canArchiveZip() throws IOException { - File zip = new File("target", "dir1.zip"); - dir.mkdir(); - archiver.archive(zip , dir); + File zip = createFile("dir1.zip"); + archiver.archive(zip, dir); } + private File createFile(String path) throws IOException { + File parent = new File("target"); + parent.mkdirs(); + File file = new File(parent, path); + file.createNewFile(); + return file; + } + @Test public void canUnarchiveZip() throws IOException { File zip = resourceFile("dir1.zip"); assertTrue(archiver.isArchive(zip)); - dir.delete(); - dir.mkdir(); + clearDir(dir); archiver.unarchive(zip, dir); assertFilesUnarchived(asList("dir1", "dir1/file1.txt", "dir1/subdir1", "dir1/subdir1/subfile1.txt")); } + private void clearDir(File dir) { + dir.delete(); + dir.mkdir(); + } + @Test public void canListFileContentOfUnarchiveZip() throws IOException { File zip = resourceFile("dir1.zip");
To unsubscribe from this list please visit:
