executing test case from ANT

Posted by shilpi.agarwal3373 on 06-May-2016 08:19

Hi Team,

I am creating Test cases in ABLUnit project and want to execute test cases from ANT. I Created ANT script to compile the progress programs (.p's) and execute the test cases. My Ant Script for compiling the programs are working fine but when I try to execute the test case(test procedure), I am getting an error.

C:\shilpi\poc\ablunit\tests --- contain test cases(.ps)

C:\shilpi\poc\ablunit\build --- contain compiled Progress programs(.r's)

C:\shilpi\poc\ablunit\results --- Result of test case execution in XML form.

ANT script for executing test cases-

<target name="taskdef">
<taskdef name="ablunit" classname="com.progress.openedge.ant.ablunit.ABLUnitTask" classpath="c:\abl\lib\ant-ablunit.jar" />
</target>
<target name="ablunit" depends="taskdef,compile" description="run unit tests">
<ablunit dlc="${DLC_HOME}" environment="gui" printsummary="true" tempdir="c:\shilpi\POC\ablunit" >
<dbinfo name="c:\rishi\test\data\autodb.db" port="4500"/>
<batchtest todir="results">
<fileset dir="tests" includes="**/*.p" >
</fileset>
</batchtest>

</ablunit>
<echo message="Run Test cases" />
</target>

Error:-

Buildfile: C:\shilpi\POC\ablunit\build.xml
taskdef:
prepare:
[echo] Directory created
clean:
[echo] clean done
compile:
[PCTCompile] PCTCompile - Progress Code Compiler
[PCTCompile] 2 file(s) compiled
[echo] Build process
ablunit:
[ablunit] Running C:\shilpi\POC\ablunit\tests\testFindCust.p

BUILD FAILED
C:\shilpi\POC\ablunit\build.xml:37: com.progress.openedge.ant.ablunit.ABLUnitTaskException: The results file does not exists: C:\shilpi\POC\ablunit\results\res\Test-ABLUnit-testFindCust.xml

Total time: 8 seconds

Please suggest.

All Replies

Posted by DivyaTheja on 06-May-2016 08:46

Hello Shilpi,

May i know, which version of OpenEdge you are using? Could you please try including ablunit.pl and OpenEdge.Core.pl file to PROPATH as below. From version 11.5, this ablunit task need dlc parameter to be included.

<ablunit dlc="${DLC_HOME}" environment="tty" tempdir="${wrkdir}">      

   <batchtest todir="Results">

       <fileset dir="tests" includes="**/*.p" />

   </batchtest>

   <propath>      

       <pathelement location="${DLC_HOME}\gui\ablunit.pl" />

       <pathelement location="${DLC_HOME}\gui\OpenEdge.Core.pl" />

   </propath>

</ablunit>  

Please let us know if you still see the issue.

Hope this helps,

DivyaTheja

Posted by shilpi.agarwal3373 on 06-May-2016 08:59

i am using open edge 11.4. I have added the propath but still facing the same error. Please help me.

Share my entire ANT script-

<project name="OE" default ="ablunit">

<property name="DLC_HOME" value="C:\Progress\OpenEdge"/>

<target name="clean">

<delete>

   <fileset dir="build" includes="**/*.r" />

   </delete>

  <echo message="clean done"> </echo>

</target>

<target name="prepare" >

  <mkdir dir="build"/>

  <mkdir dir="results"/>

  <echo message="Directory created"> </echo>

</target>

<!-- Compile all the .p files from dir c:\rishi\test\wrk1 and place .r in c:\shilpi\poc\ablunit\build and .pct folder is also created inside build -->

<taskdef resource="PCT.properties" classpath="C:\abl\lib\PCT.jar" />

<target name="compile" depends="prepare,clean" description="create .rs in build folder">

<PCTCompile destDir="build" dlcHome="C:\\Progress\\OpenEdge">

  <fileset dir="c:\rishi\test\wrk1">

    <include name="**/*.p" />    

  </fileset>

<propath>

   <pathelement path="wrk1"/>

</propath>

<PCTConnection paramFile="c:\rishi\test\test.pf" />

</PCTCompile>

<echo message="Build process" />

</target>

<!-- Run Test cases -->

   <!-- Target for defining 'ablunit' -->

<target name="taskdef">

   <taskdef name="ablunit" classname="com.progress.openedge.ant.ablunit.ABLUnitTask" classpath="c:\abl\lib\ant-ablunit.jar" />

</target>    

<target name="ablunit" depends="taskdef,compile" description="run unit tests">

       <ablunit dlc="${DLC_HOME}" environment="gui" printsummary="true" tempdir="c:\shilpi\POC\ablunit" >

              <dbinfo name="c:\rishi\test\data\autodb.db" port="4500"/>

              <batchtest todir="results">                          

                   <fileset dir="tests" includes="**/*.p" >    

                   </fileset>

               </batchtest>

        <propath>      

              <pathelement location="${DLC_HOME}\gui\ablunit.pl" />

              <pathelement location="${DLC_HOME}\gui\OpenEdge.Core.pl" />

          </propath>

       </ablunit>

       <echo message="Run Test cases" />

   </target>

</project>

Posted by DivyaTheja on 09-May-2016 00:11

Hello Shilpi,

Could you please try running your ANT script by adding verbose parameter (-v). Please let us know the output of the ant script after running in verbose mode.

-DivyaTheja

This thread is closed