HTML and CSS Reference
In-Depth Information
<ui:define name="top">
Chapter 11 - JavaScript API Demo
</ui:define>
<ui:define name="content">
<h:outputScript name="events.js" library="js" />
<h:form id="my-name-form-pure-jsf">
<h:outputLink>
<f:ajax render="my-name-display-pure-jsf" execute="my-name-pure-jsf" />
Save name
</h:outputLink>
<h:inputText id="my-name-pure-jsf" value="#{javaScriptApiDemo.myName}" />
<h:panelGroup id="my-name-display-pure-jsf">
Your name is: #{javaScriptApiDemo.myName}
</h:panelGroup>
</h:form>
<!—
Hidden by default. This is only shown when an Ajax
request begins and hidden when a request completes successfully
-->
<h:panelGroup id="in-progress" layout="block" style="display: none;">
<h:panelGroup style="font-weight: bold;">
PLEASE WAIT - THE PAGE IS LOADING
</h:panelGroup>
</h:panelGroup>
</ui:define>
</ui:composition>
</html>
Testing JSF Applications
Any real-world application must have some level of testing. When you develop web applications it is typically not
sufficient to write unit tests that verify the individual classes behind the functionality. You can test the logic behind
your components and beans by using JUnit but that is typically not enough when you have a JSF application. There are
many more aspects to testing a JSF application than just ensuring that the back-end logic is correct. In JSF applications
you have the added complexity of HTTP (client-server interaction), Ajax requests, and web browser differences.
The true test therefore requires a framework that can test a deployed version of the application and initiate a request
(Ajax as well as full HTTP) and test the state of the application after the request. There are many popular functional
testing frameworks available such as Selenium, FitNesse, and Cucumber. These testing frameworks could help us
blackbox testing by verifying that the application behaves as expected on the user side. Ideally, we would like an
integration-testing framework that will allow us to verify the behavior of our application and its components, as they
would behave when they are deployed on the application server. This would allow for more accurate testing.
 
Search WWH ::




Custom Search