[RSS]

Form Editor - Code Generation Test Specification

Author: Jana Maleckova, Jaromir Uhrik
Version: 6.5
Lastupdate: 2008/08/15
Introduction: This is intended as Code Generation tests for created Swing/AWT files and components.

Test suite: Create forms from Templates

Purpose:
Setup: Start IDE with clear userdir. Create new project, Java Application (e.g. MyApplication).
  1. Create new JApplet
    1. Select MyApplication/Source Packages/myapplication in the Project view
    2. Choose from popup New | File/Folder...
    3. Choose Swing GUI Forms > JApplet Form and press Next> button.
    4. In New Wizard type name "MyJApplet"
    5. Push Finish
    • EXPECTED RESULT: MyJApplet tab is available. Form contains component Palette, Inspector and Form Designer. Node "Form MyJApplet" contains subnodes : "Other Components" and "JApplet".
  2. Create new JDialog
    1. Select MyApplication/Source Packages/myapplication in the Project view
    2. Choose from popup New | File/Folder...
    3. Choose Swing GUI Forms > JDialog Form and press Next> button.
    4. In New Wizard type name "MyJDialog"
    5. Push Finish
    • EXPECTED RESULT: MyJDialog tab is available. Form contains component Palette, Inspector and Form Designer. Node "Form MyJDialog" contains subnodes : "Other Components" and "JDialog".
  3. Create new JFrame
    1. Select MyApplication/Source Packages/myapplication in the Project view
    2. Choose from popup New | File/Folder...
    3. Choose Swing GUI Forms > JFrame Form and press Next> button.
    4. In New Wizard type name "MyJFrame"
    5. Push Finish
    • EXPECTED RESULT: MyJFrame tab is available. Form contains component Palette, Inspector and Form Designer. Node "Form MyJFrame" contains subnodes : "Other Components" and "JFrame".
  4. Create new JInternalFrame
    1. Select MyApplication/Source Packages/myapplication in the Project view
    2. Choose from popup New | File/Folder...
    3. Choose Swing GUI Forms > JInternalFrame Form and press Next> button.
    4. In New Wizard type name "MyJInternalFrame"
    5. Push Finish
    • EXPECTED RESULT: MyJInternalFrame tab is available. Form contains component Palette, Inspector and Form Designer. Node "Form MyJInternalFrame" contains subnodes : "Other Components" and "JInternalFrame".
  5. Create new JPanel
    1. Select MyApplication/Source Packages/myapplication in the Project view
    2. Choose from popup New | File/Folder...
    3. Choose Swing GUI Forms > JPanel Form and press Next> button.
    4. In New Wizard type name "MyJPanel"
    5. Push Finish
    • EXPECTED RESULT: MyJPanel tab is available. Form contains component Palette, Inspector and Form Designer. Node "Form MyJPanel" contains subnodes : "Other Components" and "JPanel".
  6. Create new Bean based on javax.swing.JPanel
    1. Select MyApplication/Source Packages/myapplication in the Project view
    2. Choose from popup New | File/Folder...
    3. Choose Swing GUI Forms > Bean Form and press Next> button.
    4. In New Wizard type name "BeanOnJPanel"
    5. Push Next
    6. In New Wizard type superclass "javax.swing.JPanel"
    7. Push Finish
    • EXPECTED RESULT: BeanOnJPanel tab is available. Form contains component Palette, Inspector and Form Designer. Node "Form BeanOnJPanel" contains subnodes : "Other Components" and "JPanel".
  7. Create new Bean based on javax.swing.JButton
    1. Select MyApplication/Source Packages/myapplication in the Project view
    2. Choose from popup New | File/Folder...
    3. Choose Swing GUI Forms > Bean Form and press Next> button.
    4. In New Wizard type name "BeanOnJButton"
    5. Push Next
    6. In New Wizard type superclass "javax.swing.JButton"
    7. Push Finish
    • EXPECTED RESULT: BeanOnJButton tab is available. Form contains component Palette, Inspector and Form Designer. Node "Form BeanOnJButton" contains subnode : "JButton".
  8. Create new Bean based on java.awt.Panel
    1. Select MyApplication/Source Packages/myapplication in the Project view
    2. Choose from popup New | File/Folder...
    3. Choose Swing GUI Forms > Bean Form and press Next> button.
    4. In New Wizard type name "BeanOnPanel"
    5. Push Next
    6. In New Wizard type superclass "java.awt.Panel"
    7. Push Finish
    • EXPECTED RESULT: BeanOnPanel tab is available. Form contains component Palette, Inspector and Form Designer. Node "Form BeanOnPanel" contains subnodes : "Other Components" and "Panel".
  9. Create new Applet
    1. Select MyApplication/Source Packages/myapplication in the Project view
    2. Choose from popup New | File/Folder...
    3. Choose AWT GUI Forms > Applet Form and press Next> button.
    4. In New Wizard type name "MyApplet"
    5. Push Finish
    • EXPECTED RESULT: MyApplet tab is available. Form contains component Palette, Inspector and Form Designer. Node "Form MyApplet" contains subnodes : "Other Components" and "Applet".
  10. Create new Frame
    1. Select MyApplication/Source Packages/myapplication in the Project view
    2. Choose from popup New | File/Folder...
    3. Choose AWT GUI Forms > Frame Form and press Next> button
    4. In New Wizard type name "MyFrame"
    5. Push Finish
    • EXPECTED RESULT: MyFrame tab is available. Form contains component Palette, Inspector and Form Designer. Node "Form MyFrame" contains subnodes : "Other Components" and "Frame".
  11. Create new Panel
    1. Select MyApplication/Source Packages/myapplication in the Project view
    2. Choose from popup New | File/Folder...
    3. Choose AWT GUI Forms > Panel Form and press Next> button.
    4. In New Wizard type name "MyPanel"
    5. Push Finish
    • EXPECTED RESULT: MyPanel tab is available. Form contains component Palette, Inspector and Form Designer. Node "Form MyPanel" contains subnodes : "Other Components" and "Panel".
  12. Create new Application
    1. Select MyApplication/Source Packages/myapplication in the Project view
    2. Choose from popup New | File/Folder...
    3. Choose Swing GUI Forms > Application Sample Form and press Next> button.
    4. In New Wizard type name "MyApplication"
    5. Push Finish
    • EXPECTED RESULT: MyApplication tab is available. Form contains component Palette, Inspector and Form Designer. Node "Form MyApplication" contains subnodes : "Other Components" and "JFrame".
  13. Create new MDI Application
    1. Select MyApplication/Source Packages/myapplication in the Project view
    2. Choose from popup New | File/Folder...
    3. Choose Swing GUI Forms > MDI Application Sample Form and press Next> button.
    4. In New Wizard type name "MyMDIApplication"
    5. Push Finish
    • EXPECTED RESULT: MyMDIApplication tab is available. Form contains component Palette, Inspector and Form Designer. Node "Form MyMDIApplication" contains subnodes : "Other Components" and "JFrame".
  14. Create new Ok/Cancel Dialog
    1. Select MyApplication/Source Packages/myapplication in the Project view
    2. Choose from popup New | File/Folder...
    3. Choose Swing GUI Forms > OK / Cancel Dialog Sample Form and press Next> button.
    4. In New Wizard type name "MyOKCancelDialog"
    5. Push Finish
    • EXPECTED RESULT: MyOKCancelDialog tab is available. Form contains component Palette, Inspector and Form Designer. Node "Form MyOKCancelDialog" contains subnodes : "Other Components" and "JDialog".
  15. Create new Master/Detailed Sample Form
    1. Select MyApplication/Source Packages/myapplication in the Project view
    2. Choose from popup New | File/Folder...
    3. Choose Swing GUI Forms > Master/Detailed Sample Form and press Next> button.
    4. In New Wizard type name "MyMasterForm" and press Next> button.
    5. Choose database connection
    6. Choose database table from your selected database and press Next> button
    7. Push Finish
    • EXPECTED RESULT: MyMasterForm tab is available. Form contains component Palette, Inspector and Form Designer. Node "Form MyMasterForm" contains subnodes : "Other Components" and "JPanel".

