    1   package groovy.util;
    2
    3   import org.apache.tools.ant.BuildException;
    4   import org.apache.tools.ant.Task;
    5   import org.codehaus.groovy.runtime.InvokerHelper;
    6
    7   public class SpoofTask extends Task {
    8   	private int foo;
    9
    10      public SpoofTask() {
    11          super();
    12          SpoofTaskContainer.spoof("SpoofTask ctor");
    13      }
    14
    15      public void setFoo(final int i) {
    16      	foo = i;
    17      }
    18
    19
    20      public void execute() throws BuildException {
    21          SpoofTaskContainer.spoof("begin SpoofTask execute");
    22          SpoofTaskContainer.spoof("tag name from wrapper: " + getWrapper().getElementTag());
    23          // don't rely on Map.toString(), behaviour is not documented
    24          SpoofTaskContainer.spoof("attributes map from wrapper: "
    25          		+ InvokerHelper.toMapString(getWrapper().getAttributeMap()));
    26          SpoofTaskContainer.spoof("param foo: " + foo);
    27
    28          SpoofTaskContainer.spoof("end SpoofTask execute");
    29      }
    30
    31  }