1 17 18 package org.apache.tools.ant.taskdefs; 19 20 import org.apache.tools.ant.BuildFileTest; 21 import org.apache.tools.ant.util.FileUtils; 22 23 import java.io.IOException ; 24 25 27 public class BZip2Test extends BuildFileTest { 28 29 public BZip2Test(String name) { 30 super(name); 31 } 32 33 public void setUp() { 34 configureProject("src/etc/testcases/taskdefs/bzip2.xml"); 35 executeTarget("prepare"); 36 } 37 38 public void tearDown() { 39 executeTarget("cleanup"); 40 } 41 42 public void testRealTest() throws java.io.IOException { 43 FileUtils fileUtils = FileUtils.newFileUtils(); 44 executeTarget("realTest"); 45 assertTrue("File content mismatch", 46 fileUtils.contentEquals(project.resolveFile("expected/asf-logo-huge.tar.bz2"), 47 project.resolveFile("asf-logo-huge.tar.bz2"))); 48 } 49 50 public void testDateCheck(){ 51 executeTarget("testDateCheck"); 52 String log = getLog(); 53 assertTrue( 54 "Expecting message ending with 'asf-logo.gif.bz2 is up to date.' but got '" + log + "'", 55 log.endsWith("asf-logo.gif.bz2 is up to date.")); 56 } 57 58 } 59 | Popular Tags |