git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@274908 13f79535-47bb-0310-9956-ffa450edef68master
@@ -64,6 +64,12 @@ | |||||
<typedef loaderref="nested.loader" classpathref="nested.classes" | <typedef loaderref="nested.loader" classpathref="nested.classes" | ||||
name = "nested.condition.type" | name = "nested.condition.type" | ||||
classname="${nested.package}AddTypeTest$MyCondition"/> | classname="${nested.package}AddTypeTest$MyCondition"/> | ||||
<typedef loaderref="nested.loader" classpathref="nested.classes" | |||||
name = "myaddconfigured" | |||||
classname="${nested.package}AddTypeTest$MyAddConfigured"/> | |||||
<typedef loaderref="nested.loader" classpathref="nested.classes" | |||||
name = "myvalue" | |||||
classname="${nested.package}AddTypeTest$MyValue"/> | |||||
</target> | </target> | ||||
<target name="nested.a" depends="init"> | <target name="nested.a" depends="init"> | ||||
@@ -112,4 +118,10 @@ | |||||
</condition> | </condition> | ||||
</target> | </target> | ||||
<target name="myaddconfigured" depends="init"> | |||||
<myaddconfigured> | |||||
<myvalue>Value Set</myvalue> | |||||
</myaddconfigured> | |||||
</target> | |||||
</project> | </project> |
@@ -118,7 +118,11 @@ public class AddTypeTest extends BuildFileTest { | |||||
"condition.condition.task", "task masking condition", | "condition.condition.task", "task masking condition", | ||||
"doesn't support the nested"); | "doesn't support the nested"); | ||||
} | } | ||||
public void testAddConfigured() { | |||||
expectLogContaining( | |||||
"myaddconfigured", "value is Value Setexecute: value is Value Set"); | |||||
} | |||||
// The following will be used as types and tasks | // The following will be used as types and tasks | ||||
public static interface A {} | public static interface A {} | ||||
@@ -161,4 +165,28 @@ public class AddTypeTest extends BuildFileTest { | |||||
} | } | ||||
} | } | ||||
public static class MyValue | |||||
{ | |||||
private String text = "NOT SET YET"; | |||||
public void addText(String text) { | |||||
this.text = text; | |||||
} | |||||
public String toString() { | |||||
return text; | |||||
} | |||||
} | |||||
public static class MyAddConfigured | |||||
extends Task | |||||
{ | |||||
MyValue value; | |||||
public void addConfigured(MyValue value) { | |||||
log("value is " + value); | |||||
this.value = value; | |||||
} | |||||
public void execute() { | |||||
log("execute: value is " + value); | |||||
} | |||||
} | |||||
} | } |