Summary

RPGUnit is an open source framework aimed at making unit testing easy for RPG programmers.

RPGUnit is a regression testing framework, similar to JUnit but written in RPG, a procedural language mainly found on the iSeries platform (a.k.a. AS/400). Developers use it to implement unit tests in RPG ILE. RPGUnit is Open Source Software, released under the Common Public License Version 1.0 and hosted on SourceForge .

Features

  • General assertion facilities
  • Automatic detection of test procedures using introspection
  • Special setup and teardown procedures to avoid duplication between test cases
  • Standard compiling command
  • CL-friendly command line runner. A failure or an error will be percolated to the caller

News

2007-09-29 - Release 0.3

The 0.3 release changes two behaviors.

First, the tearDownSuite procedure is called even if the setUpSuite procedure raises an error. That way, the clean-up activities in tearDownSuite always get a chance to run.

Second, the fail facility can now be called from inside a monitor block. The failure exception will not be trapped inside it. No need to use an on-error statement and an intermediate variable (e.g. failureSeen = *on) anymore.

This release also introduces several enhancements to make the framework more user-friendly.

  • online help for commands with F1 key
  • command parameters are now consistent
  • spool files with test results have the name of the test program in the User Data field
  • status messages are sent during test execution

See the release notes for an exhaustive list of changes.

2007-06-10 - File Release on SourceForge

The source code is available as archives (both .zip and .tar.gz) on sourceforge. No need for a subversion client anymore.

2007-06-09 - New Maven-generated Website

The website is now generated by Maven .

Usage

  • Create a NoMain RPGLE source member.
    H NoMain
    
     /copy RPGUNIT1,TESTCASE
    
    DtestSomething    pr                        
                                                
    PtestSomething    b                   Export
    DtestSomething    pi                        
     * insert test code here                      
    P                 e                         
  • Write a test case, using assertion procedures (assert, iEquals, aEquals, fail...).
  • Compile the test, either using the RUCRTTST command or manually.
  • Run the test, using the RUCALLTST command.

You can also try the TDD tutorial .