TS 72 JSF Support

JSF Support and Palette Test Specification

Author: Michal Strnad, Jiří Skřivánek
Version: 7.2
Last update: 5-th April 2012
Introduction: This document is test specification for JSF Support and Palette.


Contents


JSF Support Test Specification

Test suite: Creating a new application with JSF support

Purpose: Tests functionality which make possible to create Web Project base upon JSF framework.

  1. Create web application with JSF Support
    1. Choose File > New Project and select the Web Application template from the Java Web category.
    2. Click Next in Name and Location page.
    3. Click Next in Server and Settings page.
    4. In the Frameworks page, check JavaServer Faces framework.
    5. Click Finish.
    6. Verify 'Web Pages/index.xhtml', 'Configuration Files | web.xml', 'Libraries | JSF *' exist in web project.

Test suite: Adding JSF support to an existing application

  1. Add JSF support
    1. Create a new web application project without any framework.
    2. Call Properties popup action on project's node.
    3. In the Project Properties dialog select Frameworks category.
    4. Click Add button.
    5. Select JavaServer Faces and confirm dialog.
    6. Click OK to confirm the Properties dialog.
    7. Verify that index.jsp and index.xhtml in 'Web Pages', 'Configuration Files | web.xml', 'Libraries | JSF *' have been created in web project.

Test suite: JSF Managed Bean wizard

  1. Create JSF Managed Bean
    1. Open the new file wizard (CTRL+N).
    2. Select JavaServer Faces category and JSF Faces Configuration file type.
    3. Finish the wizard.
    4. Open the new file wizard (CTRL+N).
    5. Select JavaServer Faces category and JSF Managed Bean file type.
    6. Type/define a package name and check Add data to configuration file.
    7. Finish the wizard.
    8. Try to repeat steps 1 - 4 but change name, scope, description in the wizard and verify generated XML.
    9. Verify a java class is created in specified package and faces-config.xml contains a new managed-bean element with proper sub elements.
  1. Delete JSF Managed Bean
    1. Call Refactor|Safely Delete... context action on managed bean node.
    2. Click Refactor to confirm dialog.
    3. Managed bean should be removed and corresponding element from faces-config.xml should be removed.

Test suite: Actions in faces-config.xml field

  1. Add managed bean
    1. Open 'Configuration Files|faces-config.xml' file.
    2. Call Insert|Managed Bean.. action in editor.
    3. Fill in requered values.
    4. Click Add button to confirm the dialog.
    5. Repeat steps 2 - 4 several times and change parameters. Also try to browse for a class (issue 91007).
    6. Verify faces-config.xml contains a new managed-bean element with proper sub elements.
  1. Add navigation rule
    1. Open 'Configuration Files|faces-config.xml' file.
    2. Call Insert|Navigation Rule... action in editor.
    3. Click Browse button and select a JSP file (index.jsp).
    4. Type something in "Rule Description:" field and click Add button.
    5. Once more call Insert|Navigation Rule... action in editor.
    6. Click Browse button and select the same JSP file(index.jsp) as before.
    7. Add button should be disabled with message that navigation rule already exists.
    8. Verify faces-config.xml contains a new navigation-rule element with proper sub elements.
  1. Add navigation case to existing rule
    1. Open 'Configuration Files|faces-config.xml' file.
    2. Call Insert|Navigation Case... action in editor.
    3. "From View:" field should be populated with previously selected JSP file (index.jsp).
    4. Type something in "From Action:", "From Outcome:" and "Rule Description:" fields.
    5. Select a JSP file (index.jsp) in "To View:" combo box.
    6. Click Add button.
    7. Verify faces-config.xml contains a new navigation-case element inside previously created navigation-rule element. Check sub elements corresponds to specified parameters.
  1. Add navigation case with new rule
    1. Open 'Configuration Files|faces-config.xml' file.
    2. Call Insert|Navigation Case... action in editor.
    3. Click Browse button and select a different JSP file than before.
    4. Type something in "From Action:", "From Outcome:" and "Rule Description:" fields.
    5. Select a JSP file (index.jsp) in "To View:" combo box.
    6. Click Add button.
    7. Verify faces-config.xml contains a new navigation-case element inside newly created navigation-rule element. Check sub elements corresponds to specified parameters.

Test suite: Create web application with JSF Support components

