TS 60 TLDeditor

Tag Library Editor Test Specification for NetBeans 6.0

Author: Jindrich Sedek
Version: 1.14
Last update: 22.06.2006
Introduction: This document contains procedures for testing tag library editor. The taglibed module provides syntax highlighting, code completion and validation actions in editor. Besides, both new tag file and tag handler wizards can update contents of the library.
Comments:

Contents


Test suite: Syntax highlighting

Purpose: This test suite checks that syntax highlighting in tag library editor is correct.
Setup: No preparation is necessary for this test suite.

  1. </span>testcase New tag library descriptor</span>
    1. Use File | New Project... to create new Web Application project located in your home directory.
    2. Invoke File | New File... from main menu.
    3. Select Web category and Tag Library Descriptor as file type. Push Next >.
    4. Type library into TLD Name, wizard should modify URI and Prefix fields. Press Finish.
    • </span>result EXPECTED RESULT: New library.tld file is opened in editor and both <short-name> and <uri> tags contain values specified in the wizard. </span>
  1. </span>testcase Syntax highlighting</span>
    1. Open library.tld tag library descriptor node in editor.
    2. Compare the syntax highlighting with this picture.
    • </span>result EXPECTED RESULT: Proper colors should be used for tags ( blue ), attributes ( green ), values ( brown ), comments ( dark green ), plain text ( black }}) and metadata ( dark blue }}).}}
  1. Complex file
    1. Download tokensTLD.tld and save it into web/WEB_INF/tlds directory.
    2. Check coloring and perform next testing also on this file. Try Check XML and Validate XML actions on this file.
    • EXPECTED RESULT: Proper colors should be used and no error should be in this file.



Test suite: Code completion

Purpose: This test suite checks that code completion in tag library editor is working correctly.
Setup: No preparation is necessary for this test suite except having a web project open with library.tld file.
test / testTagLibraryCompletion.tld

  1. Tags completion
    1. Add new line at end of the file before last </taglib> tag and type < .
    2. Press CTRL+Space. List of suggestions appear.
    3. Type tag }} which should reduce list of suggestions to tag-file , tag and taglib-extension .
    4. Using Arrow Down key select tag-file }} finally and press Enter.
    • EXPECTED RESULT: Now you should have <tag-file written at last line
  1. Attributes completion
    1. Press Space and invoke code completion by CTRL+Space again.
    • {{{1}}}
  1. End tag completion
    1. Type 1"> to have the tag completed <tag-file id="1"> .
    2. Editor should show code completion window with end tag </tag-file> . Press Enter.
    3. End tag </tag-file> should be added and cursor should be set between start tag and end tag. Press Enter .
    • EXPECTED RESULT: Closing tag must be moved two lines lower. Cursor should be between starting and closing tag one tab to the right.
  1. Context awareness
    1. Remove the line containg </tag-file> .
    2. Write in removed line <tag-extension>
    3. On the last line type < and press Ctrl+Space to invoke code completion.
    4. Only two items should show up extension-element and /tag-extension .
    5. Type / character and press Enter.
    • EXPECTED RESULT: Closing tag must be automatically completed.
  1. Entities completion
    1. Type & and wait for code completion.
    2. 5 items will be suggested. Type a .
    3. This should reduce the list to only amp and apos items. Press Enter.
    • {{{1}}} should be automatically completed. }} }}

Test suite: Validation

Purpose: This test suite checks that it is possible to check structure and contents of tag library descriptor file.
Setup: No preparation is necessary for this test suite except having a web project open with library.tld file.

  1. Check structure
    1. Delete both lines 24 and 25 so that file ends with </taglib> and replace <uri> at line 5 by <link> .
    2. Right click editor area and choose Check XML from popup menu.
    3. One error at line 5 must be reported in Output - XML check window.
    4. Click The element type "link" ... link. It should highlight the line 5 in editor and move cursor there.
    5. Use CTRL+Z to undo the change in step 1 and repeat step 2.
    • EXPECTED RESULT: XML checking must finish successfully without any error.
  1. Validate contents
    1. Right click editor area and choose Validate XML from popup menu.
    2. No error must show up in Output - XML check window and library descriptor must validate successfully.
    3. Now replace <uri> at line 5 by <link> and repeat step 1.
    • EXPECTED RESULT: Two errors must show up as a result of the validation. One is complaint about invalid <link> element and one is the same error as in previous test case.


