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.
Purpose:
Setup: Start IDE with clear userdir. Create new project, Java Application (e.g. MyApplication).
- Create new JApplet
- Select MyApplication/Source Packages/myapplication in the Project view
- Choose from popup New | File/Folder...
- Choose Swing GUI Forms > JApplet Form and press Next> button.
- In New Wizard type name "MyJApplet"
- 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".
- Create new JDialog
- Select MyApplication/Source Packages/myapplication in the Project view
- Choose from popup New | File/Folder...
- Choose Swing GUI Forms > JDialog Form and press Next> button.
- In New Wizard type name "MyJDialog"
- 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".
- Create new JFrame
- Select MyApplication/Source Packages/myapplication in the Project view
- Choose from popup New | File/Folder...
- Choose Swing GUI Forms > JFrame Form and press Next> button.
- In New Wizard type name "MyJFrame"
- 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".
- Create new JInternalFrame
- Select MyApplication/Source Packages/myapplication in the Project view
- Choose from popup New | File/Folder...
- Choose Swing GUI Forms > JInternalFrame Form and press Next> button.
- In New Wizard type name "MyJInternalFrame"
- 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".
- Create new JPanel
- Select MyApplication/Source Packages/myapplication in the Project view
- Choose from popup New | File/Folder...
- Choose Swing GUI Forms > JPanel Form and press Next> button.
- In New Wizard type name "MyJPanel"
- 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".
- Create new Bean based on javax.swing.JPanel
- Select MyApplication/Source Packages/myapplication in the Project view
- Choose from popup New | File/Folder...
- Choose Swing GUI Forms > Bean Form and press Next> button.
- In New Wizard type name "BeanOnJPanel"
- Push Next
- In New Wizard type superclass "javax.swing.JPanel"
- 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".
- Create new Bean based on javax.swing.JButton
- Select MyApplication/Source Packages/myapplication in the Project view
- Choose from popup New | File/Folder...
- Choose Swing GUI Forms > Bean Form and press Next> button.
- In New Wizard type name "BeanOnJButton"
- Push Next
- In New Wizard type superclass "javax.swing.JButton"
- Push Finish
- EXPECTED RESULT: BeanOnJButton tab is available. Form contains component Palette, Inspector and Form Designer. Node "Form BeanOnJButton" contains subnode : "JButton".
- Create new Bean based on java.awt.Panel
- Select MyApplication/Source Packages/myapplication in the Project view
- Choose from popup New | File/Folder...
- Choose Swing GUI Forms > Bean Form and press Next> button.
- In New Wizard type name "BeanOnPanel"
- Push Next
- In New Wizard type superclass "java.awt.Panel"
- 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".
- Create new Applet
- Select MyApplication/Source Packages/myapplication in the Project view
- Choose from popup New | File/Folder...
- Choose AWT GUI Forms > Applet Form and press Next> button.
- In New Wizard type name "MyApplet"
- 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".
- Create new Frame
- Select MyApplication/Source Packages/myapplication in the Project view
- Choose from popup New | File/Folder...
- Choose AWT GUI Forms > Frame Form and press Next> button
- In New Wizard type name "MyFrame"
- 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".
- Create new Panel
- Select MyApplication/Source Packages/myapplication in the Project view
- Choose from popup New | File/Folder...
- Choose AWT GUI Forms > Panel Form and press Next> button.
- In New Wizard type name "MyPanel"
- 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".
- Create new Application
- Select MyApplication/Source Packages/myapplication in the Project view
- Choose from popup New | File/Folder...
- Choose Swing GUI Forms > Application Sample Form and press Next> button.
- In New Wizard type name "MyApplication"
- 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".
- Create new MDI Application
- Select MyApplication/Source Packages/myapplication in the Project view
- Choose from popup New | File/Folder...
- Choose Swing GUI Forms > MDI Application Sample Form and press Next> button.
- In New Wizard type name "MyMDIApplication"
- 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".
- Create new Ok/Cancel Dialog
- Select MyApplication/Source Packages/myapplication in the Project view
- Choose from popup New | File/Folder...
- Choose Swing GUI Forms > OK / Cancel Dialog Sample Form and press Next> button.
- In New Wizard type name "MyOKCancelDialog"
- 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".
- Create new Master/Detailed Sample Form
- Select MyApplication/Source Packages/myapplication in the Project view
- Choose from popup New | File/Folder...
- Choose Swing GUI Forms > Master/Detailed Sample Form and press Next> button.
- In New Wizard type name "MyMasterForm" and press Next> button.
- Choose database connection
- Choose database table from your selected database and press Next> button
- 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).
- Change properties of components
- Open/Create MyJFrame
- Select/add component JLabel1
- Change properties for selected component
- Assure generated code
- 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.
- Generate code from Customize Bean
- 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)
- Create a new form
- Add bean to this form
- 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
- Check if property "Generate Full Classnames" is checked"
- Select root node in Navigator
- Check property "Generate Full Classnames" on Property Sheet
- EXPECTED RESULT: This property should be checked by default
- Test if FQN are not generated
- Place e.g. jLabel in Frame
- Select root node in Navigator
- Uncheck option "Generate Full Classnames" in Properties
- 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.
- Test if FQN are generated
- Use Frame from previous testcase
- Select root node in Navigator
- Check option "Generate Full Classnames" in Properties
- 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.
- Test FQN together with option
- Create new Frame and place jLabel
- Uncheck FQN property and check "Local Variables" property which is on the same property sheet
- 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
- Test FQN together with option
- Use Frame from previous testcase
- Check FQN property
- 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)
- Editing of Guarded Blocs - InitComponents in Editor
- Create e.g. JFrame
- Switch to Source from Design
- Try to edit code in InitComponents() - just try to write some code there
- EXPECTED RESULT: "Guarded Block should not be possible to edit"
- Editing of Guarded Blocs - Action Handler in Editor
- Create e.g. JFrame
- Place some Control
- Generate actionPerformed handler for this control
- Switch to Source from Design
- 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.
- Appearance of A11Y for components
- Add step by step all components to form from tabs Swing, AWT
- Assure occurence of A11Y node in propertysheet (tab Basic properties)
- EXPECTED RESULT: All components have A11Y node in properties except: JSpinner and ButtonGroup.
- Appearance of A11Y for top containers
- Create all Gui form offered by IDE: JForm, JDialog, JFrame, JInternalFrame, JPanel, Applet, Form, Frame, Panel
- Select Top Container in Component Inspector
- Assure occurence of A11Y node in propertysheet (tab Basic properties)
- EXPECTED RESULT: All top-containers have A11Y node in properties.
- Appearance of A11Y node for menu components
- Add to JForm JMenu, JPopupMenu
- For JMenu add JMenuItem, JCheckBoxMenuItem, JRadioButtonMenuItem, JMenu, JSeparator
- Assure occurence of A11Y node in propertysheet (tab Basic properties)
- EXPECTED RESULT: All menu components have A11Y node in properties. Bug# 22786
- Generated code for A11Y
- Add JButton to form
- Change all A11Y properties: A11Y Name, A11Y Description, A11Y Parent
- Assure generated code
- Repeat this test for Button, JMenuItem, JForm - top container
- EXPECTED RESULT: Code is generated properly.