Understanding ABLUnit ...

Posted by Tim Kuehn on 03-Mar-2015 12:24

I'm trying to get my head around ABLUnit - and to accomplish that goal I need docs that explain things to me. 

Here's some questions I've got so far, and would like to see answers to: 

  1. Why is the ABLUnit docs only in the PDS docs? It took me a number of hours just to find the docs before I could even start reading it. This stuff should at least be mentioned in the ABL Reference so developers can find this stuff and know it exists. 
  2. What's the difference between an ABL Unit project and a generic OE project?
  3. Why do I need an ABLU project? 
  4. How is an ABLU project supposed to interact with my existing OE code base? Is the idea that I create an ABLU project and point it's PROPATH at the project to be tested? 
  5. Looking at the Test Suite code, I'm seeing a lot of class references in strings - what happens if a code base is refactored and the target classes get moved? 
  6. I'd really like to see examples where the code starts with an ABLUnit/OE project, and then builds out some examples on using the different concepts from there. 

All Replies

Posted by Peter Judge on 03-Mar-2015 13:10

  1. What's the difference between an ABL Unit project and a generic OE project?
The ABLU project contains the views, launch configs and propath elements (I think) for running ABL unit test suites and cases.
  1. Why do I need an ABLU project? 
^^
  1. How is an ABLU project supposed to interact with my existing OE code base? Is the idea that I create an ABLU project and point it's PROPATH at the project to be tested? 
The intent is that you create new classes that test new or existing business or infrastructure logic. So yes, you point the test project's propath at the business logic.
-- peter
 
[collapse]
From: Tim Kuehn [mailto:bounce-timk519@community.progress.com]
Sent: Tuesday, 03 March, 2015 13:25
To: TU.OE.Development@community.progress.com
Subject: [Technical Users - OE Development] Understanding ABLUnit ...
 
Thread created by Tim Kuehn

I'm trying to get my head around ABLUnit - and the docs need improving to help me. 

  1. Why is the ABLUnit docs only in the PDS docs? It took me a number of hours just to find the docs before I could even start reading it. This stuff should at least be mentioned in the ABL Reference so developers can find it and read about.
  2. What's the difference between an ABL Unit project and a generic OE project?
The ABLU project contains the views, launch configs and propath (I think) for running ABL unit test suites and cases.
  1. Why do I need an ABLU project? 
^^
  1. How is an ABLU project supposed to interact with my existing OE code base? Is the idea that I create an ABLU project and point it's PROPATH at the project to be tested? 
The intent is that you create new classes that test new or existing business or infrastructure logic. So yes, you point the test project's propath at the business logic.
  1. Looking at the Test Suite code, I'm seeing a lot of class references in strings - what happens if a code base is refactored and the target classes get moved? 
  2. I'd really like to see examples where the code starts with an ABLUnit/OE project, and then builds out some examples on using the different concepts from there. 
Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

Posted by Tim Kuehn on 03-Mar-2015 13:16

Thx Peter!

Where I am now:

I've copied the "working" and "test/testsuite" classes from the PDF docs into an OE and ABLUnit project.

I'm trying to run my test - and I can't find anything which tells me how to run this test...

Am I supposed to create a .p which instantiates the test suite class?  What am I missing here?

Posted by Peter Judge on 03-Mar-2015 13:21

There are specific launch configs (in the ABLUnit view) to launch the tests. You can right-click the tests and select Run As > ABLUnit Application, and some automagic happens under the covers.
 
To debug tests, you have to create a wrapper .p and call it as you would any other (there's an issue logged to remedy that).
 
-- peter
 
[collapse]
From: Tim Kuehn [mailto:bounce-timk519@community.progress.com]
Sent: Tuesday, 03 March, 2015 14:17
To: TU.OE.Development@community.progress.com
Subject: RE: [Technical Users - OE Development] Understanding ABLUnit ...
 
Reply by Tim Kuehn

Thx Peter!

Where I am now:

I've copied the "working" and "test/testsuite" classes from the PDF docs into an OE and ABLUnit project.

I'm trying to run my test - and I can't find anything which tells me how to run this test...

Am I supposed to create a .p which instantiates the test suite class?  What am I missing here?

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

Posted by Tim Kuehn on 03-Mar-2015 13:29

I have a "test suite" class that looks like this:

USING Progress.Lang.*.

BLOCK-LEVEL ON ERROR UNDO, THROW.

CLASS TestSuite:

@TestSuite(classes = "ABLUnit.TestClass.MyClass, MyTestClass").

END CLASS.

and if I try to run that, I only get OE Mobile and OE Application as run options.

If I go to the class with the actual tests - like the following code snippet:

CLASS MyTestClass:

@Test.

METHOD PUBLIC VOID TestM1( ):


Then I get the ABL Unit run menu and I'm seeing some activity now.

How does the "Test suite" class fit into things? 

Posted by Peter Judge on 03-Mar-2015 13:33

A suite is a set of test cases.
 
A test case is a set of individual tests. A test case can be a class or a procedure. A test is a method or function/procedure, depending on that.
 
-- peter
 
[collapse]
From: Tim Kuehn [mailto:bounce-timk519@community.progress.com]
Sent: Tuesday, 03 March, 2015 14:31
To: TU.OE.Development@community.progress.com
Subject: RE: [Technical Users - OE Development] Understanding ABLUnit ...
 
Reply by Tim Kuehn

I have a "test suite" class that looks like this:

USING Progress.Lang.*.
 
BLOCK-LEVEL ON ERROR UNDO, THROW.
 
CLASS TestSuite:
 
@TestSuite(classes = "ABLUnit.TestClass.MyClass, MyTestClass").
 
END CLASS.

and if I try to run that, I only get OE Mobile and OE Application.

If I go to the class with the actual tests - like so:

CLASS MyTestClass:
 
@Test.
 
METHOD PUBLIC VOID TestM1( ):


I get the ABL Unit menu and I'm seeing some activity now.

How does the "Test suite" class fit into things? 

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

Posted by Tim Kuehn on 03-Mar-2015 13:38

How is the test suite class supposed to be used if the ABL Unit project doesn't acknowledge and run the class?

Posted by Tim Kuehn on 03-Mar-2015 17:00

As it turns out, the @TestSuite() annotations need to be outside the CLASS/END CLASS definition in order to be run by the ABL Unit test.

I had it run an existing test class I've been playing with, and changed some conditions so it'd fail - and it hasn't failed....

So now I'm puzzled again....

Posted by Tim Kuehn on 03-Mar-2015 17:04

Figured it out...

This thread is closed