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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
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?
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
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?
Yes, that's what I wanted to know.
Thank you very much. :-)
Bernhard