TS 60 grouplayout

Form Editor - Group Layout Library Test Specification

Author: Jana Maleckova
Version: 6.0
Last update: 2007/05/14
Introduction: The Free Design Layout was introduced since NetBeans 5.0 as default. The appropriate library (swing-layout-1.0.3.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.
Comments:

Contents


Test suite: Group Layout Library on JDK 1.5

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 latest build of jdk 1.5 Create a new project, Java Application (e.g. MyApplication)

  1. Library Manager
    1. Choose Tools | Library Manager
    • EXPECTED 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
  2. Library 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
    • EXPECTED RESULT: Swing Layout Extensions library should NOT be present in the Compile tab, Compile-time libraries
  3. Library 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
    • EXPECTED RESULT: There shoud be only MyApplication.jar, README.txt files, NO lib folder and swing-layout-1.0.3.jar file
  4. Create 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
    • EXPECTED RESULT: Swing Layout Extensions library should be present in the Compile tab, Compile-time libraries
  5. Change 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
    • EXPECTED 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 /somepath/MyApplication/dist/MMyApplication.jar
  6. Library 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
    • EXPECTED RESULT: There should be the lib folder with swing-layout-1.0.3.jar file.
  7. Run 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 /somepath/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)
    • EXPECTED RESULT: The MyApplication should be started from command line. (The same version of JDK is expected, path, classpath)


Test suite: Group Layout Library on JDK 1.6

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 latest build jdk1.6. Create a new project, Java Application (e.g. MyApplication).

  1. Create 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
    • EXPECTED RESULT: NO library should be present in the Compile tab, Compile-time libraries!
  2. Change 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
    • EXPECTED 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 /somepath/MyApplication/dist/MMyApplication.jar
  3. Library presence
    1. Switch in the Files view
    2. Expand MyApplication/dist in the Files view
    • EXPECTED RESULT: There is neither lib directory nor swing-layout-1.0.3.jar file in the dist directory
  4. Run 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 /somepath/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)
    • EXPECTED RESULT: The MyApplication should be started from command line. (The same version of JDK is expected, path, classpath)
  5. Add New Java Platform
    1. Invoke Tools | Java Platform Manager from Main Menu
    2. Push Add Platform button and select jdk1.5 folder
    3. Close Java Platform Manager dialog
    • EXPECTED RESULT: New JDK1.5 Java Platform should be appeared in Java Platform Manager
  6. Change 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, confirm Change Java Platform dialog and close Project Properties dialog.
    5. Invoke Clean and Build Main Project action from toolbar
    • EXPECTED RESULT: Project should not be compilable due to library missing and wrong packaging of Group layout (jdk1.6)
  7. Code 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
    • EXPECTED 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)
  8. Add Swing Extension Library
    1. Select MyApplication node in the Project view
    2. Invoke Open action 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
    • EXPECTED RESULT: Project should be compilable and when you switch to Source view of Form Editor, error, red annotation is disappeared
  9. Code 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, 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
    • EXPECTED 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


Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo