Actually, our tests are in the source tree, so our pattern is
**/test/*Test.class, and in fact we have a little utility that scans a
classpath or search path for test classes. The test class name pattern is
the first filter, then it needs to be assignable to junit.framework.Test,
and then we have custom criteria like the type of the test (a public static
final String with a value), and finally the 'tools' the test requires (as a
public static final String again) if any (and you explicitly declare what
you have). Discovered later than junit already has a TestCaseLoader that
scan a directory for tests, but it's not has flexible.

Anyways, glad it now works for you. --DD

-----Original Message-----
From: John Lindwall [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, May 30, 2002 5:11 PM
To: 'Ant Users List'
Subject: RE: 2 Questions: JunitReport & Fileset

That's perfect -- Thanks!

So is *Test.java the standard naming practice?  What does one do when you
have a java file named "Test.java"!? :)  (Which we actually do)

John

> -----Original Message-----
> From: Dominique Devienne [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 30, 2002 1:22 PM
> To: 'Ant Users List'
> Subject: RE: 2 Questions: JunitReport & Fileset
> 
> 
> Did you try <exclude name="**/*$$*.class" /> ?
> 
> We use the **/*Test.class pattern, so inner classes not 
> ending in Test are
> left alone ;-) --DD
> 
> -----Original Message-----
> From: John Lindwall [mailto:[EMAIL PROTECTED]] 
> Sent: Thursday, May 30, 2002 3:19 PM
> To: 'Ant Users List'
> Subject: 2 Questions: JunitReport & Fileset
> 
> Ant 1.4.1
> 
> 1. Using JUnitReport can I customize the output at all?  I want the
> date/time of the test execution to appear on the main page.
> 
> 2. Our junit unit tests live in a parallel source tree and 
> are all prefixed
> with the string "Test".  For example "TestStartTime.java".  
> Some of the unit
> tests make use of inner classes.  I'm trying to construct a junit task
> definition that will execute the main class as a unit test 
> but not the inner
> classes.  Here's what I'm using now, and it results in junit 
> attempting to
> run the inner classes like "Test$Trials.class":
> 
>     <junit>
>       <formatter type="xml" />
>       <batchtest fork="yes" todir="test-results">
>         <fileset dir="${testDst}">
>           <include name="**/Test*.class" />
>         </fileset>
>       </batchtest>
>       <classpath refid="test.class.path"/>
>     </junit>
> 
> I tried adding <exclude name="**/*\$*.class"/> but that was 
> no good either.
> 
> Thanks!
> 
> --
> To unsubscribe, e-mail:   
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to