cornercorner
FeaturesPluginsDocs & SupportCommunityPartners

Form Editor - Group Layout Library Test Specification

Author: Marek Grummich
Version: 5.0
Last update: 2006/05/18
Introduction: The Free Design Layout was introduced since NetBeans 5.0 as default. The appropriate library (swing-layout-1.0.jar) is not included in the jdk1.5.0, therefore it must be included in the project in this case. If project is intended to run on jdk1.6.0, the library not have to be included, because it is part of jdk already.
Comment:

Table of Contents

Test suite 1: Group Layout Library on JDK 1.5.0

Purpose: The purpose of this suite is verified if Group Layout Library is included in the project when it is needed
Setup: Start IDE with clear userdir on jdk1.5.0. Create a new project, Java Application (e.g. MyApplication).

#Test caseDescription
1Library Manager
  1. Choose Tools | Library Manager
RESULT: The Swing Layout Extensions node must be present in the Libraries and an appropriate jar file must be placed in the location presented by Library Classpath
2Library presence I.
  1. Select MyApplication node in the Project view
  2. Invoke Properties from node popup menu
  3. Select Libraries node in the Categories pane
RESULT: Swing Layout Extensions library should NOT be present in the Compile tab, Compile-time libraries
3Library presence II.
  1. Select MyApplication node in the Project view
  2. Invoke Clean and Build Main Project action from toolbar
  3. Switch in the Files view
  4. Expand MyApplication/dist in the Files view
RESULT: There shoud be only MyApplication.jar, README.txt files, NO lib folder and swing-layout-1.0.jar file
4Create a JFrame Form
  1. Select MyApplication/Source Packages/myapplication in the Project view
  2. Choose from popup New | File/Folder...
  3. Choose Java GUI Forms > JFrame Form and press Next> button.
  4. In New Wizard type name "MyJFrame"
  5. Push Finish button
  6. Select MyApplication node in the Project view again
  7. Invoke Properties from node popup menu
  8. Select Libraries node in the Categories pane
RESULT: Swing Layout Extensions library should be present in the Compile tab, Compile-time libraries
5Change Project Main Class
  1. Select MyApplication/Source Packages/myapplication in the Project view
  2. Invoke Properties from node popup menu
  3. Select Run node in the Categories pane
  4. Change Main Class field to myapplication.MyJFrame
  5. Confirm Project properties dialog
  6. Select MyApplication node in the Project view
  7. Invoke Clean and Build Main Project action from toolbar
RESULT: Check if two lines, similar like following, is appeared in the Output window
To run this application from the command line without Ant, try:
java -jar /<some path>/MyApplication/dist/MMyApplication.jar
6Library presence III.
  1. Invoke Clean and Build Main Project action from toolbar
  2. Switch in the Files view
  3. Expand MyApplication/dist in the Files view
RESULT:There should be the lib folder with swing-layout-1.0.jar file.
7Run Project Outside IDE
  1. Select MyApplication node in the Project view
  2. Invoke Clean and Build Main Project action from toolbar
  3. Copy similar line from Output window to clipboard
    java -jar /<some path>/MyApplication/dist/MMyApplication.jar
  4. Exit IDE
  5. In the command line place the line from clipboard and enter (the same java version 1.6.0 is expected on the path, classpath)
Teardown: Restart IDE with the same userdir as previous
RESULT: The MyApplication should be started from command line. (The same version of JDK is expected, path, classpath)

Test suite 2: Group Layout Library on JDK 1.6.0

Purpose: The purpose of this suite is verified if Group Layout Library is included in the project when it is needed
Setup: Start IDE with clear userdir on jdk1.6.0. Create a new project, Java Application (e.g. MyApplication).

#Test caseDescription
1Create a JFrame Form
  1. Select MyApplication/Source Packages/myapplication in the Project view
  2. Choose from popup New | File/Folder...
  3. Choose Java GUI Forms > JFrame Form and press Next> button.
  4. In New Wizard type name "MyJFrame"
  5. Push Finish button
  6. Select MyApplication node in the Project view again
  7. Invoke Properties from node popup menu
  8. Select Libraries node in the Categories pane
RESULT:NO library should be present in the Compile tab, Compile-time libraries!
2Change Project Main Class
  1. Select MyApplication/Source Packages/myapplication in the Project view
  2. Invoke Properties from node popup menu
  3. Select Run node in the Categories pane
  4. Change Main Class field to myapplication.MyJFrame
  5. Confirm Project properties dialog
  6. Select MyApplication node in the Project view
  7. Invoke Clean and Build Main Project action from toolbar
