Browse Source

followed up peter reilly's suggestion; full testing for unimplemented as well as undefined

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@275958 13f79535-47bb-0310-9956-ffa450edef68
master
Steve Loughran 21 years ago
parent
commit
6ed7b543c6
2 changed files with 16 additions and 2 deletions
  1. +8
    -2
      src/etc/testcases/taskdefs/conditions/typefound.xml
  2. +8
    -0
      src/testcases/org/apache/tools/ant/taskdefs/condition/TypeFoundTest.java

+ 8
- 2
src/etc/testcases/taskdefs/conditions/typefound.xml View File

@@ -14,9 +14,15 @@
</condition>
</target>

<target name="testTaskThatIsntDefined">
<condition property="testTaskThatIsntDefined">
<typefound name="invalid-and-undefined-task-name"/>
</condition>
</target>

<target name="testTaskThatDoesntReallyExist">
<!-- <taskdef name="invalid-task-name"
classname="org.example.invalid.task.name.hopefully"/> -->
<taskdef name="invalid-task-name" onerror="ignore"
classname="org.example.invalid.task.name.hopefully"/>
<condition property="testTaskThatDoesntReallyExist">
<typefound name="invalid-task-name"/>
</condition>


+ 8
- 0
src/testcases/org/apache/tools/ant/taskdefs/condition/TypeFoundTest.java View File

@@ -78,15 +78,23 @@ public class TypeFoundTest extends BuildFileTest {
public void testUndefined() {
expectBuildExceptionContaining("testUndefined","left out the name attribute", "No type specified");
}

public void testTaskThatIsntDefined() {
expectPropertyUnset("testTaskThatIsntDefined", "testTaskThatIsntDefined");
}

public void testTaskThatDoesntReallyExist() {
expectPropertyUnset("testTaskThatDoesntReallyExist", "testTaskThatDoesntReallyExist");
}

public void testType() {
expectPropertySet("testType", "testType");
}

public void testPreset() {
expectPropertySet("testPreset", "testPreset");
}

public void testMacro() {
expectPropertySet("testMacro", "testMacro");
}


Loading…
Cancel
Save