Preconditions/Setup:

  1. ICEfaces
    1. Choose "File" > "New Project" and select the "Web Application" template from the "Java Web" category.
    2. Click Next in "Name and Location" page.
    3. Click Next in "Server and Settings" page.
    4. In the "Frameworks" page, check "JavaServer Faces" framework.
    5. Click Components tab.
    6. There should be "ICEfaces", "RichFaces" and "PrimeFaces".
    7. Check "ICEfaces".
    8. Verify that message "JSF library ICEfaces not set up properly. Click more to update its configuration." appears at the bottom of the window.
    9. Click More....
    10. Push Create ICEfaces library.
    11. The new window "Create New Library" contains "Library Name:" with default value "MyLibrary" and "Library Type:" with default value "Class Libraries".
    12. Change library name to MyLibraryIF and click OK
    13. In "Customize Library" click "Add JAR/Folder..." button
    14. Browse for icefaces.jar and icefaces-ace.jar from downloaded ICEfaces library
    15. Click OK in all dialogs and then Finish
    16. Verify that project was created properly, welcomeIcefaces.xhtml file is created under Web Pages node and under Libraries node are added MyLibraryIF nodes pointing to selected jars
    17. Run project and check it executes successfully
    18. Right-click project node and choose Properties
    19. Go to Frameworks category and then Components tab
    20. Uncheck ICEfaces and click OK
    21. Verify MyLibraryIF nodes disappear from Libraries
    22. Right-click project node and choose Properties
    23. Go to Frameworks category and then Components tab
    24. Select ICEfaces check box
    25. Click OK
    26. Verify that MyLibraryIF nodes are added under Libraries node
  2. RichFaces
    1. Choose "File" > "New Project" and select the "Web Application" template from the "Java Web" category.
    2. Click Next in "Name and Location" page.
    3. Click Next in "Server and Settings" page.
    4. In the "Frameworks" page, check "JavaServer Faces" framework.
    5. Click Components tab.
    6. There should be "ICEfaces", "RichFaces" and "PrimeFaces".
    7. Check "RichFaces".
    8. Verify that message "JSF library RichFaces not set up properly. Click more to update its configuration." appears at the bottom of the window.
    9. Click More....
    10. Verify that message "No complete RichFaces library found. See list of mandatory JARs." appears at the bottom of the window.
    11. Push Create Library.
    12. The new window "Create New Library" contains "Library Name:" with default value "MyLibrary" and "Library Type:" with default value "Class Libraries".
    13. Change library name to MyLibraryRF and click OK
    14. In "Customize Library" click "Add JAR/Folder..." button
    15. Browse for downloaded RichFaces library and add all seven jars listed in the dialog. All are mandatory for deployment.
    16. Click OK in all dialogs and then Finish
    17. Verify that project was created properly, welcomeRichfaces.xhtml file is created under Web Pages node and under Libraries node are added MyLibraryRF nodes pointing to selected jars
    18. Run project and check it executes successfully
    19. Right-click project node and choose Properties
    20. Go to Frameworks category and then Components tab
    21. Uncheck ICEfaces and click OK
    22. Verify MyLibraryRF nodes disappear from Libraries
    23. Right-click project node and choose Properties
    24. Go to Frameworks category and then Components tab
    25. Select RichFaces check box
    26. Click OK
    27. Verify that MyLibraryRF nodes are added under Libraries node
  3. PrimeFaces
    1. Choose "File" > "New Project" and select the "Web Application" template from the "Java Web" category.
    2. Click Next in "Name and Location" page.
    3. Click Next in "Server and Settings" page.
    4. In the "Frameworks" page, check "JavaServer Faces" framework.
    5. Click Components tab.
    6. There should be "ICEfaces", "RichFaces" and "PrimeFaces".
    7. Check "PrimeFaces".
    8. Push Finish.
    9. Verify that project was created properly, welcomePrimefaces.xhtml file is created and under Libraries node is added default PrimeFaces jar from NetBeans distribution
    10. Run project and check it executes successfully
    11. Right-click project node and choose Properties
    12. Go to Frameworks category and then Components tab
    13. Uncheck PrimeFaces and click OK
    14. Verify PrimeFaces node disappear from Libraries
    15. Right-click project node and choose Properties
    16. Go to Frameworks category and then Components tab
    17. Select PrimeFaces check box
    18. Click More...
    19. In PrimeFaces dialog click Create Library
    20. Type MyLibraryPF and click OK
    21. In "Customize Library" dialog click "Add JAR/Folder..."
    22. Browse for your custom PrimeFaces jar (you can use embedded on in NetBeans distribution <netbeans_install>/enterprise/modules/ext/primefaces/*.jar)
    23. Click OK in all opened dialogs
    24. Verify that MyLibraryPF node is added under Libraries node

JSF Palette Test Specification

Test suite: Inserting JSP Palette items

Setup: Web project is created.


  1. Create empty JSF Form
    1. Invoke Window > Pallete and expand JSF.
    2. Drag and drop JSF Form to editor.
    3. Empty JSF form should be inserted to index.xhtml at the position you dropped it.
  2. Create JSF Form from Entity class
    1. Select your Web project and invoke popup menu.
    2. Invoke New | Other and choose Persistence | Entity Class.
    3. Push Next
    4. As "Package" enter value "entity" and push Next.
    5. Invoke drop down menu on "Database Connection" and select "jdbc:derby://localhost:1527/sample[app on APP]".
    6. Push Finish.
    7. Select your Web project and invoke popup menu.
    8. Invoke New | Other and choose "JavaServer Faces" | "JSF Managed Bean".
    9. Push Next.
    10. As "Package" enter value "beans" and push Finish.
    11. Open your newly created Managed Bean and invoke popup menu.
    12. Select Insert Code....
    13. Drop down menu appears int the editor.
    14. Choose "Add Property...".
    15. In the new window fill field "Name:" with value "test" and field "Type:" with value "NewEntity".
    16. Invoke popup menu in the editor and push Fix Imports.
    17. Open file "index.xhtml" from "Web Pages".
    18. Drag "JSF Form From Entity" item from the Palette and drop it in editor.
    19. Select "Entity:" and "Managed Bean Property" that you created.
    20. Push OK.
    21. Check if new form was created properly.
  3. Create JSF Metadata
    1. Drag Metadata item (section JSF) from the Palette and drop it in editor.
    2. Click 'Add..' and fill 'Id' and Value with some text.
    3. Verify that Metadata was inserted to index.xhtml at the position you dropped it.
  4. Create empty JSF Data Table
    1. Drag JSF Data Table item from the Palette and drop it in editor.
    2. Click OK in 'Insert JSF Data Table' dialog.
    3. Verify empty JSF Data Table is inserted to index.xhtml at the position you dropped it.
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