Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Facelet Functional Test

Project Creation and Facet Installation

New Project Creation with Default Settings

  1. Open the New Dynamic Web Project Wizard.
  2. Name the project Facelet1
  3. Select Facelet 1.0 Project in the Configuration drop down box.
  4. Hit Next.
  5. Hit Next on the Web Module page without changing the defaults.
  6. In the JSF facet install page:
    1. Select a JSF 1.2 runtime, adding one if not present.
    2. Select the Facelet JSF library, creating one if not present.
  7. Hit Next.
  8. Verify that the Facelet install page appears: DefaultFaceletFacetInstallPage.png
  9. Hit Finish without changing the defaults.
  10. Verify that the facets are installed correctly.
  11. Open the WEB-INF/faces-config.xml and verify that the facelet view handler has been registered.
  12. Open the web.xml file and verify that the DEFAULT_SUFFIX has been correctly initialized.

New Project Creation with additional web.xml Settings

  1. Create a new dynamic web project in the same way as the method in the test above, except in the Facelet install page, select all check boxes.
  2. Verify the same as above, plus the creation of the ConfigureListener and WebappLifecycleListener in the web.xml.

Add facet to existing JSF Project

  1. Create a JSF 1.2 faceted Dynamic Web Project with no Facelet facet.
  2. Open Project->Properties...->Project Facets.
  3. Select the Facelet check box.
  4. Hit Ok.
  5. Verify that the faces-config.xml is updated with the Facelet view handler and the web.xml has the DEFAULT_SUFFIX property updated.

Facet Add and Remove

Default create/remove

  1. Create a JSF 1.2/Facelet faceted project using the default settings.
  2. Verify that web.xml contains the .xhtml DEFAULT_SUFFIX setting and the faces-config.xml has the view handler.
  3. Right-click Project->Properties.. Project Facets and remove the Facelet facet without changing the remove settings.
  4. Verify that neither the web.xml nor the faces-config.xml has had the facet install changes removed.

Default add/remove

  1. Create a JSF 1.2 faceted project (Do not add the Facelet facet on creation).
  2. Verify that the web.xml and faces-config.xml files have been configured for JSF but not Facelets.
  3. Right-click on Project->Properties.. Project Facets and add the Facelet facet.
  4. Apply the add without changing the default settings.
  5. Verify that the DEFAULT_SUFFIX has been added to the web.xml and the Facelet view handler has been added to the faces-config.xml file.
  6. Right-click on Project->Properties.. Project Facets and remove the Facelet facet.
  7. Do not change the default settings and confirm the remove.
  8. Verify that neither the web.xml nor the faces-config.xml has had the facet install changes removed.

Default create/remove with matching remove settings

  1. Create a JSF 1.2/Facelet faceted project using the default settings.
  2. Verify that web.xml contains the .xhtml DEFAULT_SUFFIX setting and the faces-config.xml has the view handler.
  3. Right-click Project->Properties.. Project Facets to remove the Facelet facet.
  4. Open the further configuration dialog for the Facelet remove and select to remove the DEFAULT_SUFFIX and the view handler options.
  5. Confirm the remove.
  6. Verify that both the DEFAULT_SUFFIX and facelet view handler values have been removed from the project.

Default add/remove with matching remove settings

  1. Create a JSF 1.2 faceted project (Do not add the Facelet facet on creation).
  2. Verify that the web.xml and faces-config.xml files have been configured for JSF but not Facelets.
  3. Right-click on Project->Properties.. Project Facets and add the Facelet facet.
  4. Apply the add without changing the default settings.
  5. Verify that the DEFAULT_SUFFIX has been added to the web.xml and the Facelet view handler has been added to the faces-config.xml file.
  6. Right-click on Project->Properties.. Project Facets and remove the Facelet facet.
  7. Open the Further Configuration dialog and select removal of the DEFAULT_SUFFIX and Facelet view handler
  8. Verify that the web.xml and the faces-config.xml has had the facet install changes removed.

Add all, remove all

  1. Create a JSF 1.2 and Facelet faceted project and select all available Facelet configuration options.
  2. Verify that all Facelet configuration options were applied to the faces-config.xml and web.xml files
  3. Remove the Facelet facet, selecting removal of all Facelet configuration options.
  4. Verify that all Facelet configuration options were removed.

Add all, remove some

  1. Create a JSF 1.2 and Facelet faceted project and select all available Facelet configuration options.
  2. Verify that all Facelet configuration options were applied to the faces-config.xml and web.xml files
  3. Remove the Facelet facet, selecting removal of only the configure listener and Facelet view handler to remove.
  4. Verify that only the selected configuration options were removed.

Remove JSF and Facelet

  1. Create a JSF 1.2 and Facelet faceted project using the default configurations.
  2. Verify that the faces-config.xml and web.xml configurations are set up properly.
  3. In the Project Facets menu, select remove both the JSF and Facelet facets.
  4. In the facelet removal dialog, select to remove the DEFAULT_SUFFIX and Facelet view handler options.
  5. Accept the changes and verify that everything was correctly removed.

XHTML Editor

For all these tests, start with a Dynamic Web Project with the JSF 1.2/Facelet facets. Ensure that JSF runtime, JSTL 1.2 and the facelet jars in the classpath. Create an XHTML 1.0 Transitional file in the WebContent root directory.

Content Assist

Namespace Assist

Basic insertion

  1. Place the cursor inside the html tag.
  2. Add the text xmlns:f=. Verify that content assist activates after the equals sign.
  3. With the cursor after the = sign, and Ctrl-Space.
  4. Verify again the content assist is activated with the following options:
  5. Select on of the options and verify that it is correctly inserted.

FaceletNamespaceContentAssist.png

No duplicate insertion

  1. With one of the namespace options inserted into the HTML from the test above.
  2. Create a new attribute for xmlns:h=
  3. Verify that the options list for content assist (which should again appear after entering hitting the = sign) includes all valid namespace options 'except' the one already inserted.
  4. Select an option and verify that it inserts correctly.

Tag Assist

Basic insertion

  1. Create an XHTML document and add the core and html namespaces to the page.
  2. Save the page.
  3. Create an opening less-than (<) and hit Ctrl-Space.
  4. Verify that all the core and html tags are present.
  5. Select h:form and verify it is correctly inserted.

Prefix selection

  1. Add the text <f: to a document with core declared with the f prefix.
  2. Hit Ctrl-Space after the : and verify that only the core tags are listed in the content assist.
  3. Add the text <h:in to a document with html declared with the h prefix.
  4. Hit Ctrl-Space after the text and verify that only inputHidden, inputSecret, inputText, inputTextarea are present.

Attribute Name Assist

Basic insert

  1. In a no-attribute h:outputText tag, activate content assist.
  2. Verify that the attribute options are listed.
  3. Select value and verify it inserts correctly.
  4. In an h:message tag, activate content assist for attributes.
  5. Verify that the attribute for is marked to indicate it is required.\
  6. Select for and verify it inserts correctly.

Attribute Name Prefix

  1. In a no-attribute h:outputText tag, add the a v at the beginning of an attribute.
  2. Activate content assist after the v.
  3. Verify that only assists for validator, validatorMessage, value, valueChangeListener.
  4. Select the validator and verify it inserts correctly.

Static Attribute Value Assist

  1. Starting with the tag, <h:outputText dir=""> activate content assist inside the double-quotes.
  2. Verify that assists for ltr and rtl are present.
  3. Select ltr and verify that it inserts correctly.

Dynamic Attribute Value, Non-EL Assist

  1. Create a page navigation from login.xhtml to welcome.xhtml in the faces-config (pages must exist). Call the outcome login in the faces-config file.
  2. In login.xhtml, add an h:commandButton.
  3. Add an action attribute to the commandButton tag.
  4. In the value for the action attribute, activate content assist.
  5. Verify that an assist is included: login: goto /welcome.xhtml.
  6. Use the assist and verify that it inserts login into the attribute value.

EL Content Assist

For these tests, add a beans.LoginBean class to the src folder and create a session bean of that type called loginBean to the faces-config. Also, create a login.xhtml Transitional XHTML file in a Facelet faceted project. Add name and password bean properties to the LoginBean type.

Variable Assist, Blank EL

  1. Create an h:inputText tag and add a value attribute to it.
  2. Set the value of the value attribute to "#{}".
  3. Activate content assist inside the braces.
  4. Verify that loginBean and all the implicit variables are present
  5. Scroll in the list to loginBean
  6. Verify that additionalInfo appears with name, type and scope correctly set.
  7. Select the loginBean action and verify it is correctly inserted.

Variable Assist, Variable Present

  1. Start with <h:inputText value="#{p}"/> in an XHTML document.
  2. After the p in the EL expression, activate content assist.
  3. Verify that only param and paramValue (the only ones starting with p) are present.
  4. Verify the correct insertion for paramValue.

Property Assist, No Property

  1. Add an <h:inputText value="#{loginBean.}"/>.
  2. Position the cursor after the . and hit Ctrl-Space.
  3. Verify that name and password and class appear as options.
  4. Backspace to delete the ..
  5. Re-enter the . and verify that the same assist options as above appear automatically.
  6. Select the name property in the list and verify that the additional info provides correct type and assignability.
  7. Select name and verify it inserts properly.