Test suite: Code Generation of beans properties

Purpose:
Setup: Start IDE with clear userdir. Create new project, Java Application (e.g. MyApplication).
  1. Change properties of components
    1. Open/Create MyJFrame
    2. Select/add component JLabel1
    3. Change properties for selected component
    4. Assure generated code
    5. Repeat this test for: JButton, JToggleButton, JCheckBox, JRadioButton, JComboBox, JList, JTextField, JTextArea, JPanel, JScrollPane, JMenuBar, JPopupMenu, JSlider, JProgressBar, JSplitPane, JPasswordField, JSeparator, JSpinner, JFormattedText, JTextPane, JEditorPane, JTree, JToolBar, JInternalFrame, JLayeredPane, JDesktopPane, JOptionPane, JColorChoser, JFileChooser, JFrame, JDialog, JMenuItem, JCheckBoxMenuItem, JRadioButtonMenuItem, JMenu, JSeparator, Label, Button, TextField, TextArea, CheckBox, Choice, List, ScrollBar, ScrollPane, Panel, Canvas, MenuBar, MenuItem, CheckBoxMenuItem, Menu, Separator
    • EXPECTED RESULT: Assure generated code.
  2. Generate code from Customize Bean
    1. Add own bean that is compiled to Palette (in explorer invoke popup on a bean and select Tools | Add to Component Palette... - then select category and press OK)
    2. Create a new form
    3. Add bean to this form
    4. Set properties for selected bean
    • EXPECTED RESULT: Assure generated code.

