1 17 18 package org.apache.tools.ant.taskdefs; 19 20 import org.apache.tools.ant.Project; 21 import org.apache.tools.ant.BuildFileTest; 22 23 25 public class TypedefTest extends BuildFileTest { 26 27 public TypedefTest(String name) { 28 super(name); 29 } 30 31 public void setUp() { 32 configureProject("src/etc/testcases/taskdefs/typedef.xml"); 33 } 34 35 public void testEmpty() { 36 expectBuildException("empty", "required argument not specified"); 37 } 38 39 public void testNoName() { 40 expectBuildException("noName", "required argument not specified"); 41 } 42 43 public void testNoClassname() { 44 expectBuildException("noClassname", "required argument not specified"); 45 } 46 47 public void testClassNotFound() { 48 expectBuildException("classNotFound", 49 "classname specified doesn't exist"); 50 } 51 52 public void testGlobal() { 53 expectLog("testGlobal", ""); 54 Object ref = project.getReferences().get("global"); 55 assertNotNull("ref is not null", ref); 56 assertEquals("org.example.types.TypedefTestType", 57 ref.getClass().getName()); 58 } 59 60 public void testLocal() { 61 expectLog("testLocal", ""); 62 Object ref = project.getReferences().get("local"); 63 assertNotNull("ref is not null", ref); 64 assertEquals("org.example.types.TypedefTestType", 65 ref.getClass().getName()); 66 } 67 68 72 public void testDoubleNotPresent() { 73 expectLogContaining("double-notpresent", "hi"); 74 } 75 } 76 | Popular Tags |