Menu

Interest in reporting patch

Paul King
2004-05-20
2004-05-27
  • Paul King

    Paul King - 2004-05-20

    Hi, we have recently contributed a patch entitled "Support for customizable reporting" which we find very useful. It allows us to combine our canoo webtest reporting with some sqlunit reporting using ant scripts like the one below. There is nothing requiring canoo webtest though and you can always default back to the text reporter for backwards compatibility. Example ant script:

    <target name="Signup Member" depends="init">

      <echo message="Signup: Sign up a new member"/>

      <sqlunit testfile="dbmsSignup_pre.xml" haltOnFailure="false" debug="false"
        failureproperty="test.failure"
        name="Signup: Checking user doesn't exist prior to signup"
        logfile="${results.dir}/${results.file}" logformat="canoo"/>

      <testSpec name="Signup: Perform Signup via Web">
        &config;     
        <steps>
        <!-- canoo webtest steps go here -->
        </steps>
      </testSpec>

      <sqlunit testfile="dbmsSignup_post.xml" haltOnFailure="false" debug="false"
        failureproperty="test.failure"
        name="Signup: Check Database for new user, and then revert"
        logfile="${results.dir}/${results.file}" logformat="canoo"/>

    </target>

    This result in an xml output file which we then process using the built-in ant style functionality to produce an HTML report. You can see what this looks like at the following URL (if you have trouble just go to the patches section of the sourceforge SQLUnit website):

    http://sourceforge.net/tracker/download.php?group_id=77832&atid=551359&file_id=87761&aid=957313

    If there is sufficient interest I would be keen to have this merged into the main source tree and if that is the case are there any guidelines for what tests/docs would be desirable?

    Thanks, Paul.

     
    • Sujit Pal

      Sujit Pal - 2004-05-20

      Hi Paul,

      Thanks for the patch. From your description, it sounds interesting, I will look at the patch (and canoo, which I have never used) over the weekend, and get back to you on this.

      Thanks again,
      Sujit

       
    • Sujit Pal

      Sujit Pal - 2004-05-24

      Hi Paul/Rob,

      I am still in the process of merging your changes to the main code base, it was a little harder since the patch was against an older release. One thing I noticed was that the canoo reporter is explicitly instantiated within SQLUnit task handler. Assuming people add support for more reporters in the future, this would not be the most ideal way of allowing this, IMO. So I am going to add in a ReporterFactory class which will use the name of the reporter to decide at runtime which one to use.

      I am changing the name of the thread so people pick up on this as something that will be supported in SQLUnit in the near future.

      -sujit

       
    • Sujit Pal

      Sujit Pal - 2004-05-25

      Hi Paul/Rob,

      I have merged in your patch to the SQLUnit source tree. I have tested the TextReporter against my PostgreSQL test file and it looks good. Can you pull out the code from cvs and test it and let me know if your Canoo tests run with this code?

      Thanks
      Sujit

       
    • Sujit Pal

      Sujit Pal - 2004-05-27

      Hi Paul/Rob,

      Your patch is now in release 3.6 of SQLUnit. It was released few minutes ago.

      -sujit

       

Log in to post a comment.