Property Assist, Existing Property

  1. Add an <h:inputText value="#{facesContext.r}"/>.
  2. After the r, press Ctrl-Space.
  3. Verify that only assists starting with r are present: renderKit, renderResponse, responseComplete, responseStream, responseWriter.
  4. Scroll through each and verify in the additionalInfo window in order: javax.faces.render.RenderKit, read-only, boolean, read-only, boolean, read-only, javax.faces.context.ResponseStream, read/write, javax.faces.context.ResponseWriter, read/write.
  5. Select the renderKit property and verify it inserts correctly.

Property Assist, Property of Property

  1. Starting from the result of the above, Property Assist, Existing Property.
  2. Activate content assist after renderKit by entering a . character.
  3. Verify that the assist window opens with class and responseStateManager present.
  4. Verify additionalInfo on the responseStateManager property as javax.faces.render.ResponseStateManager, read-only.
  5. Verify that the responseStateManager property inserts correctly.

EL Hover Help

For all hover help tests, start with a <h:inputText value="#{loginBean.name}"/> in an xhtml file.

Simple variable hover

  1. Place mouse over the loginBean. Verify that a hover help window appears with correct name, type and scope.

Simple property hover

  1. Place mouse over name.
  2. Verify that type and accessibility are correct.

Simple property hover with Javadoc

  1. Add Javadoc with a @return statement to the getter for the name property.
  2. Save and rebuild.
  3. Place mouse over the name property in the xhtml document.
  4. Verify that the return text appears in the hover help in addition to the basic type and accessibility information.

Hyperlink

Start with <h:inputText value="#{loginBean.name}"/>.

Variable

  1. Position mouse cursor over loginBean.
  2. Hold down ctrl and verify that a hyperlink appears under the text.
  3. Left mouse click and verify that the LoginBean class is opened in a Java editor with the class name selected.

Property

  1. Position mouse cursor over name.
  2. Hold down ctrl and verify that a hyperlink appears under the text.
  3. Left mouse click and verify that the LoginBean class is opened in a Java editor with the getName() method is selected.

Validation

For all these tests, start with a Dynamic Web Project with the JSF 1.2/Facelet facets. Ensure that JSF runtime, JSTL 1.2 and the facelet jars in the classpath. Create an XHTML 1.0 Transitional file in the WebContent root directory.


For all EL validation tests, start additionally with a loginBean EL variable declared in the usually way and tied to a class beans.LoginBean with name and password bean properties.

Non-EL validation, Static

  1. Add <h:panelGrid columns=""/> to the an XHTML document.
  2. Validate the page and verify that the empty value for columns is flagged with a warning for invalid integer value.
  3. Change the value for columns to 2.
  4. Revalidate and verify that the warning goes away.
  5. Change the value for columns to d.
  6. Revalidate and verify that the warning reappears flagging the value as not a valid integer.

Non-EL validation, Dynamic

  1. Add a h:commandButton action="login"/> and validate.
  2. Verify that the login value is flagged as not a valid navigation outcome value.
  3. Create a page navigation from login.xhtml to welcome.xhtml in the normal smoke test way and create the login outcome.
  4. Revalidate and verify that the validation message goes away.
  5. Change the value of the action attribute to login2.
  6. Revalidate and verify that the validation message reappears on the action value.
  7. Change back the action value to login again, revalidate and verify no problems.

EL validation, no EL

  1. Add an <h:inputText value="#{}" />.
  2. Validate and verify that the {} is flagged as a warning for empty EL expression.

EL validation, invalid variable

  1. Add a <h:inputText value="#{notAVariable}" /> tag.
  2. Validate and verify that notAVariable is flagged as not a known variable.

EL validation, no property

  1. Add a <h:inputText value="#{loginBean.notAProperty}" /> tag.
  2. Validate and verify that notAProperty is flagged as not a known property.

EL validation, valid variable.property

  1. Add a <h:inputText value="#{loginBean.name}" /> tag.
  2. Validate and verify that EL expression passes validation.
  3. Change loginBean to loginBean2, revalidate and verify that loginBean2 is flagged with a warning.
  4. Change loginBean2 back to loginBean.
  5. Change name to name2, revalidate and verify that name2 is flagged with a warning.
  6. Change name2 back to name.
  7. Validate and verify that EL expression again passes validation.

File Creation Templates

Facelet Tag Support

Tag Registry and Component Tree Support

Back to the top