TS 61 Actions

Test Specification for Actions

Author: Jana Maleckova
Version: 6.1
Last update: 2008/01/29
Introduction: This test specification test creation of actions in Java Desktop Projects and action's administration
Comments:

Contents


Test suite: Opening of Action Editor

Purpose: This shows how Action editor can be open in Java Desktop projects
Setup: Start Ide with clear userdir and create Java Desktop Application project. File -> New Project... -> Java -> Java Desktop Application

  1. Open Action Editor from contextual menu
    1. Insert jButton in design in mainPanel
    2. Select this control, invoke contextual menu on it and choose Set Action...
    3. Press Cancel
    • EXPECTED RESULT: When "Set Action..." is selected from contextual menu, an action editor is opened. Cancel should close the editor
  1. Open Action Editor from property sheet
    1. Select control from previous testcase
    2. Push [...] at action property in control's property sheet
    3. Close Action Editor by window exit button [X]
    • EXPECTED RESULT: The window is closed, no changes in action property in control's property sheet.
  1. Open Action Editor from inspector
    1. Select jButton1 node in inspector tree
    2. Invoke popup menu on this node and choose "Set Action..."
    3. Press OK
    • EXPECTED RESULT: Action Editor for jButton1 should be opened. When OK button is pressed, no action is created and Editor is automatically closed


Test suite: Create new Action - Basic

Purpose: Test if action editor can create new action for various controls
Setup: Start IDE with clear userdir and create Java Desktop Application project. File -> New Project... -> Java -> Java Desktop Application

  1. Test Validation of action's name
    1. Insert jButton in design in mainPanel
    2. Invoke contextual menu on this component and select "Set Action..." to open Action Editor
    3. Set combo "Action to edit" for "Create new action"
    4. Press OK
    • EXPECTED RESULT: Action Editor should warn you that a valid value was not set
  1. Test Validation of action's name
    1. Insert jButton in design in mainPanel
    2. Invoke contextual menu on this component and select "Set Action..." to open Action Editor
    3. Set combo "Action to edit" for "Create new action"
    4. Fill action name which contains e.g. spaces, begins with special characters like ^, \, % and so on.
    5. Every time when incorrect action name is set, push OK button
    • EXPECTED RESULT: Action Editor should recognize and validate action name in every case. Editor warns user that action name is not valid and no action is created then
  1. New Action Creation
    1. Insert jButton in design in mainPanel
    2. Invoke contextual menu on this component and select "Set Action..." to open Action Editor
    3. Set combo "Action to edit" for "Create new action"
    4. Fill valid name of action
    5. Fill action's basic attributes like Text, Tool Tip
    6. Press OK
    • EXPECTED RESULT: New Action should be created in View Class. When new action is created, form is automatically switch to source editor. In source code, there is generated code for method which has the same name as action and is annotated by
      @application.Action
      .Action property of jButton should contain the name of new action. Button's text and tooltip should correspond with the same attributes configured in action. Resource Bundle, automatically generated in resource package, contains action's attributes with values. Example:
      test.Action.shortDescription=This is new action;
      
test.Action.text=Button;
  1. Accelerator setting
    1. Insert jButton in design in mainPanel
    2. Invoke contextual menu on this component and select "Set Action..." to open Action Editor
    3. Set combo "Action to edit" for "Create new action"
    4. Fill valid name of action
    5. Fill action's basic attributes like Text, Tool Tip
    6. Put focus in Letter text field
    7. Press ctrl+shift+t
    8. Press OK
    • EXPECTED RESULT: When shortcut "ctrl+shift+t" is pressed, checkboxes - ctlr, shift should be automatically set and text field "Letter" contains letter "t". In Resource Bundle there is generated key
      test.Action.accelerator
      with value
      shift ctrl pressed T
  1. Accelerator setting
    1. Insert jButton in design in mainPanel
    2. Invoke contextual menu on this component and select "Set Action..." to open Action Editor
    3. Set combo "Action to edit" for "Create new action"
    4. Fill valid name of action
    5. Fill action's basic attributes like Text, Tool Tip
    6. Check checkboxes ctrl and alt in section accelerator
    7. Fill letter "s" in Letter text field
    8. Press OK
    • EXPECTED RESULT: Accelerator should be saved together with other attributes
  1. Add imported small Icon for action
    1. Insert jButton in design in mainPanel
    2. Invoke contextual menu on this component and select "Set Action..." to open Action Editor
    3. Set combo "Action to edit" for "Create new action"
    4. Fill valid name of action
    5. Fill action's basic attributes like Text, Tool Tip
    6. Push button "Set Icon" in section small icon
    7. Press button "Import to project"
    8. Choose some icon from disc and press Next
    9. Choose resource package and push Finish
    10. Press OK
    11. Press OK on Action Editor
    • EXPECTED RESULT: Small icon is added to action and is displayed on button in design. Icon is automatically copied from disc to resource package. Resource bundle contains key for small icon
      test.Action.smallIcon
      with value icon's name
  1. Add imported large and small Icon for action
    1. Insert jButton in design in mainPanel
    2. Invoke contextual menu on this component and select "Set Action..." to open Action Editor
    3. Set combo "Action to edit" for "Create new action"
    4. Fill valid name of action
    5. Fill action's basic attributes like Text, Tool Tip
    6. Push button "Set Icon" in section small icon
    7. Press button "Import to project"
    8. Choose some icon from disc and press Next
    9. Choose resource package and push Finish
    10. Press OK
    11. Do the same steps and add different icon for large icon attribute
    12. Press OK on Action Editor
    13. Drag and drop jMenuItem from palette under jMenu File
    14. Select jMenuItem in design and choose previously created action and set it as its action
    • EXPECTED RESULT: Both icons are added to action and large one displayed on button in design. Icons are automatically copied from disc to resource package. Resource bundle contains key for small icon
      test.Action.smallIcon
      with value icon's name and key for large icon
      test.Action.largeIcon
      . Large icon is displayed on jButton in design, small one is visible on jMenuItem
  1. Create new action as task
    1. Insert jButton in design in mainPanel
    2. Invoke contextual menu on this component and select "Set Action..." to open Action Editor
    3. Set combo "Action to edit" for "Create new action"
    4. Fill valid name of action
    5. Check checkbox "Background Task"
    6. Press OK
    • EXPECTED RESULT: When task is created, Form is switched from design to source editor - at point where code for action runnint in background is generated


Test suite: Editing of action

Purpose: Test if already created action can be edited
Setup: Start IDE with clear userdir and create Java Desktop Application project. File -> New Project... -> Java -> Java Desktop Application. Insert jButton in mainPanel and create new action for this control. Action is not task and has set small and large icon, accelerator, text and tooltip

  1. Edit action's text attributes - text, tooltip
    1. Select jButton and invoke Action Editor from action property
    2. Do some changes in text and tooltip attributes
    3. Press OK
    • EXPECTED RESULT: Attributes - text and tooltip should be saved in appropriate resource bundle.
  1. Edit action accelerator
    1. Select jButton and invoke Action Editor from action property
    2. Push clear button in accelerator part
    3. Press OK
    • EXPECTED RESULT: Accelerator attribute should be cleaned. Accelerator key should be deleted from resource bundle as well.
  1. Change action's icon
    1. Select jButton and invoke Action Editor from action property
    2. Open Icon editor by pressing set Icon in small icon part
    3. Check "No Image"
    4. Press OK
    5. Invoke Icon editor of large icon
    6. Choose icon which was set as small icon before. Should be listed in part "Image Within Project"
    7. Press OK
    8. Push OK on Action Editor
    • EXPECTED RESULT: Key for small icon should be erased from resource bundle. Value of key for large icon contains name of changed icon.
  1. Change Action on Task
    1. Select jButton and invoke Action Editor from action property
    2. Check checkbox "Background Task"
    3. Erase text and tooltip attributes
    4. Clear accelerator
    5. Set both icons as "No Image"
    6. Push OK on Action Editor
    • EXPECTED RESULT: Code for background action should be generated. Source should not contain any compilation errors and should not scatter code.


Test suite: Application Action Editor

Purpose: All action in Java Desktop project could be administrate from Application action editor
Setup: Start IDE with clear userdir and create Java Desktop Application project. File -> New Project... -> Java -> Java Desktop Application.

  1. Create new action
    1. Open Application Action Editor - Window -> Other -> Application Actions
    2. Press button "New Action"
    3. Press Choose Class button and select View class in project
    4. Fill valid action name
    5. Set text, tooltip attributes
    6. Set Accelerator
    7. Set small and large icon
    8. Press OK
    • EXPECTED RESULT: Application Action Editor should be automatically opened docked on place where output win is usually expected. Java Desktop Application Project contains 3 actions by default - CloseAboutBox, ShowAboutBox and Quit - these action are listed in editor when is opened. When button "New Action" is pressed, Action Editor is opened. Application Action Editor should display basic attributes of actions - Name, Text, Accelerator, Small Icon, if action is task or not(read only), Method name, and class name where action is defined. On the right side of Editor, there is a list of components which are bounded to this action
  1. Edit action
    1. Select action created in previous test case
    2. Press Edit button on Application Action Editor
    3. Change text, tooltip attributes
    4. Press OK
    • EXPECTED RESULT: All changed action's attributes should be correctly updated
  1. Delete Action
    1. Select action created in previous test case
    2. Press Delete button on Application Action Editor
    3. Confirm deleting
    • EXPECTED RESULT: Action should be deleted from project and @action annotation should be removed from code


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