Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 43598 invoked from network); 24 Jan 2006 04:59:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 24 Jan 2006 04:59:18 -0000 Received: (qmail 60311 invoked by uid 500); 24 Jan 2006 04:59:14 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 60260 invoked by uid 500); 24 Jan 2006 04:59:13 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 60248 invoked by uid 99); 24 Jan 2006 04:59:13 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Jan 2006 20:59:13 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [217.160.128.107] (HELO www.samaflost.de) (217.160.128.107) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Jan 2006 20:59:12 -0800 Received: by www.samaflost.de (Postfix, from userid 1000) id F006788A407; Tue, 24 Jan 2006 05:58:50 +0100 (CET) To: user@ant.apache.org Subject: Re: Unit test a build X-Draft-From: ("nnfolder:mail.jakarta-ant-user" 52128) References: <20060123215410.736.qmail@web30205.mail.mud.yahoo.com> From: Stefan Bodewig Date: Tue, 24 Jan 2006 05:58:50 +0100 In-Reply-To: <20060123215410.736.qmail@web30205.mail.mud.yahoo.com> (Ninju Bohra's message of "Mon, 23 Jan 2006 13:54:10 -0800 (PST)") Message-ID: <87oe229q7p.fsf@www.samaflost.de> User-Agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Security Through Obscurity, linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On Mon, 23 Jan 2006, Ninju Bohra wrote: > I too created test cases for my build files (actually they are build > files for testing my custom tasks, but they are still build files). > > I used the BuildFileTest class as the base class (that my JUnit > classes extended from). This is the traditional way Ant used itself, but this is going to be replaced by AntUnit step by step. The difference is that you don't write a Java class at all. Say I want to test the task and validate it creates a file, I write a build file: > The class provided some convience methods for reading the build.xml, > initializing the project, and accessing property and log output > (very useful when verified build behavior). AntUnit provides a generic task (with a nested condition) as well as a bunch of macrodef'ed asserts and > but I never quite thought of "testing" a build script with unit > tests (it seems a bit recursive as you would need a build script to > invoke the build you are testing...) an task to do just that. The task takes a bunch of build files and runs the targets whose names start with "test", with special handling for targets names setUp and tearDown. And it provides for test listeners. Stefan --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org