Finally, I embeded pbunit’s test result into CruiseControl.net’s dashboard. I worked very hard to make this happen. Things I have done includes:

  • Changed PBUnit to generate xml report. (Using datawindow xml template, and xsl-stylesheet)
  • Changed PBUnit to accept command line to pass pb target file.
  • Changed PBUnit to loop through all the pbls and components to do automated test.
  • Fixed a bug in PBUnit of lib path containing space.
  • Created a xsl for PBUnit’s test result.

After merging PBUnit’s test result into cc.net output, I can see my work appear on web now.


TODO list:

  • If a testcase class loading failed, application looks like hung there, stop button won’t change back to ‘Run’. Some exception check has to be done there.
  • Application should keep the recent target file info to next time auto-loading, just like NUnit.
  • Main Window should changed to tree-view style, like NUnit.
  • Capable to test a single method in testCase.
  • xml generated by datawindow still has some bug, the group header column can’t use expression. Which mean the element attributes in group header can use sum, or min function, so the total time and test-suite success and execute are all hard-coded to True now. This bug forced me had to change my pbunit-test.xsl file which was copied from Nuint-test.xsl. In line 103:

    <xsl:apply-templates select=”.//test-suite[@success=’False’][results/test-case]” >

    <xsl:apply-templates select=”.//test-suite[results/test-case/@success=’False’]” >

Also, unittests.xsl needs to be modified like this:


<xsl:variable name=”nunit2.time” select=”sum($nunit2.result.list/test-suite[position()=1]/@time)”/>
<xsl:variable name=”nunit2.failure.list” select=”$nunit2.case.list/failure”/>

<xsl:variable name=”nunit2.time” select=”sum($nunit2.result.list/test-suite/results/test-case/@time)”/>

<xsl:variable name=”nunit2.failure.list” select=”$nunit2.case.list[@success=’False’]”/>

line 73:

<xsl:call-template name=”nunit2testdetail”>
<xsl:with-param name=”detailnodes” select=”//test-suite/results/test-case[@success=’False’]”/>   (used be ../failure)

I really need somebody to help me to improve this tool, so I create a open-source project on SourceForge. But SF refused me to name it PBUnit, then PowerUnit came to my head.
SourceForge supports both CVS and SVN, neither is easy for Powerbuilder development, unless you can find a SCC proxy for CVS, it seems PuskOK from Russia is the only option by now.


4 thoughts on “PowerUnit?

  1. Hi Frank,

    I am new to PowerBuilder even though I was exposed to it many years ago, We are working on a legacy project using PowerBuilder and we are thinking to introduce PBUnit to the project to kick start unit testing and got stuck with datawindows. The issue was we are not able to use datawindows to do getters/setters on the datawindows’ control elements without opening it visually. Could you please advise if we can use datawindows in PBUnit at all. If yes could you please advise on how (not open it visually as we don’t need it in our testing).

    I am looking forward to hearing from you soon.

    Best Regards

    Victor Yao

  2. Hi Victor, first of all, PBUnit can only work with nvo (non-visual-object). To test datawindow, you have to eye-check the visual result, otherwise there is no better way to do it.

    • Hi Frank,

      Many thanks for your response. In that case it is not possible to auto
      testing those datawindows.

      Best regards


      • data window is considered as ui element so unit test is not applicable. you might want to look into some ui automation test tool like phantom ui test.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s