Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "Facelet Functional Test"
(→Property Assist) |
(→Property Assist, No Property) |
||
Line 103: | Line 103: | ||
# Select the ''name'' property in the list and verify that the additional info provides correct type and assignability. | # Select the ''name'' property in the list and verify that the additional info provides correct type and assignability. | ||
# Select ''name'' and verify it inserts properly. | # Select ''name'' and verify it inserts properly. | ||
+ | |||
+ | |||
+ | ====Property Assist, Existing Property==== | ||
+ | |||
+ | # Add an ''<h:inputText value="#{facesContext.r}"/>''. | ||
+ | # After the ''r'', press Ctrl-Space. | ||
+ | # Verify that only assists starting with ''r'' are present: ''renderKit'', ''renderResponse'', ''responseComplete'', ''responseStream'', ''responseWriter''. | ||
+ | # 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''. | ||
+ | # Select the ''renderKit'' property and verify it inserts correctly. | ||
+ | |||
+ | |||
+ | ====Property Assist, Property of Propert==== | ||
+ | |||
+ | # Starting from the result of the above, '''Property Assist, Existing Property'''. | ||
+ | # Activate content assist after ''renderKit'' by entering a ''.'' character. | ||
+ | # Verify that the assist window opens with ''class'' and ''responseStateManager'' present. | ||
+ | # Verify additionalInfo on the ''responseStateManager'' property as ''javax.faces.render.ResponseStateManager, read-only''. | ||
+ | # Verify that the ''responseStateManager'' property inserts correctly. | ||
== Validation == | == Validation == |
Revision as of 13:34, 22 May 2008
Contents
Feature Test
Content Assist
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.
Namespace Assist
Basic insertion
- Place the cursor inside the html tag.
- Add the text xmlns:f=. Verify that content assist activates after the equals sign.
- With the cursor after the = sign, and Ctrl-Space.
- Verify again the content assist is activated with the following options:
- Select on of the options and verify that it is correctly inserted.
No duplicate insertion
- With one of the namespace options inserted into the HTML from the test above.
- Create a new attribute for xmlns:h=
- 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.
- Select an option and verify that it inserts correctly.
Tag Assist
Basic insertion
- Create an XHTML document and add the core and html namespaces to the page.
- Save the page.
- Create an opening less-than (<) and hit Ctrl-Space.
- Verify that all the core and html tags are present.
- Select h:form and verify it is correctly inserted.
Prefix selection
- Add the text <f: to a document with core declared with the f prefix.
- Hit Ctrl-Space after the : and verify that only the core tags are listed in the content assist.
- Add the text <h:in to a document with html declared with the h prefix.
- Hit Ctrl-Space after the text and verify that only inputHidden, inputSecret, inputText, inputTextarea are present.
Attribute Name Assist
Basic insert
- In a no-attribute h:outputText tag, activate content assist.
- Verify that the attribute options are listed.
- Select value and verify it inserts correctly.
- In an h:message tag, activate content assist for attributes.
- Verify that the attribute for is marked to indicate it is required.\
- Select for and verify it inserts correctly.
Attribute Name Prefix
- In a no-attribute h:outputText tag, add the a v at the beginning of an attribute.
- Activate content assist after the v.
- Verify that only assists for validator, validatorMessage, value, valueChangeListener.
- Select the validator and verify it inserts correctly.
Static Attribute Value Assist
- Starting with the tag, <h:outputText dir=""> activate content assist inside the double-quotes.
- Verify that assists for ltr and rtl are present.
- Select ltr and verify that it inserts correctly.
Dynamic Attribute Value, Non-EL Assist
- 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.
- In login.xhtml, add an h:commandButton.
- Add an action attribute to the commandButton tag.
- In the value for the action attribute, activate content assist.
- Verify that an assist is included: login: goto /welcome.xhtml.
- 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
- Create an h:inputText tag and add a value attribute to it.
- Set the value of the value attribute to "#{}".
- Activate content assist inside the braces.
- Verify that loginBean and all the implicit variables are present
- Scroll in the list to loginBean
- Verify that additionalInfo appears with name, type and scope correctly set.
- Select the loginBean action and verify it is correctly inserted.
Variable Assist, Variable Present
- Start with <h:inputText value="#{p}"/> in an XHTML document.
- After the p in the EL expression, activate content assist.
- Verify that only param and paramValue (the only ones starting with p) are present.
- Verify the correct insertion for paramValue.
Property Assist, No Property
- Add an <h:inputText value="#{loginBean.}"/>.
- Position the cursor after the . and hit Ctrl-Space.
- Verify that name and password and class appear as options.
- Backspace to delete the ..
- Re-enter the . and verify that the same assist options as above appear automatically.
- Select the name property in the list and verify that the additional info provides correct type and assignability.
- Select name and verify it inserts properly.
Property Assist, Existing Property
- Add an <h:inputText value="#{facesContext.r}"/>.
- After the r, press Ctrl-Space.
- Verify that only assists starting with r are present: renderKit, renderResponse, responseComplete, responseStream, responseWriter.
- 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.
- Select the renderKit property and verify it inserts correctly.
Property Assist, Property of Propert
- Starting from the result of the above, Property Assist, Existing Property.
- Activate content assist after renderKit by entering a . character.
- Verify that the assist window opens with class and responseStateManager present.
- Verify additionalInfo on the responseStateManager property as javax.faces.render.ResponseStateManager, read-only.
- Verify that the responseStateManager property inserts correctly.