Return-Path: Mailing-List: contact user-help@ant.apache.org; run by ezmlm Delivered-To: mailing list user@ant.apache.org Received: (qmail 59507 invoked from network); 13 Feb 2003 15:25:18 -0000 Received: from junior.lgc.com (134.132.72.99) by daedalus.apache.org with SMTP; 13 Feb 2003 15:25:18 -0000 Received: from lgchvw01.lgc.com (lgchvw01.lgc.com [134.132.93.107]) by junior.lgc.com (8.11.3/8.11.3) with SMTP id h1DFOFB14899 for ; Thu, 13 Feb 2003 09:24:15 -0600 (CST) Received: from 134.132.93.152 by lgchvw01.lgc.com (InterScan E-Mail VirusWall NT); Thu, 13 Feb 2003 09:25:19 -0600 Received: by lgchexchbh.ad.lgc.com with Internet Mail Service (5.5.2653.19) id <1C731F3X>; Thu, 13 Feb 2003 09:25:19 -0600 Message-ID: From: Dominique Devienne To: "'Ant Users List'" Subject: RE: Passing command line parameter to ant and reading them from w ithin JUnit Date: Thu, 13 Feb 2003 09:25:17 -0600 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N The zip was stripped from the post, so get it from BugZilla: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17045 --DD -----Original Message----- From: Dominique Devienne Sent: Thursday, February 13, 2003 9:18 AM To: 'Ant Users List' Subject: RE: Passing command line parameter to ant and reading them from within JUnit Just as a teaser, here's how I do it: ... simply extends to add the data type, which is a little experiment I coded. The 3 classes in questions are included in the zip. (Provided without any warranties; use this code at your own risk). Note that this new feature was discussed earlier on the Ant forums, and I just hacked at it. The code is neither well tested nor production quality, but works for the limited use I make of it. --DD -----Original Message----- From: Jesse Stockall [mailto:jesse@cryptocard.com] Sent: Wednesday, February 12, 2003 6:45 PM To: Ant Users List Subject: Re: Passing command line parameter to ant and reading them from within JUnit On Wednesday, February 12, 2003, at 07:31 PM, Tony Obermeit wrote: > I would like to reference the property values passed > on the command line to ant within Junit java code. Is > this possible? Yes. If you run Ant like this: ant -Dmyprop1=value1 -Dmyprop2=value2 Define your junit target like this: Then in your testcases you can do System.getProperty("prop1"); Jesse Stockall - jesse@cryptocard.com CRYPTOCard Corp.