RESULT: Check if two lines, similar like following, is appeared in the Output window
To run this application from the command line without Ant, try:
java -jar /<some path>/MyApplication/dist/MMyApplication.jar
3Library presence
  1. Switch in the Files view
  2. Expand MyApplication/dist in the Files view
RESULT: There is neither lib directory nor swing-layout-1.0.jar file in the dist directory
4Run Project Outside IDE
  1. Select MyApplication node in the Project view
  2. Invoke Clean and Build Main Project action from toolbar
  3. Copy similar line from Output window to clipboard
    java -jar /<some path>/MyApplication/dist/MMyApplication.jar
  4. Exit IDE
  5. In the command line place the line from clipboard and enter (the same java version 1.6.0 is expected on the path, classpath)
Teardown: Restart IDE with the same userdir as previous
RESULT: The MyApplication should be started from command line. (The same version of JDK is expected, path, classpath)
5Add New Java Platform
  1. Invoke Tools | Java Platform Manager from Main Menu
  2. Push Add Platform button and select jdk1.5.0 folder
  3. Close Java Platform Manager dialog
RESULT:New JDK1.5.0 Java Platform should be appeared in Java Platform Manager
6Change Project Platform
  1. Select MyApplication node in the Project view
  2. Invoke Properties from node popup menu
  3. Select Libraries node
  4. Change Java platform field to JDK 1.5.0, confirm Change Java Platform dialog and close Project Properties dialog.
  5. Invoke Clean and Build Main Project action from toolbar
RESULT: Project should not be compilable due to library missing and wrong packaging of Group layout (jdk1.6.0)
7Code Generation I.
  1. Select MyApplication/Source Packages/myapplication/MyJFrame node in the Project view
  2. Invoke Open action from popup menu
  3. Switch Form Editor to Source view by pushing Source button in the editor toolbar
  4. Expand all guarded block's folds
  5. Check that you see javax.swing.GroupLayout snippet in the generated code (should be error, red annotated)
  6. Switch Form Editor to Design view by pushing Design button in the editor toolbar
  7. Select Form MyJFrame node in the component Inspector
  8. Change Layout Generation property to Swing Layout Extension Library in the Properties window
RESULT: Switch Form Editor to Source view by pushing Source button in the editor toolbar
Check that snippet javax.swing.GroupLayout is changed to org.jdesktop.layout.GroupLayout (should be error, red annotated - swing extension library is still missing)
8Add Swing Extension Library
  1. Select MyApplication node in the Project view
  2. Invoke Project Properties dialog from popup menu
  3. Select Libraries node in the Categories
  4. Push Add Library button
  5. Select Swing Layout Extensions in the Add Library dialog and push Add Library button
  6. Confirm Project properties dialog, push OK button
  7. Invoke Clean and Build Main Project action from toolbar
RESULT: Project should be compilable and when you switch to Source view of Form Editor, error, red annotation is disappeared
9Code Generation II.
  1. Select MyApplication node in the Project view
  2. Invoke Properties from node popup menu
  3. Select Libraries node
  4. Change Java platform field to JDK 1.6.0, confirm Change Java Platform dialog and close Project Properties dialog.
  5. Remove Swing Layout Extensions library from Compile-time libraries
  6. Invoke Clean and Build Main Project action from toolbar
  7. Project should NOT be compilable, because form code generation is still using Swing Layout Extesions library
  8. Select MyApplication/Source Packages/myapplication/MyJFrame node in the Project view
  9. Invoke Open action from popup menu
  10. Switch Form Editor to Design view by pushing Design button in the editor toolbar
  11. Select Form MyJFrame node in the component Inspector
  12. Change Layout Generation property to Standard Java 6 Code in the Properties window
  13. Invoke Clean and Build Main Project action from toolbar
RESULT: Switch Form Editor to Source view by pushing Source button in the editor toolbar
Check that snippet org.jdesktop.layout.GroupLayout is changed to javax.swing.GroupLayout
Project should be compilable

Generated: 2006 05 18 03:49
Companion
Projects:
MySQL Database Server   GlassFish Community: an Open Source Application Server   Open Solaris  Open JDK: an Open SourceJDK   Mobile & Embedded Community     Sponsored by 
Sponsored by Sun Microsystems