1 17 18 package org.apache.tools.ant.util; 19 20 import org.apache.tools.ant.Project; 21 import org.apache.tools.ant.taskdefs.Echo; 22 import org.apache.tools.ant.types.Resource; 23 import org.apache.tools.ant.types.ResourceFactory; 24 25 import java.io.File ; 26 27 import junit.framework.TestCase; 28 29 32 public class ResourceUtilsTest extends TestCase 33 implements ResourceFactory, FileNameMapper { 34 35 private Echo taskINeedForLogging = new Echo(); 36 37 public ResourceUtilsTest(String name) { 38 super(name); 39 taskINeedForLogging.setProject(new Project()); 40 } 41 42 public void testNoDuplicates() { 43 Resource r = new Resource("samual vimes", true, 1, false); 44 Resource[] toNew = 45 ResourceUtils.selectOutOfDateSources(taskINeedForLogging, 46 new Resource[] {r}, 47 this, this); 48 assertEquals(1, toNew.length); 49 } 50 51 52 public Resource getResource(String name) { 53 return new Resource(name); } 55 56 57 public void setFrom(String s) {} 58 public void setTo(String s) {} 59 public String [] mapFileName(String s) { 60 return new String [] {"fred colon", "carrot ironfoundersson"}; 61 } 62 } 63 | Popular Tags |