From 72a6e5e9df5e84b644a427f729dbde4f3a4da778 Mon Sep 17 00:00:00 2001 From: Steve Loughran Date: Thu, 16 Mar 2006 14:00:00 +0000 Subject: [PATCH] No, it isnt the fact that I declare things through a property file either. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@386330 13f79535-47bb-0310-9956-ffa450edef68 --- src/etc/testcases/core/extended-taskdef.xml | 14 +++++++++++++ .../apache/tools/ant/ExtendedTaskdefTest.java | 21 +++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/src/etc/testcases/core/extended-taskdef.xml b/src/etc/testcases/core/extended-taskdef.xml index 66bb14e1d..805368fd9 100644 --- a/src/etc/testcases/core/extended-taskdef.xml +++ b/src/etc/testcases/core/extended-taskdef.xml @@ -5,6 +5,7 @@ + @@ -17,6 +18,9 @@ } } + + + @@ -32,11 +36,21 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/testcases/org/apache/tools/ant/ExtendedTaskdefTest.java b/src/testcases/org/apache/tools/ant/ExtendedTaskdefTest.java index 31e8a0c55..d1f00eaf6 100644 --- a/src/testcases/org/apache/tools/ant/ExtendedTaskdefTest.java +++ b/src/testcases/org/apache/tools/ant/ExtendedTaskdefTest.java @@ -35,9 +35,30 @@ public class ExtendedTaskdefTest extends BuildFileTest { configureProject("src/etc/testcases/core/extended-taskdef.xml"); } + /** + * Automatically calls the target called "tearDown" + * from the build file tested if it exits. + *

+ * This allows to use Ant tasks directly in the build file + * to clean up after each test. Note that no "setUp" target + * is automatically called, since it's trivial to have a + * test target depend on it. + */ + protected void tearDown() throws Exception { + super.tearDown(); + executeTarget("teardown"); + } + public void testRun() throws Exception { expectBuildExceptionContaining("testRun", "exception thrown by the subclass", "executing the Foo task"); } + + public void testRun2() throws Exception { + expectBuildExceptionContaining("testRun2", + "exception thrown by the subclass", + "executing the Foo task"); + } + }