Test suite: Tag update

Purpose: This test suite checks that it is possible to register newly created tag file or tag handler in tag library descriptor.
Setup: No preparation is necessary for this test suite except having a web project open with library.tld file.

  1. New tag file
    1. Invoke File | New File... from main menu.
    2. Select Web category and Tag File as file type. Push Next >.
    3. Type buttons into Tag File Name and check Add Tag File to Tag Library Descriptor option.
    4. Use Browse... to select WEB-INF/tlds/library.tld as TLD File.
    5. Modify Tag Name field and press Finish button.
    • EXPECTED RESULT: New entry <tag-file> must be added to tag library descriptor. Both <name> and <path> tags must contain values specified in the wizard.
  1. New tag handler
    1. Invoke File | New File... from main menu.
    2. Select Web category and Tag Handler as file type. Push Next >.
    3. Set Class Name field to person and check BodyTagSupport.
    4. Press Next > and use Browse... to select WEB-INF/tlds/library.tld as TLD File.
    5. Press New... and set age as Attribute Name.
    6. Select int as Attribute Type and check required attribute option.
    7. Check value evaluated at JSP translation time option and press OK. Press Finish finally.
    • EXPECTED RESULT: New entry <tag> must be added to tag library descriptor. All tags <name> , <tag-class> , <body-content> and <attribute> must contain values specified in the wizard. Besides, all subtags <name> , <required> and <type> must also contain values specified when creating the attribute. This picture shows correct result of this test suite.
  1. Invalid library
    1. Delete line 24 to invalidate tag handler registered in previous test case.
    2. Invoke New | Tag File... on Web Pages node.
    3. Type window to Tag File Name and check Add Tag File to Tag Library Descriptor option.
    4. Use Browse... to set TLD File to WEB-INF/tlds/library.tld and press Finish
    • EXPECTED RESULT: New tag file must be created, it should be registered in tag library descriptor and the tag library should be corected - deleted line should be added again.


Test suite: Refactoring

Purpose: This test suite checks refactoring of tag library files.
Setup: No preparation is necessary for this test suite.

  1. Tag handler renaming
    1. Create new Tag Library Descriptor
    2. Create new Tag Handler using wizard and check adding reference into library.
    3. Code of new Tag Handler should be generated into tag library.
    4. Right click Tag Handler file, select refactor / rename and rename Tag Hanlder file.
    • EXPECTED RESULT: Tag handler name in library should be renamed to newly selected name.
  1. Tag listener renaming
    1. Create new Tag Library Descriptor
    2. Create new Web Application Listener
    3. Insert this code into tag library descriptor:
<listener>
   <listener-class>package.ListenerName</listener-class>
</listener>
    1. Invoke Rename on Tag listener
    • EXPECTED RESULT: Tag Listener name should be changed also in tag library descriptor.
  1. Functions class renaming
    1. Create new java class
    2. Create a static function in the class: public static String message(){ return "HELLO"; }
    3. Register this function in tag library file:
 <function>
   <name>message</name>
   <function-class>package.Clazz</function-class>
   <function-signature>java.lang.String message()</function-signature>
 </function>
    1. Use refactor / rename on package.Clazz
    • {{{1}}}
  1. Moving
    1. Do all previous testcases, but use moving instead of renaming
    • EXPECTED RESULT: Moving changes should be changed also in tag library descriptor.
  1. Renaming package
    1. Do all previous testcases, but change package name instead of file name
    • EXPECTED RESULT: Package name changes should be changed also in tag library descriptor.
  1. Moving + Renaming taglib file and it's package
    • EXPECTED RESULT: **.
  1. Savely delete
    1. Create new Tag Handler and register it into tag library
    2. Right click Tag Handler, select refactor / safely delete
    • EXPECTED RESULT: Tag reference should be removed also from tag library
  1. Find usages
    1. Select Find usages from popup menu on TagHandler, TagListener, TagFunctionClass created in previous steps
    • EXPECTED RESULT: Usages in libraries should be shown




Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo