ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wendy Smoak <Wendy.Sm...@asu.edu>
Subject RE: junit testing question
Date Wed, 03 Nov 2004 23:08:42 GMT
> From: Scott Purcell [mailto:spurcell@vertisinc.com] 
> Prior to using ant, our code base was written to use a 
> TestSuite(xxx.class)
> And we ran them via a script like so:
> java junit.textui.TestRunner classname
> Can I still use these with ant? or do I need to rewrite the tests?

I'm not entirely sure I have the same thing you do, but perhaps this
example will help:

public class TestTrakhistViewDAO extends TestCase {
...
  public static void main(String[] theArgs)
  { junit.textui.TestRunner.run( suite() ); }

  public static Test suite()
  { // All methods starting with "test" will be executed in the test
suite.
    return new TestSuite(TestTrakhistViewDAO.class); }
...

<target name="test" depends="compile-test">
  <junit showoutput="true">
     <test name="edu.asu.vpia.dao.files.TestTrakhistViewDAO"/>
     <formatter type="plain"/>
     <classpath refid="test.classpath"/>
  </junit>
</target>

-- 
Wendy Smoak



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message