NumberFormatException when running ABL Unit Tests from ant

Posted by Kai Siegele on 12-Oct-2016 07:44

Hallo,

I have difficulaties to integrate ABL Unit tests into the build process. I have written the following simple test case class:

CLASS TestSomeThing:

     

  

       METHOD PUBLIC INTEGER AddNums(INPUT firstNum AS INTEGER, INPUT secondNum AS INTEGER):

            

             DEFINE VARIABLE result AS INTEGER NO-UNDO.

             result = firstNum + secondNum.

             RETURN result.

 

       END METHOD.

 

       @Test.

       METHOD PUBLIC VOID TestFirst( ):

 

       DEFINE VARIABLE result AS INTEGER NO-UNDO.

       result = AddNums(3, 3).

       Assert:Equals(result, 6).

            RETURN.

       END METHOD.

 

END CLASS.

Now I want to integrate the running of this testcases in our build process and I have added a new section in our ant-script as decribed in the Progress documentation:

                <target name="UnitTests" description="Running the Abl-Unittests ">

                               <property name="unitTest" location="..\TestMemberAndRoles"/>

                               <echo message="Ausführen der UnitTests"/>

                               <echo message="$${basedir}=${basedir}"/>

                               <echo message="$${unitTest}=${unitTest}"/>

 

                               <taskdef name="ablunit" classname="com.progress.openedge.ant.ablunit.ABLUnitTask"

                                           classpath="c:/Pro11/dlc/java/ant-ablunit.jar" />

                              

                              

                               <ablunit dlc="C:\Pro11\dlc" environment="gui"

                                           printsummary="no" haltonerror="no" haltonfailure="no"

                                           tempdir="${unitTest}/tmpdir">

                                               <propath>

                                                               <pathelement location="C:\Pro11\dlc\gui\ablunit.pl" />

                                                               <pathelement location="C:\Pro11\dlc\gui\OpenEdge.Core.pl" />

                                                               <pathelement location="${unitTest}\src" />

                                                               <pathelement location="${basedir}" />

                                               </propath>

                                               <test name="${unitTest}\src\TestSomeThing.cls" todir="${unitTest}/tests"

                                           outfile="results" format="xml" />

                               </ablunit>

                </target>

When executing the ant script the xml-file summarizing the test results was created without problems. Unfortunately the build process failed with the following error message:

java.lang.NumberFormatException

        at java.math.BigDecimal.<init>(BigDecimal.java:470)

        at java.math.BigDecimal.<init>(BigDecimal.java:739)

        at com.progress.openedge.ant.ablunit.util.XMLUtilities.populateResults(Unknown Source)

        at com.progress.openedge.ant.ablunit.executor.NativeExecutor.readResults(Unknown Source)

        at com.progress.openedge.ant.ablunit.executor.NativeExecutor.execute(Unknown Source)

        at com.progress.openedge.ant.ablunit.ABLUnitTask.execute(Unknown Source)

        at com.progress.openedge.ant.ablunit.ABLUnitTask.execute(Unknown Source)

        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:606)

        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)

        at org.apache.tools.ant.Task.perform(Task.java:348)

        at org.apache.tools.ant.Target.execute(Target.java:435)

        at org.apache.tools.ant.Target.performTasks(Target.java:456)

        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1405)

        at org.apache.tools.ant.Project.executeTarget(Project.java:1376)

        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)

        at org.apache.tools.ant.Project.executeTargets(Project.java:1260)

        at org.apache.tools.ant.Main.runBuild(Main.java:854)

        at org.apache.tools.ant.Main.startAnt(Main.java:236)

        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:285)

        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:112)

Has anyone an idea why this exception occure and how to prevent this error? We are using the ant version 1.9.7 and OpenEdge 11.6.3.

Please don’t hesitate to contact me for any further information.  I would be grateful for any help.

Kind regards

Kai Siegele

All Replies

Posted by Edward Sullivan on 12-Oct-2016 09:16

Hello Kai.  I am moving this thread to the OpenEdge Development forum where you will have a better chance of receiving a response to your question.

Thanks.

Ed Sullivan

This thread is closed