Author: amarkhel
Date: 2010-07-13 14:41:20 -0400 (Tue, 13 Jul 2010)
New Revision: 18013
Modified:
root/ui/output/trunk/panels/ui/src/test/java/org/richfaces/renderkit/html/PopupRendererTest.java
root/ui/output/trunk/panels/ui/src/test/resources/panelTest.xhtml
root/ui/output/trunk/panels/ui/src/test/resources/popupPanelText.xhtml
Log:
Modified:
root/ui/output/trunk/panels/ui/src/test/java/org/richfaces/renderkit/html/PopupRendererTest.java
===================================================================
---
root/ui/output/trunk/panels/ui/src/test/java/org/richfaces/renderkit/html/PopupRendererTest.java 2010-07-13
18:37:09 UTC (rev 18012)
+++
root/ui/output/trunk/panels/ui/src/test/java/org/richfaces/renderkit/html/PopupRendererTest.java 2010-07-13
18:41:20 UTC (rev 18013)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.richfaces.renderkit.html;
+package org.richfaces.renderkit;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
@@ -27,6 +27,7 @@
import java.io.File;
import java.io.IOException;
+import java.util.List;
import javax.faces.application.ViewHandler;
import javax.faces.context.FacesContext;
@@ -66,7 +67,7 @@
private FacesRequest startFacesRequest() throws IOException {
FacesRequest facesRequest =
environment.createFacesRequest("http://localhost/popupPanelTest.jsf");
- facesRequest.withViewId("/popupPanelTest.jsf");
+ facesRequest.withViewId("/panelTest.jsf");
facesRequest.start();
FacesContext facesContext = FacesContext.getCurrentInstance();
ViewHandler vh = facesContext.getApplication().getViewHandler();
@@ -80,17 +81,17 @@
*
* @throws IOException
*/
- @Test
+ /* @Test
public final void testGetComponentClass() throws IOException {
- /*FacesRequest facesRequest = startFacesRequest();
+ FacesRequest facesRequest = startFacesRequest();
FacesContext facesContext = FacesContext.getCurrentInstance();
UIPopupPanel component = (UIPopupPanel)
facesContext.getViewRoot().findComponent("panel");
PopupPanelRenderer renderer = (PopupPanelRenderer)
FacesContext.getCurrentInstance()
.getRenderKit().getRenderer(component.getFamily(),
component.getRendererType());
assertEquals(UIPopupPanel.class, renderer.getComponentClass());
- facesRequest.release();*/
+ facesRequest.release();
return ;
- }
+ }*/
/**
* Test method for
@@ -99,61 +100,42 @@
*
* @throws IOException
*/
- /*@Test
+ @Test
public final void testDoEncode() throws IOException {
- HtmlPage page = environment.getPage("/panelTest.jsf");
- HtmlElement panelWithFacet = page.getElementById("panelWithFacet");
- assertEquals("rf-panel panel",
panelWithFacet.getAttribute("class"));
- assertEquals("Write your own custom rich components with built-in AJAX
support",
panelWithFacet.getElementById("panelWithFacet_header").getTextContent().trim());
- assertEquals("The CDK includes",
panelWithFacet.getElementById("panelWithFacet_body")
+ HtmlPage page = environment.getPage("/popupPanelTest.jsf");
+ HtmlElement panelWithFacet = page.getElementById("panel");
+ assertNotNull(panelWithFacet);
+ assertEquals("visibility: hidden;",
panelWithFacet.getAttribute("style"));
+ HtmlElement panelShade = panelWithFacet.getElementById("panel_shade");
+ assertEquals("mp_shade", panelShade.getAttribute("class"));
+ assertNotNull(panelShade);
+ HtmlElement panelShadow =
panelWithFacet.getElementById("panel_shadow");
+ assertEquals("mp_shadow",
panelShadow.getAttribute("class"));
+ assertNotNull(panelShadow);
+ HtmlElement panelContainer =
panelWithFacet.getElementById("panel_container");
+ assertNotNull(panelContainer);
+ assertEquals("mp_container panelStyle",
panelContainer.getAttribute("class"));
+ HtmlElement panelScroller =
panelWithFacet.getElementById("panel_content_scroller");
+ assertNotNull(panelScroller);
+ assertEquals("mp_content_scroller ",
panelScroller.getAttribute("class"));
+ HtmlElement panelContent =
panelWithFacet.getElementById("panel_content");
+ assertNotNull(panelContent);
+ assertEquals("mp_content",
panelContent.getAttribute("class"));
+ assertEquals("The CDK includes", panelContent
.getTextContent().trim().substring(0, 16));
- HtmlElement simplePanel = page.getElementById("simplePanel");
- assertEquals("rf-panel ",
simplePanel.getAttribute("class"));
- try{
- simplePanel.getElementById("simplePanel_header");
- }catch(Exception e){
- assertTrue(true);
- }
- assertEquals("RichFaces is a l", simplePanel
- .getElementById("simplePanel_body")
- .getTextContent().trim().substring(0, 16));
- HtmlElement simplePanelBody = page.getElementById("simplePanel_body");
- assertEquals("rf-panel-body rich-laguna-panel-no-header",
simplePanelBody.getAttribute("class"));
- HtmlElement simplePanel2 =
page.getElementById("simplePanelWithTextHeader");
- assertEquals("rf-panel ",
simplePanel2.getAttribute("class"));
-
assertNotNull(simplePanel2.getElementById("simplePanelWithTextHeader_header"));
- assertEquals("rich-laguna-panel-no-header",
simplePanel2.getElementById("simplePanelWithTextHeader_header").getTextContent().trim());
- assertEquals("RichFaces is a l", simplePanel2
- .getElementById("simplePanelWithTextHeader_body")
- .getTextContent().trim().substring(0, 16));
-
- HtmlElement nestedPanelContainer =
page.getElementById("nestedPanelContainer");
- assertEquals("rf-panel ",
nestedPanelContainer.getAttribute("class"));
-
assertNotNull(nestedPanelContainer.getElementById("nestedPanelContainer_header"));
- assertEquals("||||",
nestedPanelContainer.getElementById("nestedPanelContainer_header").getTextContent().trim());
- HtmlElement nestedPanelContainerHeader =
page.getElementById("nestedPanelContainer_header");
- assertEquals("rf-panel-header outpanelHeader",
nestedPanelContainerHeader.getAttribute("class"));
- assertEquals("Benefits of Usin", nestedPanelContainer
- .getElementById("nestedPanelContainer_body")
- .getTextContent().trim().substring(0, 16));
- HtmlElement nestedPanel1 =
nestedPanelContainer.getElementById("nestedPanel1");
- assertEquals("rf-panel ",
nestedPanel1.getAttribute("class"));
- HtmlElement nestedPanel1Body =
page.getElementById("nestedPanel1_body");
- assertEquals("rf-panel-body inpanelBody",
nestedPanel1Body.getAttribute("class"));
- assertNotNull(nestedPanel1.getElementById("nestedPanel1_header"));
- assertEquals("For Application Developers",
nestedPanel1.getElementById("nestedPanel1_header").getTextContent().trim());
- assertEquals("Production quali", nestedPanel1
- .getElementById("nestedPanel1_body")
- .getTextContent().trim().substring(0, 16));
- HtmlElement nestedPanel2 =
nestedPanelContainer.getElementById("nestedPanel2");
- assertEquals("rf-panel ",
nestedPanel2.getAttribute("class"));
- HtmlElement nestedPanel2Body =
page.getElementById("nestedPanel2_body");
- assertEquals("rf-panel-body inpanelBody",
nestedPanel2Body.getAttribute("class"));
- assertNotNull(nestedPanel2.getElementById("nestedPanel2_header"));
- assertEquals("For Component Developers",
nestedPanel2.getElementById("nestedPanel2_header").getTextContent().trim());
- assertEquals("Ajax4jsf is Open", nestedPanel2
- .getElementById("nestedPanel2_body")
- .getTextContent().trim().substring(0, 16));
- }*/
+ HtmlElement panelHeader =
panelWithFacet.getElementById("panel_header");
+ assertNotNull(panelHeader);
+ assertEquals("mp_header header",
panelHeader.getAttribute("class"));
+ assertEquals("cursor: move;",
panelHeader.getAttribute("style"));
+ assertEquals("Write your own custom rich components with built-in
AJAX\n\t\t\tModal", panelHeader.getTextContent().trim());
+ HtmlElement panelHeaderControls =
panelWithFacet.getElementById("panel_header_controls");
+ assertNotNull(panelHeaderControls);
+ assertEquals("mp_header_controls control",
panelHeaderControls.getAttribute("class"));
+ HtmlElement panelResizer =
panelWithFacet.getElementById("panelResizerN");
+ assertNotNull(panelResizer);
+ assertEquals("mp_handler mp_handler_top",
panelResizer.getAttribute("class"));
+ assertEquals("cursor: N-resize;",
panelResizer.getAttribute("style"));
+ List<HtmlElement> result = page.getElementsByName("script");
+ }
}
\ No newline at end of file
Modified: root/ui/output/trunk/panels/ui/src/test/resources/panelTest.xhtml
===================================================================
--- root/ui/output/trunk/panels/ui/src/test/resources/panelTest.xhtml 2010-07-13 18:37:09
UTC (rev 18012)
+++ root/ui/output/trunk/panels/ui/src/test/resources/panelTest.xhtml 2010-07-13 18:41:20
UTC (rev 18013)
@@ -7,54 +7,92 @@
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:panel="http://richfaces.org/panels"
xmlns:rich="http://richfaces.org/rich">
+<!--
+JBoss, Home of Professional Open Source
+Copyright ${year}, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+-->
<h:head>
<title>Richfaces ExtendedDataTable Test</title>
</h:head>
<h:body>
- <panel:popupPanel domElementAttachment="body"
- visualOptions="{left:400px;}" moveable="true"
- overlapEmbedObjects="true" keepVisualState="true"
- onmaskclick="alert('1')" width="600"
height="400" id="panel"
- left="500px" top="300px">
- <f:facet name="header">
- Write your own custom rich components with built-in AJAX
- </f:facet>
- <h:form>
- <h:panelGroup layout="block"
- style="width:500px,height:400px;">
- The CDK includes a code-generation facility and a
- templating facility using a JSP-like syntax. These
- capabilities help to avoid a routine process of a
- component creation. The component factory works like
- a well-oiled machine allowing the creation of
- first-class rich components with built-in Ajax
- functionality even more easily than the creation of
- simpler components by means of the traditional
- coding approach.
-
-
- <h:inputText value="aaa" />
- <a href="#"
- onclick="RichFaces.$('panel').setSize(500, 300)"
tabindex="0">
- setSize
- </a>
- <a href="#"
- onclick="RichFaces.$('panel').resize(20, 50)"
tabindex="0">
- resize
- </a>
- <a href="#"
- onclick="RichFaces.$('panel').move(20, 50)"
tabindex="0">
- move
- </a>
-
- <a href="#"
- onclick="RichFaces.$('panel').moveTo(20, 50)"
tabindex="0">
- moveTo
- </a>
- </h:panelGroup>
- </h:form>
- </panel:popupPanel>
+ <panel:panel styleClass="panel" id="panelWithFacet">
+ <f:facet name="header">
+ Write your own custom rich components with built-in AJAX support
+ </f:facet>
+ The CDK includes a code-generation facility and a
+ templating facility using a JSP-like syntax. These capabilities help
+ to avoid a routine process of a component creation. The component factory
+ works like a well-oiled machine allowing the creation of first-class
+ rich components with built-in Ajax functionality even more easily than
+ the creation of simpler components by means of the traditional coding
+ approach.
+ </panel:panel>
+ <panel:panel id="simplePanel"
bodyClass="rich-laguna-panel-no-header">
+ RichFaces is a library for adding rich user interface features to JSF
+ applications. It extends the Ajax4jsf framework to include a large
+ (and growing) set of powerful rich AJAX-enabled components that come
+ with extensive skins support.
+ </panel:panel>
+ <panel:panel id="simplePanelWithTextHeader"
header="rich-laguna-panel-no-header">
+ RichFaces is a library for adding rich user interface features to JSF
+ applications. It extends the Ajax4jsf framework to include a large
+ (and growing) set of powerful rich AJAX-enabled components that come
+ with extensive skins support.
+ </panel:panel>
+ <panel:panel id="nestedPanelContainer" style="padding:0"
headerClass="outpanelHeader">
+ <f:facet name="header">
+ ||||
+ </f:facet>
+ <h2 align="center"><h:outputText value="Benefits of Using
Ajax4jsf" /></h2>
+ <h:panelGrid columns="2" columnClasses="gridContent">
+ <panel:panel id="nestedPanel1"
bodyClass="inpanelBody">
+ <f:facet name="header">
+ For Application Developers
+ </f:facet>
+ <ul>
+ <li>Production quality Open Source</li>
+ <li>Does Open Source and has an Open Architecture</li>
+ <li>Compatible with any JSF Implementation - MyFaces, JSF1.1,
JSF1.2</li>
+ <li>Allows to Ajaxify JSF application without writing
Javascript</li>
+ <li>Works with standard and third party components</li>
+ <li>Adds the Ajax capability to existing non-Ajax
components</li>
+ </ul>
+ </panel:panel>
+ <panel:panel id="nestedPanel2"
bodyClass="inpanelBody">
+ <f:facet name="header" >
+ For Component Developers
+ </f:facet>
+ <ul>
+ <li>Ajax4jsf is Open Source and has an Open
Architecture</li>
+ <li>Gives an API to create components with built-in Ajax
support</li>
+ <li>Has a Component Development Kit for rapid
development</li>
+ <li>Allows to skin the look-n-feel using both CSS and set of
skin-parameters</li>
+ <li>Automatically generates the unit test-cases for developing
components</li>
+ <li>Allows to pack javascript code, images, css inside the
final jar</li>
+ </ul>
+ </panel:panel>
+ </h:panelGrid>
+ </panel:panel>
</h:body>
</html>
Modified: root/ui/output/trunk/panels/ui/src/test/resources/popupPanelText.xhtml
===================================================================
--- root/ui/output/trunk/panels/ui/src/test/resources/popupPanelText.xhtml 2010-07-13
18:37:09 UTC (rev 18012)
+++ root/ui/output/trunk/panels/ui/src/test/resources/popupPanelText.xhtml 2010-07-13
18:41:20 UTC (rev 18013)
@@ -1,3 +1,5 @@
+<?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:fn="http://java.sun.com/jsp/jstl/functions"
xmlns:h="http://java.sun.com/jsf/html"
@@ -3,5 +5,4 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
-
xmlns:panel="http://richfaces.org/panels"
xmlns:rich="http://richfaces.org/rich">
@@ -11,14 +12,17 @@
</h:head>
<h:body>
- <panel:popupPanel domElementAttachment="body"
- visualOptions="{left:400px;}" moveable="true"
- overlapEmbedObjects="true" keepVisualState="true"
- onmaskclick="alert('1')" width="600"
height="400" id="panel"
- left="500px" top="300px">
+ <rich:popupPanel styleClass="panelStyle" headerClass="header"
controlsClass="control"
+
+
+ id="panel"
+ >
<f:facet name="header">
Write your own custom rich components with built-in AJAX
</f:facet>
+ <f:facet name="controls">
+ <h:outputText value="Modal" />
+ </f:facet>
<h:form>
<h:panelGroup layout="block"
style="width:500px,height:400px;">
@@ -53,6 +57,6 @@
</a>
</h:panelGroup>
</h:form>
- </panel:popupPanel>
+ </rich:popupPanel>
</h:body>
</html>