Test suite: Test of Generation Fully Qualified Names

Purpose: Test if variables are/aren't generated with Fully Qualified Names
Setup: Start IDE with clear userdir. Create new project, Java Application (e.g. MyApplication) and create a new JFrame.
    • EXPECTED RESULT: Declaration of jLabel variable should look like
  1. Check if property "Generate Full Classnames" is checked"
    1. Select root node in Navigator
    2. Check property "Generate Full Classnames" on Property Sheet
    • EXPECTED RESULT: This property should be checked by default
  2. Test if FQN are not generated
    1. Place e.g. jLabel in Frame
    2. Select root node in Navigator
    3. Uncheck option "Generate Full Classnames" in Properties
    4. Switch to Editor
    • EXPECTED RESULT: Declaration of jLabel variable should look like: private JLabel jLabel1; and all appropriate imports should be added at the beging of the class. No error badges should appear.
  3. Test if FQN are generated
    1. Use Frame from previous testcase
    2. Select root node in Navigator
    3. Check option "Generate Full Classnames" in Properties
    4. Switch to Editor
    • EXPECTED RESULT: Declaration of jLabel variable should look like: private javax.swing.JLabel jLabel1; and all imports generated from previous testcase should be marked as Unused and can be removed. No error badges should appear.
  4. Test FQN together with option
    1. Create new Frame and place jLabel
    2. Uncheck FQN property and check "Local Variables" property which is on the same property sheet
    3. Switch to Editor
    • EXPECTED RESULT: Part for Variables declaration should be empty and initComponent() method should contain code JLabel jLabel1 = new JLabel();. All needed imports should be imported
  5. Test FQN together with option
    1. Use Frame from previous testcase
    2. Check FQN property
    3. Switch to Editor
    • EXPECTED RESULT: Part for Variables declaration should be empty and initComponent() method should contain code javax.swing.JLabel jLabel1 = new javax.swing.JLabel();. All imports imported from previous testcase should became unused

Test suite: Testing of Guarded Blocs

Purpose: To test if it is not possible to edit Guarded Blocks in Editor
Setup: Start IDE with clear userdir. Create new project, Java Application (e.g. MyApplication)
  1. Editing of Guarded Blocs - InitComponents in Editor
    1. Create e.g. JFrame
    2. Switch to Source from Design
    3. Try to edit code in InitComponents() - just try to write some code there
    • EXPECTED RESULT: "Guarded Block should not be possible to edit"
  2. Editing of Guarded Blocs - Action Handler in Editor
    1. Create e.g. JFrame
    2. Place some Control
    3. Generate actionPerformed handler for this control
    4. Switch to Source from Design
    5. Try to edit guarded section of handler (generated under initComponent()) press Enter, letters, code format ... etc.
    • EXPECTED RESULT: Guarded section should not be possible to edit

Test suite: Accessibility

Purpose: Assure appearance A11Y node in properties of components. Assure proper generated code.
Setup: Start IDE with clear userdir. Create new project, Java Application (e.g. MyApplication) and create a new JFrame.
  1. Appearance of A11Y for components
    1. Add step by step all components to form from tabs Swing, AWT
    2. Assure occurence of A11Y node in propertysheet (tab Basic properties)
    • EXPECTED RESULT: All components have A11Y node in properties except: JSpinner and ButtonGroup.
  2. Appearance of A11Y for top containers
    1. Create all Gui form offered by IDE: JForm, JDialog, JFrame, JInternalFrame, JPanel, Applet, Form, Frame, Panel
    2. Select Top Container in Component Inspector
    3. Assure occurence of A11Y node in propertysheet (tab Basic properties)
    • EXPECTED RESULT: All top-containers have A11Y node in properties.
  3. Appearance of A11Y node for menu components
    1. Add to JForm JMenu, JPopupMenu
    2. For JMenu add JMenuItem, JCheckBoxMenuItem, JRadioButtonMenuItem, JMenu, JSeparator
    3. Assure occurence of A11Y node in propertysheet (tab Basic properties)
    • EXPECTED RESULT: All menu components have A11Y node in properties. Bug# 22786
  4. Generated code for A11Y
    1. Add JButton to form
    2. Change all A11Y properties: A11Y Name, A11Y Description, A11Y Parent
    3. Assure generated code
    4. Repeat this test for Button, JMenuItem, JForm - top container
    • EXPECTED RESULT: Code is generated properly.