TS 65 Facelets

"Test Specification for NetBeans 6.5"

Author: "Michal Vanek"
Version: ""
Last update: "11/20/2008"
Introduction: "This is test specification for Facelets support in Netbeans IDE 6.5"

Contents


Test suite: "Simple Facelet project creation"

Purpose: "Check correct Facelet project creation "
Setup: "Facelets modul installed"

  1. "Facelet Simple project creation with examle facelet files"
    1. "Use File | New Project... to create new Web Application project located in your home directory."
    2. "Choose your own project name and click next"
    3. "If not chosen automatically, choose Glassfish v3 and Java EE5, click next"
    4. "Mark check box for Facelets in a rolling list and click finish"
    5. "Run this project"
    • {{result|EXPECTED RESULT: "New project is created, In web browser appears simple web page with this text:"
Facelets 
Hello from the Facelets client template! 


Test suite: "Project directory structure"

Purpose: "Verify project directory structure"
Setup: "Facelets modul installed"

  1. "Project directory structure"
    1. "Use File | New Project... to create new Web Application project located in your home directory."
    2. "Choose your own project name and click next"
    3. "If not chosen automatically, choose Glassfish v3 and Java EE5, click next"
    4. "Mark check box for Facelets in a rolling list and click finish"
    5. "Enroll project directory structure"
    • EXPECTED RESULT: "Files - template.xhtml, template-client.xhtml and facelet*.jar libraries are present in project directories "
  2. "Faces-Config.xml structure"
    1. "If not created, create new Web Application project with Facelets framework - Simple Facelet project"
    2. "Open faces-config.xml file from Web Pages / WEB-INF/faces-config.xml"
    3. "action n description"
    • EXPECTED RESULT: "Configuration file has given structure"
 <?xml version='1.0' encoding='UTF-8'?>  
<!-- =========== FULL CONFIGURATION FILE ================================== -->  
<faces-config version="1.2"      
xmlns="http://java.sun.com/xml/ns/javaee"      
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"     
 xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">     
 <application>         
<view-handler>             com.sun.facelets.FaceletViewHandler         </view-handler>         
</application>     
</faces-config> 
  1. "Web.xml file structure"
    1. "If not created, create new Web Application project with Facelets framework"
    2. "Open faces-config.xml file from Web Pages / WEB-INF/web.xml"
    3. "action n description"
    • EXPECTED RESULT: "configuration file has given structure"
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
    <context-param>
        <param-name>com.sun.faces.verifyObjects</param-name>
        <param-value>true</param-value>
    </context-param>
    <context-param>
        <param-name>com.sun.faces.validateXml</param-name>
        <param-value>true</param-value>
    </context-param>
    <context-param>
        <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
        <param-value>.xhtml</param-value>
    </context-param>
    <context-param>
        <param-name>facelets.DEVELOPMENT</param-name>
        <param-value>false</param-value>
    </context-param>
    <context-param>
        <param-name>facelets.SKIP_COMMENTS</param-name>
        <param-value>true</param-value>
    </context-param>
    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.jsf</url-pattern>
    </servlet-mapping>
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
    <welcome-file-list>
        <welcome-file>forward.jsp</welcome-file>
        </welcome-file-list>
    </web-app>


Test suite: "Facelet project configuration options"

Purpose: "Check all configuration options for Facelets during project creation"
Setup: "setup description"

  1. "Facelet project creation without example facelet files"
    1. "Use File | New Project... to create new Web Application project located in your home directory."
    2. "Choose your own project name and click next"
    3. "If not chosen automatically, choose Glassfish v3 and Java EE5, click next"
    4. "Mark check box for Facelets in a rolling list"
    5. "Unmark Create Example Facelet Files check box"
    6. "Click finish"
    • EXPECTED RESULT: "New project is created. No Facelet example files are created – template.xhtml and template-client.xhtml are not present in Web Pages folder"
  2. "Facelet project creation including Debug option"
    1. "Use File | New Project... to create new Web Application project located in your home directory. "
    2. "Choose your own project name and click next"
    3. "If not chosen automatically, choose Glassfish v3 and Java EE5, click next"
    4. "Mark check box for Facelets in a rolling list"
    5. "Mark Debug check box"
    6. "Click finish and Run new project"
    • EXPECTED RESULT: "New project is created and functional in web browser. "
  3. "Facelet project creation without including libraries"
    1. "Use File | New Project... to create new Web Application project located in your home directory. "
    2. "Choose your own project name and click next"
    3. "If not chosen automatically, choose Glassfish v3 and Java EE5, click next"
    4. "Mark check box for Facelets in a rolling list"
    5. "In Libraries tab select Do not append any library"
    6. "Click finish and Run new project"
    • EXPECTED RESULT: "Project is not started. Error appears in a browser. Facelets jar libraries are not included in project directory"



Test suite: "Facelet files creation"

Purpose: "Check correct creation of facelet files from IDE"
Setup: "Facelets modul installed"

  1. "Simple Facelet file creation"
    1. "Use File | New Project... to create new Web Application project located in your home directory."
    2. "Choose your own project name and click next"
    3. "If not chosen automatically, choose Glassfish v3 and Java EE5, click next"
    4. "Mark check box for Facelets in a rolling list and click finish"
    5. "Right click project name, choose New | Other | Java Server Faces | choose Facelet Simple File | click Next button and finish"
    • EXPECTED RESULT: "Verify in Web pages directory new XHTML file is created. Verify, new file contains this content."
        
      

<?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets">

<body>             
</body> 

</html>

  1. "Template Facelet file creation"
    1. "Use File | New Project... to create new Web Application project located in your home directory."
    2. "Choose your own project name and click next"
    3. "If not chosen automatically, choose Glassfish v3 and Java EE5, click next"
    4. "Mark check box for Facelets in a rolling list and click finish"
    5. "Right click project name, choose New | Other | Java Server Faces | choose Facelets Template | click next and Finish"
    6. "action 2 description"
    7. "action n description"
    • EXPECTED RESULT: "Verify new file is created in Web pages directory. Verify content of the file.
       
      

<?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"

     xmlns:ui="http://java.sun.com/jsf/facelets">
   
   <head>
       <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
       <link href="./css/default.css" rel="stylesheet" type="text/css" />
       <link href="./css/cssLayout.css" rel="stylesheet" type="text/css" />
       <title>Facelets Template</title>
   </head>
   
   <body>
       
       <div id="top" class="top">
           <ui:insert name="top">Top</ui:insert>
       </div>
       
       <div id="content" class="center_content">
           <ui:insert name="content">Content</ui:insert>
       </div>
       
   </body>
   

</html>

"
  1. "Template facelet client file creation – html"
    1. "Create new Facelet web application if not already created"
    2. "Right click project name, choose New | Other | Java Server Faces | choose Facelet Client File | click next "
    3. "Assing for template.xhtml for Template"
    4. "Choose Generated Root tag: <html> radio button"
    5. "Click finish"
    • EXPECTED RESULT: "New file is created and contains similar content. UI:define tags are the most important/"
       
      

<?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"

     xmlns:ui="http://java.sun.com/jsf/facelets">
   
   <body>
       
       <ui:composition template="./newTemplate.xhtml">
           
           <ui:define name="top">
               top
           </ui:define>
           <ui:define name="left">
               left
           </ui:define>
           <ui:define name="right">
               right
           </ui:define>
           <ui:define name="content">
               content
           </ui:define>
           <ui:define name="bottom">
               bottom
           </ui:define>
       </ui:composition>
       
   </body>

</html>

  1. "Template facelet client file creation – UI"
    1. "Create new Facelet web application if not already created"
    2. "Right click project name, choose New | Other | Java Server Faces | choose Facelet Client File | click next "
    3. "Assing for template.xhtml for Template"
    4. "Choose Generated Root tag: <ui:composition> radio button"
    5. "Click finish"
    6. "action n description"
    • EXPECTED RESULT: "New file is created in Web pages directory and contains similar content. No HTML tags inside.
       
      

<?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ui:composition xmlns="http://www.w3.org/1999/xhtml"

               xmlns:ui="http://java.sun.com/jsf/facelets"
               template="./newTemplate2.xhtml">
   
   <ui:define name="top">
       top
   </ui:define>
   <ui:define name="content">
       content
   </ui:define>

</ui:composition>

"
  1. "UI:composition CSS templates "
    1. "Create new Facelet web application if not already created"
    2. "Run project. Verify, project compiled correctly and appears in a browser"
    3. "Open template-client.xhtml file"
    4. "Right click project name, choose New | Other | Java Server Faces | choose Facelet Template file | click Next button and finish"
    5. "Verify new file is created in Web pages directory"
    6. "Right click project name, choose New | Other | Java Server Faces | choose Facelet Template file | click Next button and choose different CSS Layout Stlyle and click finish"
    7. "Verify new template file is created in Web pages directory"
    8. "In template-clinent.xhtml file change templates names in UI: composition tag - <ui:composition template="/templatename.xhtml">"
    9. "Run project and verify file is displayed with correct layout"
    10. "Reapeat for all CSS Layouts"
    • EXPECTED RESULT: "All CSS templates are working and displayed with correct layout"
  2. "UI:composition TABLE templates "
    1. "Create new Facelet web application if not already created"
    2. "Run project. Verify, project compiled correctly and appears in a browser"
    3. "Open template-client.xhtml file"
    4. "Right click project name, choose New | Other | Java Server Faces | choose Facelet Template file - TABLE layout | click Next button and finish"
    5. "Verify new file is created in Web pages directory"
    6. "Right click project name, choose New | Other | Java Server Faces | choose Facelet Template file | click Next button and choose different TABLE Layout Stlyle and click finish"
    7. "Verify new template file is created in Web pages directory"
    8. "In template-clinent.xhtml file change templates names in UI: composition tag - <ui:composition template="/templatename.xhtml">"
    9. "Run project and verify file is displayed with correct layout"
    10. "Reapeat for all TABLE Layouts"
    • EXPECTED RESULT: "All TABLE templates are working and displayed with correct layout"


Test suite: "Palette Facelets Components Drag and Drop"

Purpose: "purpose description"
Setup: "Facelets modul installed"

  1. "Content of JSF-Facelet Palette"
    1. "Create new Facelet web application if not already created"
    2. "Open file template-client.xhtml in Web pages directory"
    3. "Open Palette tab if not already opened"
    4. "action 1 description"
    • EXPECTED RESULT: "JSF - Facelet components are displayes: component, define, insert, debug, fragment, repeat, decorate, include, param"
  2. "Drag and drop component"
    1. "Drag and drop JSF Facelet component into template-client.xhtml from JSF-Facelets Palette"
    • {{{1}}}
  3. "Drag and drop define"
    1. "Drag and drop JSF Facelet define into template-client.xhtml from JSF-Facelets Palette"
    • {{{1}}}
  4. "Drag and drop insert"
    1. "Drag and drop JSF Facelet insert into template-client.xhtml from JSF-Facelets Palette"
    • {{{1}}}
  5. "Drag and drop debug"
    1. "Drag and drop JSF Facelet debug into template-client.xhtml from JSF-Facelets Palette"
    • {{{1}}}
  6. "Drag and drop fragment"
    1. "Drag and drop JSF Facelet fragment into template-client.xhtml from JSF-Facelets Palette"
    • {{{1}}}
  7. "Drag and drop repeat"
    1. "Drag and drop JSF Facelet repeat into template-client.xhtml from JSF-Facelets Palette"
    • {{{1}}}
  8. "Drag and drop decorate"
    1. "Drag and drop JSF Facelet decorate into template-client.xhtml from JSF-Facelets Palette"
    • {{{1}}}
  9. "Drag and drop include"
    1. "Drag and drop JSF Facelet include into template-client.xhtml from JSF-Facelets Palette"
    • {{{1}}}
  10. "Drag and drop param"
    1. "Drag and drop JSF Facelet param into template-client.xhtml from JSF-Facelets Palette"
    • {{{1}}}


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