TS 61 Formi18n
Automatic Internationalization in Form Module
Author: Jana Maleckova
Version: 6.1
Last update: 2008/10/03
Introduction: This test specs tests the Internationalization in Form.
Comments:
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.
- Assure Internationalization is possible to turn On/Off
- Open your clear MyFrame container
- Select root node in Inspector
- Try to check/uncheck Automatic Internationalization property
- EXPECTED RESULT: No exception should occurrs
- Assure ResourceBundle is created
- Open your clear MyFrame container which hasn't been internationalized yet
- Insert e.g. Label into it
- Check Automatic Internationalization property
- EXPECTED RESULT: ResourceBundle Bundle.properties should be automatically generated in the same package as MyFrame is
- Assure ResourceBundle is created
- Open your clear MyFrame container which hasn't been internationalized yet
- Check Automatic Internationalization property
- Insert e.g. Label into it
- 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
- Assure ResourceBundle is created
- Open your clear MyFrame container which hasn't been internationalized yet
- Check Automatic Internationalization property
- Insert e.g. Label into it
- 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
- Assure ResourceBundle is created
- Open your clear MyFrame container which hasn't been internationalized yet
- Check Automatic Internationalization property
- Insert e.g. Label into it
- 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
- Assure ResourceBundle is not used if Automatic Internationalization is Off
- Open your clear MyFrame container which hasn't been internationalized yet
- Check Automatic Internationalization property
- Insert e.g. Label into it
- Change text on property card of Label and confirm it (e.g. new text value of Label is Name)
- Check if string MyFrame.jLabel1.text=Name is generated in Bundle.properties
- UnCheck Automatic Internationalization property
- 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 stringMyFrame.jLabel1.text=Name
. In editor of source code for MyFrame there should be generated code {jLabel1.setText("Test")}
- Assure ResourceBundle is created
- Open your clear MyFrame container which hasn't been internationalized yet
- Select root node in Inspector window and invoke custom editor at Properties Bundle File property
- Create new Properties file e.g. MyBundle in other location which is different from location of MyFrame and confirm it
- Check Automatic Internationalization property
- Insert e.g. Label into it
- 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
- Assure ResourceBundle is created
- 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. Create new project, Java Application (e.g. MyApplication) with container (e.g. JFrame named MyFrame) which is not in default package.
- Automatic generation of keys and values in Resource Bundle
- Open your clear MyFrame container which hasn't been internationalized yet
- Turn On Internationalization of MyFrame form
- Insert 3 Swing Components e.g. Label, TextField and Button
- Change text of Label and Button (Label => Name, Button => Confirm)
- Switch from design to source editor
- 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")); // NOI18Nand in Bundle.properties there should be generated appropriate keys and values
MyFrame.jLabel1.text=Name MyFrame.jButton1.text=Confirm
- Automatic generation of keys and values in Resource Bundle
- Open your clear MyFrame container which hasn't been internationalized yet
- Insert 3 Swing Components e.g. Label, TextField and Button
- Turn On Internationalization of MyFrame form
- Change text of Label and Button (jLabel1 => Name, jButton1 => Confirm)
- Switch from design to source editor
- 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")); // NOI18Nand in Bundle.properties there should be generated appropriate keys and values
MyFrame.jLabel1.text=NameMyFrame.jButton1.text=Confirm
MyFrame.jTextField1.text=jTextField1
- Automatic generation of keys and values in Resource Bundle
- Turn On Automatic Internationalization generally in Options (Tools -> Options -> Advanced Options -> GUI Builder -> Automatic Internationalization -> On)
- Create new JFrame e. g. MyFrame2 in new package, e. g. test_internationalization
- Insert new swing component e.g. Button
- Change text of Button (jButton1 => Confirm)
- EXPECTED RESULT: Bundle.properties should be automatically generated with string
MyFrame2.jButton1.text=Confirm
in package test_internationalization
- Automatic generation of keys and values in Resource Bundle
- Turn Off Automatic Internationalization generally in Options (Tools -> Options -> Advanced Options -> GUI Builder -> Automatic Internationalization -> Off)
- Create new JFrame e. g. MyFrame3 in new package, e. g. test_internationalization2
- Insert new swing component e.g. Button
- 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. Create new project, Java Application (e.g. MyApplication) with container (e.g. JFrame named MyFrame) which is not in default package.
- Editing text directly in MyFrame
- Open your clear MyFrame container which hasn't been internationalized yet
- Insert 3 Swing Components e.g. Label, TextField and Button
- Turn On Internationalization of MyFrame form
- 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
- Switch to design of MyFrame and change text of Label by mouse double click to "Test Label"
- {{{1}}}}
- Changing components Variable Name
- Open your clear MyFrame container which hasn't been internationalized yet
- Insert 3 Swing Components e.g. Label, TextField and Button
- Turn On Internationalization of MyFrame form
- Select Button in design mode and change Variable Name from jButton1 to Confirm which is in properties - code card.
- {{{1}}}}
- Change both, text and Variable Name of component
- Open your clear MyFrame container which hasn't been internationalized yet
- Insert 3 Swing Components e.g. Label, TextField and Button
- Turn On Internationalization of MyFrame form
- Select Button in design mode and change Variable Name from jButton1 to Confirm which is in properties - code card.
- 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. Create new project, Java Application (e.g. MyApplication) with container (e.g. JFrame named MyFrame) which is not in default package.
- Editing of Key Value directly in Resource Bundle
- Open your clear MyFrame container which hasn't been internationalized yet
- Insert Swing Component e.g. Label
- Turn On Internationalization of MyFrame
- Do right-mouse click on generated file Bundle.properties in Project Window and invoke action Edit
- Change string from
MyJFrame.jLabel1.text=jLabel1
to {NewJFrame.jLabel1.text=Name} - 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
- Adding comments in Resource Bundle
- Open your clear MyFrame container which hasn't been internationalized yet
- Insert Swing Component e.g. Label
- Turn On Internationalization of MyFrame
- Do right-mouse click on generated file Bundle.properties in Project Window and invoke action Edit
- Add comment
#test
above string {MyJFrame.jLabel1.text=jLabel1}
- EXPECTED RESULT: No exception occurrred and Project is possible to build without any problem.
Test suite: Test automatic i18n in Project with Dependencies
Purpose: To test if Resource Bundle can be used from different Project
Setup: Start IDE with clear userdir. Create two j2se projects. One should contain clear jFrame
- Create dependencies between projects
- Select library package of project with jFrame and invoke popup menu
- Choose Add Project...
- Choose the second project and confirm it
- EXPECTED RESULT: Library dir should contain a link to jar of the second project
- Switch auto i18n on
- Open jFrame from the first project
- Select root node in Inspector
- Invoke Custom Editor for Properties Bundle Location
- Select Source Package of project which is in dependency
- Create new Resource Bundle
- Select it and press OK
- EXPECTED RESULT: File browser should display source package of dependent project. Properties Bundle File property should be set.
- All test cases written above should be done with this configuration
- Go through the steps describe in Test suite: Automatic Internationalization of Form
- EXPECTED RESULT: All should pass as describe

