TS 60 Formi18n

Automatic Internationalization in Form Module, Test Specification for NetBeans 6.0

Author: Jana Maleckova
Version: 6.0
Last update: 2007/01/03
Introduction: This test specs tests the Internationalization in Form.
Comments:

Contents


Test suite: Installation of update for Internationalization of Form and testing basic functionality

Purpose: To test installation of update pack
Setup: Start IDE with clear userdir. Create new project, Java Application (e.g. MyApplication) with container (e.g. JFrame named MyFrame) which is not in default package.

  1. Check if update pack is installed properly
    1. Tools -> Update Center
    2. Check only Netbeans Update Center Beta and do next
    3. Select GUI Builder Update Pack and push add
    4. Continue in update guide until ide is restarted
    • EXPECTED RESULT: in Module Manager - Bridges section there should be node "Internationalization of Form
  2. Assure Internationalization is possible to turn On/Off
    1. Open your clear MyFrame container
    2. Select root node in Inspector
    3. Try to check/uncheck Automatic Internationalization property
    • EXPECTED RESULT: No exception should occurrs
  3. Assure ResourceBundle is created
    1. Open your clear MyFrame container which hasn't been internationalized yet
    2. Insert e.g. Label into it
    3. Check Automatic Internationalization property
    • EXPECTED RESULT: ResourceBundle Bundle.properties should be automatically generated in the same package as MyFrame is
  4. Assure ResourceBundle is created
    1. Open your clear MyFrame container which hasn't been internationalized yet
    2. Check Automatic Internationalization property
    3. Insert e.g. Label into it
    4. Change text by double click on Label in design and confirm it
    • EXPECTED RESULT: ResourceBundle Bundle.properties should be automatically generated in the same package as MyFrame is
  5. Assure ResourceBundle is created
    1. Open your clear MyFrame container which hasn't been internationalized yet
    2. Check Automatic Internationalization property
    3. Insert e.g. Label into it
    4. Change text through pop-up menu - "Edit Text" invoked by right-mouse click on Label in design and confirm it
    • EXPECTED RESULT: ResourceBundle Bundle.properties should be automatically generated in the same package as MyFrame is
  6. Assure ResourceBundle is created
    1. Open your clear MyFrame container which hasn't been internationalized yet
    2. Check Automatic Internationalization property
    3. Insert e.g. Label into it
    4. Change text on property card of Label and confirm it
    • EXPECTED RESULT: ResourceBundle Bundle.properties should be automatically generated in the same package as MyFrame is
  7. Assure ResourceBundle is not used if Automatic Internationalization is Off
    1. Open your clear MyFrame container which hasn't been internationalized yet
    2. Check Automatic Internationalization property
    3. Insert e.g. Label into it
    4. Change text on property card of Label and confirm it (e.g. new text value of Label is Name)
    5. Check if string MyFrame.jLabel1.text=Name is generated in Bundle.properties
    6. UnCheck Automatic Internationalization property
    7. Change text on property card of Label again and confirm it (e.g. new text value of Label is Test)
    • EXPECTED RESULT: Bundle.properties is not deleted
      and it should contain string
      MyFrame.jLabel1.text=Name
      . In editor of source code for MyFrame there should be generated code {jLabel1.setText("Test")}
  8. Assure ResourceBundle is created
    1. Open your clear MyFrame container which hasn't been internationalized yet
    2. Select root node in Inspector window and invoke custom editor at Properties Bundle File property
    3. Create new Properties file e.g. MyBundle in other location which is different from location of MyFrame and confirm it
    4. Check Automatic Internationalization property
    5. Insert e.g. Label into it
    6. Change text by double click on Label in design and confirm it
    • EXPECTED RESULT: ResourceBundle MyBundle.properties should be automatically generated in location which is set in Properties Bundle File property
  9. Assure ResourceBundle is created
    1. Do first five steps as they are described in the eighth testcase and continue with the each fourth step from the 4-6 testcase
    • EXPECTED RESULT: ResourceBundle MyBundle.properties should be automatically generated in location which is set in Properties Bundle File property


Test suite: Automatic Internationalization of Form

Purpose: To test if Resource Bundle is generated correctly with appropriate strings
Setup: Start IDE with clear userdir. Install GUI Builder Update Pack and create new project, Java Application (e.g. MyApplication) with container (e.g. JFrame named MyFrame) which is not in default package.

  1. Automatic generation of keys and values in Resource Bundle
    1. Open your clear MyFrame container which hasn't been internationalized yet
    2. Turn On Internationalization of MyFrame form
    3. Insert 3 Swing Components e.g. Label, TextField and Button
    4. Change text of Label and Button (Label => Name, Button => Confirm)
    5. Switch from design to source editor
    6. Select Bundle.properties in Project Window and open it for editing by right mouse click -> Edit
    • EXPECTED RESULT: Form should generate code in source editor
      java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("newpackage/Bundle"); // NOI18N
      

jLabel1.setText(bundle.getString("MyFrame.jLabel1.text")); // NOI18N

jButton1.setText(bundle.getString("MyFrame.jButton1.text")); // NOI18N

and in Bundle.properties there should be generated appropriate keys and values
MyFrame.jLabel1.text=Name
MyFrame.jButton1.text=Confirm

  1. Automatic generation of keys and values in Resource Bundle
    1. Open your clear MyFrame container which hasn't been internationalized yet
    2. Insert 3 Swing Components e.g. Label, TextField and Button
    3. Turn On Internationalization of MyFrame form
    4. Change text of Label and Button (jLabel1 => Name, jButton1 => Confirm)
    5. Switch from design to source editor
    6. Select Bundle.properties in Project Window and open it for editing by right mouse click -> Edit
    • EXPECTED RESULT: Form should generate code in source editor
      java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("newpackage/Bundle"); // NOI18N
      

jLabel1.setText(bundle.getString("MyFrame.jLabel1.text")); // NOI18N jTextField1.setText(bundle.getString("MyFrame.jTextField1.text")); // NOI18N

jButton1.setText(bundle.getString("MyFrame.jButton1.text")); // NOI18N

and in Bundle.properties there should be generated appropriate keys and values
MyFrame.jLabel1.text=Name

MyFrame.jButton1.text=Confirm

MyFrame.jTextField1.text=jTextField1

  1. Automatic generation of keys and values in Resource Bundle
    1. Turn On Automatic Internationalization generally in Options (Tools -> Options -> Advanced Options -> GUI Builder -> Automatic Internationalization -> On)
    2. Create new JFrame e. g. MyFrame2 in new package, e. g. test_internationalization
    3. Insert new swing component e.g. Button
    4. Change text of Button (jButton1 => Confirm)
    • EXPECTED RESULT: Bundle.properties should be automatically generated with string
      MyFrame2.jButton1.text=Confirm
      in package test_internationalization

  2. Automatic generation of keys and values in Resource Bundle
    1. Turn Off Automatic Internationalization generally in Options (Tools -> Options -> Advanced Options -> GUI Builder -> Automatic Internationalization -> Off)
    2. Create new JFrame e. g. MyFrame3 in new package, e. g. test_internationalization2
    3. Insert new swing component e.g. Button
    4. Change text of Button (jButton1 => Confirm)
    • EXPECTED RESULT: Bundle.properties should not be generated in package test_internationalization2 and checkbox Automatic Internationalization in frame property should be unchecked


Test suite: Editing of already created Resource Bundle

Purpose: To test if all changes made in design are updated in Resource Bundle
Setup: Start IDE with clear userdir. Install GUI Builder Update Pack and create new project, Java Application (e.g. MyApplication) with container (e.g. JFrame named MyFrame) which is not in default package.

  1. Editing text directly in MyFrame
    1. Open your clear MyFrame container which hasn't been internationalized yet
    2. Insert 3 Swing Components e.g. Label, TextField and Button
    3. Turn On Internationalization of MyFrame form
    4. Change text of Label and Button (jLabel1 => Name, jButton2 => Confirm) and check if keys with appropriate values for Label and Button are generated in Resource Bundle
    5. Switch to design of MyFrame and change text of Label by mouse double click to "Test Label"
    • {{{1}}}}
  2. Changing components Variable Name
    1. Open your clear MyFrame container which hasn't been internationalized yet
    2. Insert 3 Swing Components e.g. Label, TextField and Button
    3. Turn On Internationalization of MyFrame form
    4. Select Button in design mode and change Variable Name from jButton1 to Confirm which is in properties - code card.
    • {{{1}}}}
  3. Change both, text and Variable Name of component
    1. Open your clear MyFrame container which hasn't been internationalized yet
    2. Insert 3 Swing Components e.g. Label, TextField and Button
    3. Turn On Internationalization of MyFrame form
    4. Select Button in design mode and change Variable Name from jButton1 to Confirm which is in properties - code card.
    5. Change text of Button (jButton2 => Confirm)
    • {{{1}}}}


Test suite: Editing of Resource Bundle directly

Purpose: Test if changes in Resource Bundle are updated in form file in design
Setup: Start IDE with clear userdir. Install GUI Builder Update Pack and create new project, Java Application (e.g. MyApplication) with container (e.g. JFrame named MyFrame) which is not in default package.

  1. Editing of Key Value directly in Resource Bundle
    1. Open your clear MyFrame container which hasn't been internationalized yet
    2. Insert Swing Component e.g. Label
    3. Turn On Internationalization of MyFrame
    4. Do right-mouse click on generated file Bundle.properties in Project Window and invoke action Edit
    5. Change string from
      MyJFrame.jLabel1.text=jLabel1
      to {NewJFrame.jLabel1.text=Name}
    6. Go back in design of MyFrame and do action Reload Form which is invoked by right mouse click on root node in Inspector Window
    • EXPECTED RESULT: IDE should ask whether this Form should be saved and if user confirms it, the text of Label should be changed on "Name" in design
  2. Adding comments in Resource Bundle
    1. Open your clear MyFrame container which hasn't been internationalized yet
    2. Insert Swing Component e.g. Label
    3. Turn On Internationalization of MyFrame
    4. Do right-mouse click on generated file Bundle.properties in Project Window and invoke action Edit
    5. Add comment
      #test
      above string {MyJFrame.jLabel1.text=jLabel1}
    • EXPECTED RESULT: No exception occurrred and Project is possible to build without any problem.


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