At 10:31 AM 4/14/2005, you wrote:
On Thu, 14 Apr 2005, Wascally Wabbit <[EMAIL PROTECTED]> wrote:
> I have already created such a beast using Ant; the project is > waiting to to be cleaned up before being posted on Sourceforge > (at antunit).
Let me see it! 8-)
The implementation is a bit out-of-date now, but you can have it+javadocs+ramblings I wrote to myself on said topic. See started testcase docs attached.
> What are the chances of you taking a look-see so work isn't > duplicated?
Absolutely.
> My AntUnit is based on AntXtras (which does have licensing issues w/ > LGPL) but the AntUnit code ideas could be transferred w/o any > problems?
Possibly so. If you are willing to donate/contribute it under the Apache Software License.
Ya ya. Please ask as necessary. I just want to leverage whatever ends up in the Ant distrib.
> Assertions are handled by the AntXtras/rules tasks.
Does it do anything more fancy than our current macrodef around fail (or the stripped down <fail> I called <assertTrue>)?
I'm not sure which macrodef you're referring to here but it turned on that the AntX assertions worked so well the AntUnit stuff concentrates on test management stuff and has no assertions at all. Most of my tasks I test from Ant; my JUnit stuff just calls the Ant stuff using a modified BuildFileTest. See attached samples. I've attached some testsuites I created w/ my assertions and plain Ant as the run harness (no AntUnit).
Cheers Stefan
The Wabbit
/** * $Id: MkdirsTaskTest.java,v 1.1 2005/04/13 16:04:10 simone Exp $ * Copyright 2005 iDare Media, Inc. All rights reserved. * * Originally written by iDare Media, Inc. for release into the public domain. This * library, source form and binary form, is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License (LGPL) as published * by the Free Software Foundation; either version 2.1 of the License, or (at your option) * any later version.<p> * * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU LGPL for more details.<p> * * You should have received a copy of the GNU Lesser General Public License along with this * library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite * 330, Boston, MA 02111-1307 USA. The GNU LGPL can be found online at * http://www.fsf.org/copyleft/lesser.html<p> * * This product has been influenced by several projects within the open-source community. * The JWare developers wish to acknowledge the open-source community's support. For more * information regarding the open-source products used within JWare, please visit the * JWare website. *----------------------------------------------------------------------------------------* * WEBSITE- @Module_WEBSITE@ EMAIL- @Module_EMAIL@ *----------------------------------------------------------------------------------------* **/
package com.idaremedia.antx.mktemp.tests; import junit.framework.TestSuite; import com.idaremedia.antx.ut.HTC; import com.idaremedia.antx.ut.HTCUtils; /** * Testsuite for the [EMAIL PROTECTED] com.idaremedia.antx.mktemp.MkdirsTask * MkdirsTask} class. * * @since JWare/AntX 0.5 * @author ssmc, ©2005 <a href="@Module_WEBSITE@">iDare Media, Inc.</a> * @version @Module_VERSION@ * @.safety single * @.group impl,test **/ public final class MkdirsTaskTest extends HTC { /** <i>PET</i> Test Category. **/ public static final String TEST_CATEGORY="CLASS"; /** * Create new MkdirsTaskTest testcase. **/ public MkdirsTaskTest(String methodName) { super("MkdirsTask::",methodName); } /** * Create full test suite for MkdirsTaskTest. **/ public static TestSuite suite() { return new TestSuite(MkdirsTaskTest.class); } /** * Create baseline test suite for MkdirsTaskTest (same as full). **/ public static TestSuite baseline() { return suite(); } /** * Make this test (standalone) self-running. **/ public static void main(String[] argv) { HTCUtils.quickCheck(suite()); } // --------------------------------------------------------------------------------------------------------- // ---------------------------------------- [ Misc Setup Methods ] ----------------------------------------- // --------------------------------------------------------------------------------------------------------- protected void setUp() throws Exception { configureProjectFromResource("mkdirs.xml"); } // --------------------------------------------------------------------------------------------------------- // ------------------------------------------- [ The Test Cases ] ------------------------------------------ // --------------------------------------------------------------------------------------------------------- public void checkBaseline() { //--Ensures setUp() works and can find our xml file! } public void testBaseline() { checkBaseline(); } public void testMkFromDelimitedList_AntX05() { runTarget("testMkFromDelimitedList_AntX05"); } public void testMkFromStringsList_AntX05() { runTarget("testMkFromStringsList_AntX05"); } public void testMkFromStringsFile_AntX05() { runTarget("testMkFromStringsFile_AntX05"); } public void testMkFromEmbeddedFileList_AntX05() { runTarget("testMkFromEmbeddedFileList_AntX05"); } public void testEmbeddedFileListInheritsBaseDir_AntX05() { runTarget("testEmbeddedFileListInheritsBaseDir_AntX05"); } public void testMergesShorthandAndEmbeddedFileLists_AntX05() { runTarget("testMergesShorthandAndEmbeddedFileLists_AntX05"); } public void testOnlyOneShorthandNameParam_AntX05() { runTarget("testOnlyOneShorthandNameParam_AntX05"); } public void testFailPreexistingNonDir_AntX05() { runTarget("testFailPreexistingNonDir_AntX05"); } public void testPassPreexistingNonDir_AntX05() { runTarget("testPassPreexistingNonDir_AntX05"); } } /* end-of-MkdirsTaskTest.java */
mkdirs.xml
Description: application/xml
itemconstruct.xml
Description: application/xml
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]