Instructions to run DevTest with Ant and JUnit

Document ID : KB000010735
Last Modified Date : 14/02/2018
Show Technical Document Details
Introduction:

The DevTest_HOME\examples directory contains the build.xml example file for running Test and suites.  This document shows the instructions to execute DevTest tests and suites as Junit test and view Junit lisa reports.  

Environment:
All Supported DevTest versions.
Instructions:

Steps to follow:

*********************

Set ANT_HOME = C:\ANTx.x\apache-ant-x.x\

 Add to path =C:\ANTx.x\apache-ant-x.x\bin

in the systems Environment variables.

 

In the File Explorer,  navigate to DevTest/examples folder and open the build.xml file. 

 

1. To run one test, you would modify the section below 

  • The oneTest target runs a test case as a JUnit test. The test case is specified with the test attribute.

 In the build.xml we provide the name of the testcase  and the path as below

<junitlisa toDir="${testReportDir}"
test="Tests/DevTest_config_info.tst"
stagingDoc="StagingDocs/1User0Think_RunContinuously.stg"
user="admin"
password="admin"
registry="tcp://10.xx.xx.***:2010/Registry">
<jvmarg value="-Dlisa.tmpdir=${lisa.temp.dir}"/>
</junitlisa>

 

Open a command window, and navigate to the example project. You can execute DevTest tests as JUnit tests within the execution path of an Ant build.

Devtest/example:>ant oneTest

 

2. To run a suite you would modify the section below

  • The lisaTests target runs a suite as JUnit tests. The suite is specified with the lisatest nested element.

suite test part……
<junitlisa toDir="${testReportDir}"
user="admin"
password="admin"
registry="tcp://10.xx.xx.***:2010/Registry">
<jvmarg value="-Dlisa.tmpdir=${lisa.temp.dir}"/>
<lisatest suite="${basedir}/Suites/AllTestsSuite.ste"/>
</junitlisa>

 

in the Command window

Devtest/example:>ant          ( this will run the All suite) 

 

The JUnit reports and log files are generated only when the junitlisa Ant task is used to run tests. 

 You can produce HTML-based reports with the junitlisareport task or the regular junitreport task. The reports are available under DevTest_Home/reports/junit folder.  

<junitreport todir="${testReportDir}">
<fileset dir="<todir specified in the junitreport tag>">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="<todir specified in the junitreport tag>">/>
</junitreport>

Additional Information: