ABL Unit testing framework for OE11.6 ?

Posted by atuldalvi123 on 25-Feb-2016 07:10

Hi All,

Help me to get the white papers for  OE11.6 ABL Unit testing framework.

ABL Unit testing frameworks

All Replies

Posted by Phani Sajja on 25-Feb-2016 07:41

Hi,

community.progress.com/.../2260

--

Regards,

Phani S.

Posted by atuldalvi123 on 25-Feb-2016 07:58

I am looking documentation for 11.6 ABLUnit wizard

Posted by Swathi Yellavaram on 25-Feb-2016 22:50

Please find link for ABLUnit documentation:

documentation.progress.com/.../index.html

Posted by atuldalvi123 on 01-Mar-2016 09:18

How do I run ABLUnit test using Ant task as part of automated builds ?

I really don't have any idea on Ant task. I am using OE11.6. Do I need to install Ant task separately ?

I have created some sample ABLUnit tests programs and are running fine in Developer Studio. Now I want to test those with Ant task.  Please guide me on this stuff.

Posted by Kondra Mohan Raju on 02-Mar-2016 01:09

[View:/cfs-file/__key/communityserver-discussions-components-files/19/3288.ABLUnit-whitepaper-_2D00_-End-to-end-flow.pdf:320:240]

Posted by Phani Sajja on 02-Mar-2016 01:13

You can use ABLUnit Ant task to automate your builds.

Basic concepts of Ant are required to understand how Ant works and how to configure and use ABLUnit as an Ant task.

The below page can be referred how to setup Ant to work with.

[View:http://ant.apache.org/manual/install.html:320:50]

Below is the sample file of build.xml which is configured with the ABLUnit tests.

[View:/cfs-file/__key/communityserver-discussions-components-files/19/4478.build.xml:320:240]

Developer includes the Ant tooling support. You can run the build.xml file as an Ant task (See Run As -> on build.xml file)

--

Regards,

Phani S.

Posted by atuldalvi123 on 02-Mar-2016 02:03

Hi Thanks

Basically I am looking for  ABLUnit testing from automate builds. We have Jenkins for that.

Can you guide me on how to make ABLUnit testing automated builds.

Posted by DivyaTheja on 02-Mar-2016 03:37

Hello Atul,

Here is the whitepaper on continuous integration for OE Apps which include ABLUnit too. Build xml file structure might be different from the one in this document. However, this document provides steps to integrate ABLUnit tests with Jenkins.

Hope this helps,

DivyaTheja

Posted by DivyaTheja on 02-Mar-2016 03:38

Here is the link for documentation: community.progress.com/.../1066

Posted by atuldalvi123 on 02-Mar-2016 03:43

Thanks Divya. will check on this.

Posted by atuldalvi123 on 02-Mar-2016 03:56

Hi,

For ANT configuration, we need apache to be installed on our server and then we can set env variables ANT_HOME and add ANT_HOME\bin to PATH parameter ?

Or

we have to create ANT folder manually and create sub folder bin, lib inside it and then set env variables ?

Posted by DivyaTheja on 02-Mar-2016 04:12

Hello Atul,

For that, ANT needs to be installed on your server. In case, If you have PDSOE installed on your server, PDSOE ships ANT too. All you need to do is set ANT dir in DLC\oeide\plugins\C:\Progress\OpenEdge\oeide\eclipse\plugins\org.apache.ant_<ver> to ANT_HOME variable.

Posted by atuldalvi123 on 02-Mar-2016 04:17

Ya got it. PDSOE installed on my server and found the directory in the path as suggested. I added this path in ANT_HOME and ANT_HOME\bin to PATH.

Thanks.

Now, I copied ant-ablunit.jar from <OpenEdge Installation>\java and placed the jar in ANT_HOME\lib folder. In the document they have mentioned "Add ablunit.pl and OpenEdge.Core.pl (available under <Installation>\<gui or <Installation>\tty>) are added to PROPATH."

Where to add these 2 pl files ?

Posted by DivyaTheja on 02-Mar-2016 04:27

These libraries needs to added to PROPATH in build.xml file.

Here is the example:

<propath>

       <pathelement path="src" />  

       <pathelement path="tests" />

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

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

   </propath>

Posted by atuldalvi123 on 02-Mar-2016 04:53

ok so we have to modify build.xml for this.

I want to confirm one thing here that we can modify build.xml for ABLUnit Testing as well as for generating ABLDoc and then Jenkins will pick these ANT task  based on the Jenkins configuration for these tasks , rite ?

Posted by Mike Fechner on 02-Mar-2016 04:57

Right.

Jenkins will execute ANT jobs. By default the build.xml in the Job's workspace root is executed. But it can run other ANT scripts (even no need to call them build.xml).

Jenkins will by default execute the default target in the build file. But you can specific different targets (space delimited) to execute in the configuration of the ANT build command.

Posted by atuldalvi123 on 02-Mar-2016 05:00

ok  gr8. What will be the location for this build.xml file, where I can get this  ? Can we create separate xml for each ANT task  with diff name say UnitTest. \xml ?

Posted by Mike Fechner on 02-Mar-2016 05:05

whereever you put it.

Posted by atuldalvi123 on 02-Mar-2016 05:09

OK. I thought this file is already available in the DLC path. So we have to create it first time and then we can add each task details in it ?

Also can we create separate xml for each ANT task  with diff name say UnitTest.xml or we have to create build.xml file only and add the details ?

Posted by atuldalvi123 on 02-Mar-2016 07:02

I have created one Unit test framework project under 11.6 and it has created one tests folder by default to design unit test programs. The path of this project is under my workspace dir like C:\User1\WorkSpace\ABLUnitTestFrmWrk

I have created one another new folder SRC for Business logic class programs and designed ABLUnit test cases for that class under tests class. All is working fine, getting results on ABLUnit view as expected and generating result.xml aswell.

Now i designed build xml for automated builds for ABLUnit test as below but i am not sure on the workspace dir. Where to put the path of workspace directory for src and tests folder in this build.xml file ?

Posted by Peter Judge on 02-Mar-2016 09:43

ok so we have to modify build.xml for this.

You do not have to change PROPATH. These are added automatically (unless you've explicitly told the AVM not to, by means of the –baseADE switch). You may need to copy the PLs to the server since they're not installed with all products but once they're in those locations they will always be added to propath.
 
 
 
Posted by atuldalvi123 on 03-Mar-2016 02:20

Hi

I have created one sample build.xml file for my unit test as below. Can someone check the defined basedir and DLC_HOME parameters, means the way of defining these parameters.

what is the use of tofile and outdir parameters ?

Posted by Phani Sajja on 03-Mar-2016 03:45

Your 'build.xml' file looks fine. I think there is a space in basedir after 'C:'.

After successfully run the test, the  results of the test will be written in XML format. Your 'toDir' specified the location to write this file, and 'outfile' is the name of the file. In your case, 'result-TestClass1-gui.xml' file will be created in the toDir location.

--

Regards,

Phani S.

Posted by atuldalvi123 on 03-Mar-2016 03:54

If I don't put outfile parameter , will it create default file in the toDir location ?

Also How can I configure this XML in CI server that is Jerkin without any dependency on any other ANT task ?

In the Continuous Integration document they mentioned like  whenever the code changes are committed to source control, CI Server will trigger the build, run the tests, verifies the result of the test and send feedback to the developers regarding the quality if the build based on the test results.

I don't want any dependency on the committed source, I want to run build.xml separately  for Unit Tests as a scheduled batch.

Posted by atuldalvi123 on 04-Mar-2016 03:26

Thanks guyz for ur help, finally I am able to execute my Unit Test cases as a ANT task using 11.6 developer studio and with command line.  

Where can I get all the list of assertions with how we can use them with the parameter details if available ?

Posted by mihai.pintea on 04-Mar-2016 03:42

The list you can find it: community.progress.com/.../42269

Posted by atuldalvi123 on 04-Mar-2016 04:16

Thanks, that list is there but how we can use those assertions means the calling syntax for those assertions. I need more info on this.

Posted by DivyaTheja on 04-Mar-2016 05:21

You can find Assert API documentation at documentation.progress.com/.../index.html. Please navigate to OpenEdge->Core->Assert class for all Assertions available.

Posted by atuldalvi123 on 04-Mar-2016 06:20

Thanks Divya

Posted by Peter Judge on 04-Mar-2016 08:30
You can find more AP doc as part of https://documentation.progress.com/output/oehttpclient/ . The Assertions are in the OpenEdge.Core and OpenEdge.Core.Assertion packages.
 
 
Posted by atuldalvi123 on 14-Mar-2016 11:31

Hi,

What is the best way to organize the unit test cases in the existing folder structure of the application or in studio ?

Posted by atuldalvi123 on 16-Mar-2016 03:33

any update on my post ?

Posted by bronco on 16-Mar-2016 03:46

There is no best way, you have to figure it out yourself. Only you know the context in which the unit tests live/operate.

This thread is closed