Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 16873 invoked from network); 21 May 2004 09:27:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 21 May 2004 09:27:21 -0000 Received: (qmail 10169 invoked by uid 500); 21 May 2004 09:27:57 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 10011 invoked by uid 500); 21 May 2004 09:27:56 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 9994 invoked by uid 98); 21 May 2004 09:27:55 -0000 Received: from steve_l@iseran.com by hermes.apache.org by uid 82 with qmail-scanner-1.20 (clamuko: 0.70. Clear:RC:0(156.153.255.237):. Processed in 0.379933 secs); 21 May 2004 09:27:55 -0000 X-Qmail-Scanner-Mail-From: steve_l@iseran.com via hermes.apache.org X-Qmail-Scanner: 1.20 (Clear:RC:0(156.153.255.237):. Processed in 0.379933 secs) Received: from unknown (HELO palrel12.hp.com) (156.153.255.237) by hermes.apache.org with SMTP; 21 May 2004 09:27:55 -0000 Received: from timmay.hpl.hp.com (timmay.hpl.hp.com [15.144.30.251]) by palrel12.hp.com (Postfix) with ESMTP id 6521A40CB75 for ; Fri, 21 May 2004 02:27:04 -0700 (PDT) Received: from [15.204.22.107] (branaid619.uksr.hp.com [15.204.22.107]) by timmay.hpl.hp.com (8.11.1 (Revision 1.6) /8.9.3 SMKit7.1.0) with SMTP id i4L9R0D14086 for ; Fri, 21 May 2004 10:27:01 +0100 (BST) Message-ID: <40ADCB67.9090108@iseran.com> Date: Fri, 21 May 2004 10:27:03 +0100 From: Steve Loughran User-Agent: Mozilla Thunderbird 0.6 (Windows/20040502) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ant Developers List Subject: Re: enumerating all classes in a package References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-HPLB-IMAP-MailScanner-Information: Please contact the Helpdesk for more information X-HPLB-IMAP-MailScanner: Found to be clean X-HPLB-IMAP-MailScanner-SpamCheck: not spam, SpamAssassin (score=0, required 5) X-Spam-Rating: hermes.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N didge wrote: > There's nothing that I know of in the JDK to search a path consisting of > urls by patterns and certainly there is no help in the ClassLoader and > Package APIs for discovering classes. I thought that you might be able to > hack on the funny RMI classloader, but since it sounds like it delegates to > another classloader, it too is probably insulated from the actual file > system where resources are located. > > I think you are going to have to either: > 1. Tell the JUnit runner explicity which test classes to execute, or > 2. Provide the JUnit runner network access to the file systems, perhaps > through http, ftp, nfs, or samba, so it can resolve and search urls itself, > or > 3. Copy all resource local to the JUnit runner, a la GUMP. > > Personally, I like the first approach better because it allows you to have > multiple, disributed JUnit runners work in parallel. the current impl does let you list classes to run classes [ "test.test1","test.test2" ] i just wanted to replicate the **/*Test.class trick. Maybe later i'll resort to one of the others. Actually, the trick would be to decouple it; have something that builds up the list of classes to execute (say on a machine with access to the jar/raw files), then feed that list in to the subsidiaries. Hmm.. > > Imagine an ant task the uses a fileset to find all of the **/*Test.class > files (ie the test classes) and uses a registry to find or ssh to launch > distributed JUnit runners with which to distribute those test classes. The > ant task would also have to provide each JUnit runner with a suitable > classpath so that the JUnit runner would be able to access any other > resources it needs to execute the test. Finally, the ant task collates the > results into a final report and mails it off. This isnt really ant so much as a deployment framework that runs standalone or under ant, whose aim in life is to get code to remote machines (securely) and run it. remote JUnit execution is something that it enables, which could be very cool indeed. As an aside, this seems a bit of a failure of classloaders/introspection if you cannot ask questions about the system "what clases are under this package", "what packages are here", etc. It looks like .NET's System.Reflection does have a stronger notion of enumerating assemblies for modules, modules for types, etc. -steve --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org