1 22 package org.objectweb.petals.tools.jbiplugin.util; 23 24 import java.io.File ; 25 26 import junit.framework.TestCase; 27 28 33 public class ZipUtilTest extends TestCase { 34 35 private String baseDir; 36 37 public void setUp() { 38 baseDir = this.getClass().getResource(".").toString(); 39 baseDir = baseDir.substring(0, baseDir.indexOf("target")); 40 baseDir = baseDir.substring(baseDir.indexOf(":") + 1); 41 } 42 43 public void testZipDirectory() throws Exception { 44 File archive = new File (baseDir 45 + "target" + File.separator + "test.zip"); 46 File directory = new File (baseDir 47 + "src" + File.separator + "test-data" + File.separator + "conf"); 48 ZipUtil.zipDirectory(archive, directory, ""); 49 50 assertTrue(archive.exists()); 51 } 52 53 } 54 | Popular Tags |