That having been said, often STAX code can get very large and complex, and it's useful to treat the development of STAX code just like a "real" development project, including building unit-tests of your STAX code along the way (and frequently running those unit tests to ensure the quality of your STAX code).
I do this by having a separate STAX file whose name is the same as the STAX file-under-test, with the suffix of _UnitTest. So if my main STAX file is MyCode.xml, my unit-test module would be MyCode_UnitTest.xml. Inside MyCode_UnitTest.xml, I have a main function which reads from a list of testcases (from a Python list) and, for each element of that list, it calls the indicated STAX function within the unit-test STAX module. In turn, that (specific testcase) function calls some function of the STAX-module-under-test with specific arguments, and verifies the result of that function in some fashion (checking return code, checking that something has been done to an external entity like a file, etc.) -- just like a JUnit testcase would do for a Java program. The main driver function keeps count of pass/fail counts and prints some summary results at the end. I have even implemented something like the JUnit "Parameterized" test class, which allows a very generic test-driver subroutine to call any function-under-test using specified arguments and specified general result-expectations. I use this in cases where I want to call a function many times (probably with different arguments, expecting different specific results), or in cases where several STAX functions do very similar things. Just like programming in Java, in addition to using the unit-test module as a simple regression test, I also use it as a test-driver while I am initially building my "feature" code. It's usually quicker and easier to drive the code-under-development that way than it is to integrate the code-under-development into the entire system, and do a test-run of the whole system. --------------------------------------------------------------------------------------- Joe Veilleux IBM/Lotus Domino Server Quality Engineering 550 King Street Littleton MA 01460 Email: joeveill...@us.ibm.com From: Sharon Lucas/Austin/IBM@IBMUS To: Tennis Smith <tennis_sm...@yahoo.com> Cc: staf-users@lists.sourceforge.net Date: 12/11/2013 02:18 PM Subject: Re: [staf-users] JUnit-like Testing For STAX Functions No, there isn't an equivalent of JUnit for STAX. STAX is a test tool. -------------------------------------------------------------- Sharon Lucas IBM Austin, luc...@us.ibm.com (512) 286-7313 or Tieline 363-7313 From: Tennis Smith <tennis_sm...@yahoo.com> To: staf-users@lists.sourceforge.net, Date: 12/11/2013 01:13 PM Subject: [staf-users] JUnit-like Testing For STAX Functions Hi, What's the best way to unit test stax functions? Put another way, is there an equivalent of JUnit for STAX? Thanks, -T ------------------------------------------------------------------------------ Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk _______________________________________________ staf-users mailing list staf-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/staf-users ------------------------------------------------------------------------------ Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk _______________________________________________ staf-users mailing list staf-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/staf-users
<<inline: graycol.gif>>
------------------------------------------------------------------------------ Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________ staf-users mailing list staf-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/staf-users