TS 71 JSF Support

JSF Support and Palette Test Specification

Author: Michal Strnad
Version: 7.1
Last update: 2011/10/7
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:

ICEfaces - It is necessarily have downloaded file ICEfaces-x.x.x-bin.zip from http://www.icefaces.org/main/downloads/ and extracted.

RichFaces - It is necessarily have downloaded file richfaces-x.x.x.Final.zip from http://www.jboss.org/richfaces/download/ and extracted.


Comments:

- PrimeFaces are integrated in NetBeans (no installation is needed).


  1. Create web application with JSF Support components (ICEfaces [New Library])
    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 x.x 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. Leave default values and push OK.
    13. The new window "Customize Library" contains tabs "Classpath", "Sources" and "Javadoc". In default is actice tab "Classpath".
    14. Click Add JAR/Folder....
    15. Search the folder (ICEfaces-x.x.x-bin) which you extracted from downloaded archive.
    16. In this folder find file named "icefaces.jar" (...ICEfaces-x.x.x-bin/icefaces/lib/icefaces.jar), select it and click Add JAR/Folder.
    17. Click OK and than again OK.
    18. Push Finish.
    19. Verify that project was created properly and library ICEfaces is in "Libraries" (expand your project and than subfolder "Libraries", there should be node named "MyLibrary-icefaces.jar").
  1. Create web application with JSF Support components (ICEfaces [Existing Library])
    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 x.x not set up properly. Click more to update its configuration." doesn't appear at the bottom of the window (as the previous Test Case).
    9. Click More....
    10. There should be filled correct value (previous created library named "MyLibrary") in "Value ICEfaces2 library".
    11. Click OK
    12. Push Finish.
    13. Verify that project was created properly and library ICEfaces is in "Libraries" (expand your project and than subfolder "Libraries", there should be node named "MyLibrary-icefaces.jar").
  1. Delete library in created web application with JSF Support components (ICEfaces)
    1. Invoke "Properties" on the previously created web project with JSF Support components (ICEfaces).
    2. Click Frameworks.
    3. Verify that in window "Used Frameworks:" is JavaServer Faces.
    4. Click Components tab in "JavaServer Faces Configuration" window.
    5. Verify that "ICEfaces" is checked.
    6. Uncheck "ICEfaces" and push OK.
    7. Verify that library "MyLibrary-icefaces.jar" is no longer in "Libraries" (expand your project and than subfolder "Libraries").
  1. Create web application with JSF Support components (RichFaces [New Library])
    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 x.x 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. Leave default values and push OK.
    14. If you do previous test case with ICEfaces, than shows up message: "Library MyLibrary already exists". Just choose different "Library Name:" in the window "Create New Library".
    15. The new window "Customize Library" contains tabs "Classpath", "Sources" and "Javadoc". In default is actice tab "Classpath".
    16. Click Add JAR/Folder....
    17. Search the folder (richfaces-x.x.x.Final) which you extracted from downloaded archive.
    18. Find path "...richfaces-x.x.x.Final/artifacts/framework".
    19. In this folder select files richfaces-components-api-x.x.x.Final.jar and richfaces-components-ui-x.x.x.Final.jar and push Add JAR/Folder.
    20. Find path "...richfaces-x.x.x.Final/artifacts/ui"
    21. In this folder select files richfaces-core-api-x.x.x.Final.jar and richfaces-core-impl-x.x.x.Final.jar.
    22. Click again Add JAR/Folder....
    23. Click OK and than again OK.
    24. Push Finish.
    25. Verify that project was created properly and libraries: richfaces-components-api-x.x.x.Final.jar, richfaces-components-ui-x.x.x.Final.jar, richfaces-core-api-x.x.x.Final.jar and richfaces-core-impl-x.x.x.Final.jar are in "Libraries" (expand your project and than subfolder "Libraries").
  1. Create web application with JSF Support components (RichFaces [Existing Library])
    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 "No complete RichFaces library found.. See list of mandatory JARs." doesn't appear at the bottom of the window.
    9. Click More....
    10. There should be filled correct value (previous created library named "MyLibrary") in "Valid RichFaces Libary".
    11. Click OK
    12. Push Finish.
    13. Verify that project was created properly and libraries: richfaces-components-api-x.x.x.Final.jar, richfaces-components-ui-x.x.x.Final.jar, richfaces-core-api-x.x.x.Final.jar and richfaces-core-impl-x.x.x.Final.jar are in "Libraries" (expand your project and than subfolder "Libraries").
  1. Delete library in created web application with JSF Support components (RichFaces)
    1. Invoke "Properties" on the previously created web project with JSF Support components (RichFaces).
    2. Click Frameworks.
    3. Verify that in window "Used Frameworks:" is JavaServer Faces.
    4. Click Components tab in "JavaServer Faces Configuration" window.
    5. Verify that "RichFaces" is checked.
    6. Uncheck "RichFaces" and push OK.
    7. Verify that libraries: richfaces-components-api-x.x.x.Final.jar, richfaces-components-ui-x.x.x.Final.jar, richfaces-core-api-x.x.x.Final.jar and richfaces-core-impl-x.x.x.Final.jar are no longer in "Libraries" (expand your project and than subfolder "Libraries").
  1. Create web application with JSF Support components (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 and library PrimeFaces is in "Libraries" (expand your project and than subfolder "Libraries", there should be node named "PrimeFaces x.x.x-primefaces-x.x.x.jar").
  1. Delete library in created web application with JSF Support components (PrimeFaces)
    1. Invoke "Properties" on the previously created web project with JSF Support components (PrimeFaces).
    2. Click Frameworks.
    3. Verify that in window "Used Frameworks:" is JavaServer Faces.
    4. Click Components tab in "JavaServer Faces Configuration" window.
    5. Verify that "PrimeFaces" is checked.
    6. Uncheck "PrimeFaces" and push OK.
    7. Verify that library "PrimeFaces x.x.x-primefaces-x.x.x.jar" is no longer in "Libraries" (expand your project and than subfolder "Libraries").

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.
  1. 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.
  1. 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.
  1. 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