You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Duffey, Kevin" <KD...@marketron.com> on 2003/05/12 21:19:37 UTC

How to call a JUnit TestSuite?

Hi all,

We are trying to get JUnit tests to run. Normally we create a class with main() and call the suite() method which we run all tests with. Is there any way to call this from the junit task, or do I have to run all the individual tests in the junit task?

Thanks.
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.467 / Virus Database: 266 - Release Date: 4/1/2003
 


***********************************************************
The information contained in this e-mail message may be 
confidential and  protected from disclosure. If you are 
not the intended recipient, any dissemination, distribution
or copying is strictly prohibited. If you think that you 
have received this e-mail message in error,
please e-mail the sender at exchangeadmins@marketron.com
***********************************************************


Re: How to call a JUnit TestSuite?

Posted by Swaminathan Gurumoorthy <sw...@yahoo.com>.
You can use something like this...it creates a neat html report after running all tests. Replace <test> tag in <junit> task with your own test name ********************************* <project name="projectname" default="main" basedir=".">
<property name="reportdir"          value="${basedir}/reports"/>
 <target name="init">
   <tstamp prefix="build"/>
   <echo>Build starts at ${build.DSTAMP}-${build.TSTAMP}</echo>
  </target>     <target name="unittest" depends="init">
       <junit printsummary="yes" haltonfailure="no">
         <classpath refid="project.class.path"/>
         <test name="com.company.unittest.AllTests" haltonfailure="no" outfile="result">
      <formatter type="xml"/>
    </test>       
       </junit>
       
       <mkdir dir="${reportdir}/report-${build.DSTAMP}-${build.TSTAMP}"/>
       
       <junitreport todir="${reportdir}/report-${build.DSTAMP}-${build.TSTAMP}">
    <fileset dir="${basedir}" includes="result.xml"/>
    <report format="frames" todir="${reportdir}/report-${build.DSTAMP}-${build.TSTAMP}"/>
  </junitreport>
      </target>
    
  
  </project>

"Duffey, Kevin" <KD...@marketron.com> wrote:Hi all,

We are trying to get JUnit tests to run. Normally we create a class with main() and call the suite() method which we run all tests with. Is there any way to call this from the junit task, or do I have to run all the individual tests in the junit task?

Thanks.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.467 / Virus Database: 266 - Release Date: 4/1/2003



***********************************************************
The information contained in this e-mail message may be 
confidential and protected from disclosure. If you are 
not the intended recipient, any dissemination, distribution
or copying is strictly prohibited. If you think that you 
have received this e-mail message in error,
please e-mail the sender at exchangeadmins@marketron.com
***********************************************************


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


---------------------------------
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.