Author: Jana Maleckova
Version: 6.0
Last update: 2007/01/03
Introduction: This test specs tests the Internationalization in Form.
Comments:
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.
- Check if update pack is installed properly
- Tools -> Update Center
- Check only Netbeans Update Center Beta and do next
- Select GUI Builder Update Pack and push add
- Continue in update guide until ide is restarted
- EXPECTED RESULT: in Module Manager - Bridges section there should be node "Internationalization of Form
- 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 string MyFrame.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
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.
- 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")); // NOI18N
and 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")); // 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
- 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
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.
- 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"
- EXPECTED RESULT: In Bundle.properties there the value of key MyFrame.jLabel1.text=Name should be changed to MyFrame.jLabel1.text=Test Label
- 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.
- EXPECTED RESULT: In Bundle.properties there the value of key MyFrame.jButton1.text=jButton1 should be changed to MyFrame.Confirm.text=jButton1
- 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)
- EXPECTED RESULT: In Bundle.properties there the value of key MyFrame.jButton1.text=jButton1 should be changed to MyFrame.Confirm.text=Confirm
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.
- 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.