Menu

Javadocs for function point attributues

Help
berntie
2007-12-04
2013-04-25
  • berntie

    berntie - 2007-12-04

    Hi!

    I have a rather theoretical question: As the rules for "valid" function points are declared in the Javadoc comments of the tag's class, I wonder how and when this is intepreted for validating test scripts. I think this functionality is provided by jelly but I couldn't find any reference to that on their website. And the tutorial there consists mainly of broken links...

    Can anybody point me to a place where I can learn about that?

    Thanks
    Bernhard

     
    • Christian Hargraves

      The rules for valid function points are not declared in the javadocs. They are only documented there as well as a syntax reference html is generated via a similar mechanism. Tags are validated in two basic ways:

      1 - via a TagLibrary (Jameleon's is TestCaseTagLibrary)
      2 - handling them once the tag is being executed. I do this via JameleonTagSupport and the AttributeBroker. When the tags are actually registered, I instantiate them and serialize them to the file system.

      When you say "I wonder how and when this is intepreted for validating test scripts", what do you mean exactly?

       
    • berntie

      berntie - 2007-12-05

      Hi!

      What I'm meaning is: When creating custom function points, how does Jameleon know the name of the XML element, which attributes it requires, etc.? The only location where this is stated is the comment to the attributes in the tag's Java class. So I thought that Jameleon would somehow interpret these comments...

      Bernhard

       
      • Christian Hargraves

        It's not Jameleon that knows the name of the tag, it's Jelly. If you want to add tags to Jelly, you can implement a TagLibrary. When Jelly comes across a tag that isn't in its namespace (jelly:jameleon), then  it searches for the TagLibrary (in this TestCaseTagLibrary). This tag library is responsible for creating the tags and passing them back to Jelly. TestCaseTagLibrary reads a series of files, listed in jameleon.conf defined by "plugins" as well as TestCaseTagDefs.properties.

        Each of those files has a key-value listing of tag-name=package.classname. When the tags are "registered", the following custom actions occur:

        - The javadocs inside the .java file are parsed and made sense of. The new code in SVN uses qdox for this.
        - A Jameleon bean called FunctionalPoint is instantiated and populated with the data pulled from the comments.
        - This class is then serialized to the a file.
        - The tag name and the class of the tag (not the FunctionalPoint bean) are written to a properties file, defaulting to TestCaseTagDefs.properties. Each plug-in has their properties file. For example, jiffie-plugin.properties

        When Jelly wants to make sense of these tags, the following happens:

        - Jelly calls TestCaseTagLibrary.
        - TestCaseTagLibrary parses the properties files.
        - TestCaseTagLibrary returns the corresponding tag.
        - Jelly instantiates the Tag
        - In Jameleon, all tags extend JameleonTagSupport.
        - JameleonTagSupport deserializes the FunctionalPoint belonging to the tag
        - JameleonTagSupport is responsible for the following:
           - Throws an exception when passed an attribute it doesn't understand
           - Throws an exception when a 'required' attribute is null or not set
           - Sets the values of the attributes to the 'default' value described in the javadocs
           - Binds the context variable value to the tag's attributes.
           - maybe more, but I can't remember.

        Is this what you were looking for?

         
        • berntie

          berntie - 2007-12-05

          Yes, that's what I wanted to know.

          Thank you very much. :-)
          Bernhard

           

Log in to post a comment.