JBoss Rich Faces SVN: r11430 - in trunk/test-applications/seleniumTest/richfaces/src: main/webapp/layout and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-11-28 06:36:24 -0500 (Fri, 28 Nov 2008)
New Revision: 11430
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dnd/dndAutoTest.xhtml
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/autotest/bean/AutoTestBean.java
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/layout/layout.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dnd/dndTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DnDTest.java
Log:
Drag&Drop Test
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/autotest/bean/AutoTestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/autotest/bean/AutoTestBean.java 2008-11-28 11:25:08 UTC (rev 11429)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/autotest/bean/AutoTestBean.java 2008-11-28 11:36:24 UTC (rev 11430)
@@ -11,9 +11,11 @@
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
+import javax.faces.event.FacesEvent;
import javax.faces.event.ValueChangeEvent;
import org.ajax4jsf.javascript.ScriptUtils;
+import org.richfaces.event.DropEvent;
import org.richfaces.event.NodeExpandedEvent;
import org.richfaces.event.NodeSelectedEvent;
@@ -70,7 +72,12 @@
public void actionListener(ActionEvent event) {
setStatus(getStatus() + ACTION_LISTENER_STATUS);
}
-
+
+ public void actionListener(DropEvent event) {
+ setStatus(getStatus() + ACTION_LISTENER_STATUS);
+ }
+
+
public void valueChangeListener(ValueChangeEvent event) {
setStatus(getStatus() + VALUE_CHANGE_LISTENER_STATUS);
}
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/layout/layout.xhtml
===================================================================
(Binary files differ)
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dnd/dndAutoTest.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dnd/dndAutoTest.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dnd/dndAutoTest.xhtml 2008-11-28 11:36:24 UTC (rev 11430)
@@ -0,0 +1,39 @@
+<!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:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+
+<ui:composition template="#{templateBean.autoTestTemplate}">
+ <ui:define name="component">
+ <h:outputLink id="drag">
+ <h:outputText value="Draggable" />
+ <rich:dragSupport
+ dragType="#{dndBean.frameworks[0].family}"
+ limitToList="#{autoTestBean.limitToList}"
+ bypassUpdates="#{autoTestBean.bypassUpdate}"
+ dragValue="#{dndBean.frameworks[0]}">
+
+ <rich:dndParam name="label" value="Draggable" />
+ </rich:dragSupport>
+ </h:outputLink>
+ <rich:panel id="PHP">
+ <rich:dropSupport id="componentId" acceptedTypes="PHP" dropValue="PHP"
+ dropListener="#{autoTestBean.actionListener}"
+ immediate="#{autoTestBean.immediate}"
+ ajaxSingle="#{autoTestBean.ajaxSingle}"
+ reRender="#{autoTestBean.reRender}"
+ limitToList="#{autoTestBean.limitToList}"
+ bypassUpdates="#{autoTestBean.bypassUpdate}"
+ rendered="#{autoTestBean.rendered}"
+ oncomplete="#{autoTestBean.oncomplete}"
+ >
+ <f:param name="parameter1" value="value1" />
+ <f:param name="parameter2" value="value2" />
+ </rich:dropSupport>
+ </rich:panel>
+ </ui:define>
+</ui:composition>
+</html>
\ No newline at end of file
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dnd/dndTest.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-11-28 11:25:08 UTC (rev 11429)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-11-28 11:36:24 UTC (rev 11430)
@@ -431,6 +431,7 @@
*/
public void waitForPageToLoad() {
selenium.waitForPageToLoad(String.valueOf(pageRenderTime));
+ selenium.waitForCondition(WINDOW_JS_RESOLVER + "loaded = true;", String.valueOf(pageRenderTime));
}
/**
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DnDTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DnDTest.java 2008-11-28 11:25:08 UTC (rev 11429)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DnDTest.java 2008-11-28 11:36:24 UTC (rev 11430)
@@ -1,14 +1,19 @@
package org.richfaces.testng;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import org.ajax4jsf.bean.DnDBean;
import org.ajax4jsf.template.Template;
+import org.richfaces.AutoTester;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
import org.testng.annotations.Test;
+import com.thoughtworks.selenium.SeleniumException;
+
public class DnDTest extends SeleniumTestBase {
static final String RESET_METHOD = "#{dndBean.reset}";
@@ -16,6 +21,12 @@
static final String FORMID = "_form:";
static final String DATAID = "src:";
+ static final Map<String, String> parameters = new HashMap<String, String>();
+ static {
+ parameters.put("parameter1", "value1");
+ parameters.put("parameter2", "value2");
+ }
+
String statusId;
String dragValueId;
String dropValueId;
@@ -41,7 +52,7 @@
return "c:/FFProfile";
}
- @Test
+ @Test
public void testDragValue(Template template) {
renderPage(template, RESET_METHOD);
initIds(getParentId());
@@ -91,7 +102,7 @@
}
- @Test
+ @Test
public void testEvents(Template template) {
renderPage(template, RESET_METHOD);
initIds(getParentId());
@@ -107,11 +118,83 @@
assertEvents(eventsExpected);
}
+
+ @Test
+ public void testListenersIfTypeNotAccepted(Template template) {
+ renderPage(template, RESET_METHOD);
+ initIds(getParentId());
+
+ boolean exception = false;
+
+ try {
+ DragAndDrop(0, cfDropZoneId);
+ }catch (SeleniumException e) {
+ exception = true;
+ }
+
+ if (!exception) {
+ Assert.fail("Drop on not accepted zone should not force ajax request");
+ }
+
+ assertListeners();
+ }
+
+ @Test
+ public void testEventsIfTypeNotAccepted(Template template) {
+ renderPage(template, RESET_METHOD);
+ initIds(getParentId());
+
+ _DragAndDrop(0, cfDropZoneId);
+ List<String> eventsExpected = new ArrayList<String>();
+
+ eventsExpected.add("ondragstart");
+ eventsExpected.add("ondragenter");
+ eventsExpected.add("ondragend");
+ eventsExpected.add("ondropend");
+
+ assertEvents(eventsExpected);
+ }
+
+ @Test
+ public void testNestedParameters(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, RESET_METHOD);
+
+ tester.testRequestParameters(parameters);
+ }
+
+ @Test
+ public void testByPassUpdate(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, RESET_METHOD);
+
+ tester.testBypassUpdate();
+ }
+
+ @Test
+ public void testReRender(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, RESET_METHOD);
+
+ tester.testReRender();
+ }
+
+ @Test
+ public void testLimit2List(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, RESET_METHOD);
+
+ tester.testLimitToList();
+ }
void DragAndDrop(int itemNumber, String dropZoneId) {
- selenium.dragAndDropToObject("id=" + itemsHolderId + itemNumber + ":item", "id=" + dropZoneId + "_body");
+ _DragAndDrop(itemNumber, dropZoneId);
waitForAjaxCompletion();
}
+
+ void _DragAndDrop(int itemNumber, String dropZoneId) {
+ selenium.dragAndDropToObject("id=" + itemsHolderId + itemNumber + ":item", "id=" + dropZoneId + "_body");
+ }
void testDropData () {
String dragData = runScript("window._dropData");
@@ -164,4 +247,17 @@
public String getTestUrl() {
return "pages/dnd/dndTest.xhtml";
}
+
+ @Override
+ public String getAutoTestUrl() {
+ return "pages/dnd/dndAutoTest.xhtml";
+ }
+
+ @Override
+ public void sendAjax() {
+ String dragId = getParentId() + "autoTestForm:drag";
+ String dropId = getParentId() + "autoTestForm:PHP";
+ selenium.dragAndDropToObject(dragId, dropId);
+ waitForAjaxCompletion();
+ }
}
\ No newline at end of file
16 years
JBoss Rich Faces SVN: r11429 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: cluts
Date: 2008-11-28 06:25:08 -0500 (Fri, 28 Nov 2008)
New Revision: 11429
Added:
trunk/docs/userguide/en/src/main/docbook/included/queue.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/queue.xml
Log:
RF-4664 - component description, the "Creating on a page" and "Creating the Component Dynamically Using Java" sections with the necessary information have been added.
Added: trunk/docs/userguide/en/src/main/docbook/included/queue.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/queue.desc.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/queue.desc.xml 2008-11-28 11:25:08 UTC (rev 11429)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter>
+ <section>
+ <sectioninfo>
+ <keywordset>
+ <keyword>a4j:queue</keyword>
+ </keywordset>
+ </sectioninfo>
+ <title>Description</title>
+ <para>The <emphasis role="bold"><property><a4j:queue></property></emphasis> component creates queues that other components can reference and use.</para>
+ </section>
+</chapter>
\ No newline at end of file
Added: trunk/docs/userguide/en/src/main/docbook/included/queue.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/queue.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/queue.xml 2008-11-28 11:25:08 UTC (rev 11429)
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter>
+ <chapterinfo>
+ <keywordset>
+ <keyword>a4j:queue</keyword>
+ </keywordset>
+ </chapterinfo>
+ <table>
+ <title>Component identification parameters </title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Value</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>component-family</entry>
+ <entry>org.ajax4jsf.Queue</entry>
+ </row>
+ <row>
+ <entry>component-class</entry>
+ <entry>org.ajax4jsf.component.html.HtmlQueue</entry>
+ </row>
+ <row>
+ <entry>renderer-type</entry>
+ <entry>org.ajax4jsf.QueueRenderer</entry>
+ </row>
+ <row>
+ <entry>tag-class</entry>
+ <entry>org.ajax4jsf.taglib.html.jsp.QueueTag</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <section>
+ <title>Creating on a page</title>
+ <para>Here is the simplest way for a component creation on a page.</para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[<h:form>
+ <a4j:queue name="fooQueue" ... />
+</h:form>
+]]></programlisting>
+ </section>
+ <section>
+ <title>Creating the Component Dynamically Using Java</title>
+ <para>
+ <emphasis role="bold">
+ Example:
+ </emphasis>
+ </para>
+ <programlisting role="JAVA"><![CDATA[import org.ajax4jsf.component.html.HtmlQueue;
+...
+HtmlQueue myQueue = new HtmlQueue();
+...]]></programlisting>
+ </section>
+
+ <section>
+ <title>Key attributes and ways of usage</title>
+
+ </section>
+
+ <section>
+ <title>Relevant resources links</title>
+ <para>
+ <ulink
+ url="http://livedemo.exadel.com/richfaces-demo/richfaces/queue.jsf?c=queue"
+ >Here</ulink> you can see the example of <emphasis
+ role="bold">
+ <property><a4j:queue></property>
+ </emphasis> usage and sources for the given example. </para>
+ </section>
+</chapter>
\ No newline at end of file
16 years
JBoss Rich Faces SVN: r11428 - in trunk/test-applications/facelets/src/main: webapp/Editor and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: adubovsky
Date: 2008-11-28 06:10:48 -0500 (Fri, 28 Nov 2008)
New Revision: 11428
Modified:
trunk/test-applications/facelets/src/main/resources/editorconfig.properties
trunk/test-applications/facelets/src/main/webapp/Editor/Editor.xhtml
Log:
+ media plugin to editor
Modified: trunk/test-applications/facelets/src/main/resources/editorconfig.properties
===================================================================
--- trunk/test-applications/facelets/src/main/resources/editorconfig.properties 2008-11-28 11:02:38 UTC (rev 11427)
+++ trunk/test-applications/facelets/src/main/resources/editorconfig.properties 2008-11-28 11:10:48 UTC (rev 11428)
@@ -1,3 +1,3 @@
-theme_advanced_buttons1 = "forecolor,backcolor"
+theme_advanced_buttons1 = "media,forecolor,backcolor"
theme_advanced_buttons2 = "bullist,numlist,separator,outdent,indent,separator,undo,redo"
-theme_advanced_buttons3 = "hr,removeformat,visualaid,separator,sub,sup,separator,charmap"
\ No newline at end of file
+theme_advanced_buttons3 ="hr,removeformat,visualaid,separator,sub,sup,separator,charmap"
\ No newline at end of file
Modified: trunk/test-applications/facelets/src/main/webapp/Editor/Editor.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/Editor/Editor.xhtml 2008-11-28 11:02:38 UTC (rev 11427)
+++ trunk/test-applications/facelets/src/main/webapp/Editor/Editor.xhtml 2008-11-28 11:10:48 UTC (rev 11428)
@@ -19,7 +19,8 @@
valueChangeListener="#{editor.valueChangeListener}"
viewMode="#{editor.viewMode}" readonly="#{editor.readonly}"
tabindex="#{editor.tabindex}" dialogType="#{editor.dialogType}"
- language="#{editor.language}" styleClass="EditorStyleClass" >
+ language="#{editor.language}" styleClass="EditorStyleClass"
+ plugins="media">
<f:param name="theme_advanced_resizing" value="true" />
<f:param name="theme_advanced_statusbar_location" value="top" />
16 years
JBoss Rich Faces SVN: r11427 - in trunk/test-applications/seamApp/web/src/main: webapp/Editor and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: adubovsky
Date: 2008-11-28 06:02:38 -0500 (Fri, 28 Nov 2008)
New Revision: 11427
Modified:
trunk/test-applications/seamApp/web/src/main/resources/editorconfig.properties
trunk/test-applications/seamApp/web/src/main/webapp/Editor/Editor.xhtml
Log:
+ media plugin to editor
Modified: trunk/test-applications/seamApp/web/src/main/resources/editorconfig.properties
===================================================================
--- trunk/test-applications/seamApp/web/src/main/resources/editorconfig.properties 2008-11-28 10:55:20 UTC (rev 11426)
+++ trunk/test-applications/seamApp/web/src/main/resources/editorconfig.properties 2008-11-28 11:02:38 UTC (rev 11427)
@@ -1,3 +1,3 @@
-theme_advanced_buttons1 = "forecolor,backcolor"
+theme_advanced_buttons1 = "media,forecolor,backcolor"
theme_advanced_buttons2 = "bullist,numlist,separator,outdent,indent,separator,undo,redo"
-theme_advanced_buttons3 = "hr,removeformat,visualaid,separator,sub,sup,separator,charmap"
\ No newline at end of file
+theme_advanced_buttons3 ="hr,removeformat,visualaid,separator,sub,sup,separator,charmap"
\ No newline at end of file
Modified: trunk/test-applications/seamApp/web/src/main/webapp/Editor/Editor.xhtml
===================================================================
--- trunk/test-applications/seamApp/web/src/main/webapp/Editor/Editor.xhtml 2008-11-28 10:55:20 UTC (rev 11426)
+++ trunk/test-applications/seamApp/web/src/main/webapp/Editor/Editor.xhtml 2008-11-28 11:02:38 UTC (rev 11427)
@@ -18,7 +18,8 @@
valueChangeListener="#{editor.valueChangeListener}"
viewMode="#{editor.viewMode}" readonly="#{editor.readonly}"
tabindex="#{editor.tabindex}" dialogType="#{editor.dialogType}"
- language="#{editor.language}" styleClass="EditorStyleClass">
+ language="#{editor.language}" styleClass="EditorStyleClass"
+ plugins="media">
<f:param name="theme_advanced_resizing" value="true" />
<f:param name="theme_advanced_statusbar_location" value="top" />
16 years
JBoss Rich Faces SVN: r11426 - in trunk/test-applications/jsp/src/main: webapp/Editor and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: adubovsky
Date: 2008-11-28 05:55:20 -0500 (Fri, 28 Nov 2008)
New Revision: 11426
Modified:
trunk/test-applications/jsp/src/main/resources/editorconfig.properties
trunk/test-applications/jsp/src/main/webapp/Editor/Editor.jsp
Log:
+ media plugin to editor
Modified: trunk/test-applications/jsp/src/main/resources/editorconfig.properties
===================================================================
--- trunk/test-applications/jsp/src/main/resources/editorconfig.properties 2008-11-28 10:55:19 UTC (rev 11425)
+++ trunk/test-applications/jsp/src/main/resources/editorconfig.properties 2008-11-28 10:55:20 UTC (rev 11426)
@@ -1,3 +1,3 @@
-theme_advanced_buttons1 = "forecolor,backcolor"
+theme_advanced_buttons1 = "media,forecolor,backcolor"
theme_advanced_buttons2 = "bullist,numlist,separator,outdent,indent,separator,undo,redo"
theme_advanced_buttons3 = "hr,removeformat,visualaid,separator,sub,sup,separator,charmap"
\ No newline at end of file
Modified: trunk/test-applications/jsp/src/main/webapp/Editor/Editor.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/Editor/Editor.jsp 2008-11-28 10:55:19 UTC (rev 11425)
+++ trunk/test-applications/jsp/src/main/webapp/Editor/Editor.jsp 2008-11-28 10:55:20 UTC (rev 11426)
@@ -19,7 +19,8 @@
valueChangeListener="#{editor.valueChangeListener}"
viewMode="#{editor.viewMode}" readonly="#{editor.readonly}"
tabindex="#{editor.tabindex}" dialogType="#{editor.dialogType}"
- language="#{editor.language}" styleClass="EditorStyleClass" >
+ language="#{editor.language}" styleClass="EditorStyleClass"
+ plugins="media">
<f:param name="theme_advanced_resizing" value="true" />
<f:param name="theme_advanced_statusbar_location" value="top" />
16 years
JBoss Rich Faces SVN: r11425 - in trunk/ui/combobox/src/test/java/org/richfaces: renderkit and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-11-28 05:55:19 -0500 (Fri, 28 Nov 2008)
New Revision: 11425
Modified:
trunk/ui/combobox/src/test/java/org/richfaces/component/ComboBoxComponentTest.java
trunk/ui/combobox/src/test/java/org/richfaces/renderkit/ComboBoxRendererTest.java
Log:
clear
Modified: trunk/ui/combobox/src/test/java/org/richfaces/component/ComboBoxComponentTest.java
===================================================================
--- trunk/ui/combobox/src/test/java/org/richfaces/component/ComboBoxComponentTest.java 2008-11-28 10:54:49 UTC (rev 11424)
+++ trunk/ui/combobox/src/test/java/org/richfaces/component/ComboBoxComponentTest.java 2008-11-28 10:55:19 UTC (rev 11425)
@@ -39,17 +39,22 @@
import org.richfaces.component.UIComboBox;
import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import com.gargoylesoftware.htmlunit.html.HtmlLink;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import com.gargoylesoftware.htmlunit.html.HtmlScript;
+/**
+ * @author Anton Belevich
+ *
+ */
public class ComboBoxComponentTest extends AbstractAjax4JsfTestCase {
UIComboBox comboBox;
UIForm form;
String suggestions = "Alabama,Alaska,Arizona,Arkansas,California,Colorado,Connecticut,Delaware,Florida,Massachusetts,Michigan,Georgia,Hawaii,Idaho,Indiana,Iowa,Kansas,Kentucky,Louisiana,Maine,Minnesota,Mississippi,Missouri,Montana,Nebraska";
- List selectItems = new ArrayList();
+ List <SelectItem >selectItems = new ArrayList<SelectItem>();
- private static Set javaScripts = new HashSet();
+ private static Set <String> javaScripts = new HashSet <String>();
static {
javaScripts.add("org.ajax4jsf.javascript.PrototypeScript");
@@ -114,7 +119,7 @@
public void testComboBoxStyles() throws Exception {
HtmlPage page = renderView();
assertNotNull(page);
- List links = page.getDocumentElement().getHtmlElementsByTagName("link");
+ List <HtmlLink> links = page.getDocumentHtmlElement().getHtmlElementsByTagName("link");
if (links.size() == 0) {
fail();
}
@@ -128,13 +133,13 @@
HtmlPage page = renderView();
assertNotNull(page);
- List scripts = page.getDocumentElement().getHtmlElementsByTagName("script");
- for (Iterator it = scripts.iterator(); it.hasNext();) {
- HtmlScript item = (HtmlScript) it.next();
+ List <HtmlScript> scripts = page.getDocumentHtmlElement().getHtmlElementsByTagName("script");
+ for (Iterator <HtmlScript> it = scripts.iterator(); it.hasNext();) {
+ HtmlScript item = it.next();
String srcAttr = item.getSrcAttribute();
if (StringUtils.isNotBlank(srcAttr)) {
boolean found = false;
- for (Iterator srcIt = javaScripts.iterator(); srcIt.hasNext();) {
+ for (Iterator <String> srcIt = javaScripts.iterator(); srcIt.hasNext();) {
String src = (String) srcIt.next();
found = srcAttr.contains(src);
if (found) {
@@ -147,7 +152,6 @@
}
public void tearDown() throws Exception {
- // TODO Auto-generated method stub
form = null;
comboBox = null;
super.tearDown();
Modified: trunk/ui/combobox/src/test/java/org/richfaces/renderkit/ComboBoxRendererTest.java
===================================================================
--- trunk/ui/combobox/src/test/java/org/richfaces/renderkit/ComboBoxRendererTest.java 2008-11-28 10:54:49 UTC (rev 11424)
+++ trunk/ui/combobox/src/test/java/org/richfaces/renderkit/ComboBoxRendererTest.java 2008-11-28 10:55:19 UTC (rev 11425)
@@ -25,7 +25,6 @@
import java.util.Iterator;
import java.util.List;
-import javax.faces.component.UIComponent;
import javax.faces.component.UISelectItem;
import javax.faces.model.SelectItem;
@@ -43,15 +42,13 @@
*/
public class ComboBoxRendererTest extends AbstractAjax4JsfTestCase {
- private UIComponent form;
private UIComboBox comboBox1;
private UIComboBox comboBox2;
String suggestions = "Alabama,Alaska,Arizona,Arkansas,California,Colorado,Connecticut,Delaware,Florida,Massachusetts,Michigan,Georgia,Hawaii,Idaho,Indiana,Iowa,Kansas,Kentucky,Louisiana,Maine,Minnesota,Mississippi,Missouri,Montana,Nebraska";
- List selectItems = new ArrayList();
+ List <SelectItem> selectItems = new ArrayList <SelectItem>();
public void setUp() throws Exception {
super.setUp();
-
comboBox1 = (UIComboBox) application.createComponent("org.richfaces.ComboBox");
comboBox1.setSuggestionValues(Arrays.asList(suggestions.split(",")));
selectItems.add(new SelectItem("District of Columbia"));
16 years
JBoss Rich Faces SVN: r11424 - trunk/ui/inplaceSelect/src/main/templates.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-11-28 05:54:49 -0500 (Fri, 28 Nov 2008)
New Revision: 11424
Modified:
trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx
Log:
bring list mockup id's accord to common usage
Modified: trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx
===================================================================
--- trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx 2008-11-28 10:51:27 UTC (rev 11423)
+++ trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx 2008-11-28 10:54:49 UTC (rev 11424)
@@ -170,10 +170,10 @@
]]>
</jsp:scriptlet>
</div>
- <div id="listParent#{clientId}" class="rich-inplace-select-width-list" style="display: none; position : absolute; height : 100px; left : 0px; top: 13px; z-index:1000;">
+ <div id="#{clientId}listParent" class="rich-inplace-select-width-list" style="display: none; position : absolute; height : 100px; left : 0px; top: 13px; z-index:1000;">
<div class="rich-inplace-select-list-shadow">
<!-- TODO welcome magic numbers! -->
- <table id="shadow#{clientId}" cellpadding="0" cellspacing="0" border="0" width="257" height="109">
+ <table id="#{clientId}shadow" cellpadding="0" cellspacing="0" border="0" width="257" height="109">
<tr>
<td class="rich-inplace-select-shadow-tl">
<img src="#{spacer}" width="10" height="1" alt=" " style="border:0"/><br/>
@@ -192,9 +192,9 @@
</tr>
</table>
</div>
- <div id="listPosition#{clientId}" class="rich-inplace-select-list-position">
- <div id="listDecoration#{clientId}" class="rich-inplace-select-list-decoration">
- <div id="list#{clientId}" class="rich-inplace-select-list-scroll">
+ <div id="#{clientId}listPosition" class="rich-inplace-select-list-position">
+ <div id="#{clientId}listDecoration" class="rich-inplace-select-list-decoration">
+ <div id="#{clientId}list" class="rich-inplace-select-list-scroll">
<c:object type="java.util.List" var="items" value="#{this:encodeItems(context,component)}">
</c:object>
</div>
@@ -217,9 +217,9 @@
}
};
- new Richfaces.InplaceSelect(new Richfaces.InplaceSelectList('list#{clientId}', 'listParent#{clientId}', true,
+ new Richfaces.InplaceSelect(new Richfaces.InplaceSelectList('#{clientId}list', '#{clientId}listParent', true,
inplaceSelectUserStyles.combolist, Richfaces.InplaceSelect.classes.combolist, '#{component.attributes["listWidth"]}', '#{component.attributes["listHeight"]}', #{this:getItemsTextAsJSArray(context, component,items)}, null,
- '#{clientId}inplaceTmpValue', 'shadow#{clientId}', 0, 0, #{encodedFieldValue}),
+ '#{clientId}inplaceTmpValue', '#{clientId}shadow', 0, 0, #{encodedFieldValue}),
'#{clientId}', '#{clientId}inplaceTmpValue',
'#{clientId}inplaceValue', '#{clientId}tabber',
{defaultLabel : '#{component.attributes["defaultLabel"]}',
16 years
JBoss Rich Faces SVN: r11423 - in trunk/ui/inplaceSelect/src/test/java/org/richfaces: renderkit and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-11-28 05:51:27 -0500 (Fri, 28 Nov 2008)
New Revision: 11423
Modified:
trunk/ui/inplaceSelect/src/test/java/org/richfaces/component/InplaceSelectComponentTest.java
trunk/ui/inplaceSelect/src/test/java/org/richfaces/renderkit/InplaceSelectRenderTest.java
Log:
extend test
Modified: trunk/ui/inplaceSelect/src/test/java/org/richfaces/component/InplaceSelectComponentTest.java
===================================================================
--- trunk/ui/inplaceSelect/src/test/java/org/richfaces/component/InplaceSelectComponentTest.java 2008-11-28 10:50:13 UTC (rev 11422)
+++ trunk/ui/inplaceSelect/src/test/java/org/richfaces/component/InplaceSelectComponentTest.java 2008-11-28 10:51:27 UTC (rev 11423)
@@ -36,16 +36,21 @@
import org.apache.commons.lang.StringUtils;
import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import com.gargoylesoftware.htmlunit.html.HtmlLink;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import com.gargoylesoftware.htmlunit.html.HtmlScript;
+/**
+ * @author Anton Belevich
+ *
+ */
public class InplaceSelectComponentTest extends AbstractAjax4JsfTestCase {
UIForm form;
UIInplaceSelect iselect;
- List selectItems = new ArrayList();
+ List <SelectItem> selectItems = new ArrayList<SelectItem>();
- private static Set javaScripts = new HashSet();
+ private static Set <String> javaScripts = new HashSet <String>();
static {
javaScripts.add("org.ajax4jsf.javascript.PrototypeScript");
@@ -111,7 +116,7 @@
public void testComboBoxStyles() throws Exception {
HtmlPage page = renderView();
assertNotNull(page);
- List links = page.getDocumentElement().getHtmlElementsByTagName("link");
+ List <HtmlLink> links = page.getDocumentHtmlElement().getHtmlElementsByTagName("link");
if(links.size()==0){fail();}
for (int i = 0; i < links.size(); i++) {
HtmlElement link = (HtmlElement) links.get(i);
@@ -123,20 +128,20 @@
public void testComboBoxScripts() throws Exception {
HtmlPage page = renderView();
assertNotNull(page);
- List scripts = page.getDocumentElement().getHtmlElementsByTagName("script");
+ List <HtmlScript> scripts = page.getDocumentHtmlElement().getHtmlElementsByTagName("script");
- for (Iterator it = scripts.iterator(); it.hasNext();) {
+ for (Iterator <HtmlScript> it = scripts.iterator(); it.hasNext();) {
HtmlScript item = (HtmlScript) it.next();
String srcAttr = item.getSrcAttribute();
- if (item.getFirstChild() != null) {
- String scriptBodyString = item.getFirstChild().toString();
+ if (item.getFirstDomChild() != null) {
+ String scriptBodyString = item.getFirstDomChild().toString();
assertTrue(scriptBodyString.contains("Richfaces.InplaceSelectList"));
assertTrue(scriptBodyString.contains("Richfaces.InplaceSelect"));
assertTrue(scriptBodyString.contains("inplaceSelectUserStyles"));
}
if (StringUtils.isNotBlank(srcAttr)) {
boolean found = false;
- for (Iterator srcIt = javaScripts.iterator(); srcIt.hasNext();) {
+ for (Iterator <String> srcIt = javaScripts.iterator(); srcIt.hasNext();) {
String src = (String) srcIt.next();
found = srcAttr.contains(src);
if (found) {
Modified: trunk/ui/inplaceSelect/src/test/java/org/richfaces/renderkit/InplaceSelectRenderTest.java
===================================================================
--- trunk/ui/inplaceSelect/src/test/java/org/richfaces/renderkit/InplaceSelectRenderTest.java 2008-11-28 10:50:13 UTC (rev 11422)
+++ trunk/ui/inplaceSelect/src/test/java/org/richfaces/renderkit/InplaceSelectRenderTest.java 2008-11-28 10:51:27 UTC (rev 11423)
@@ -21,6 +21,8 @@
package org.richfaces.renderkit;
import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Iterator;
import java.util.List;
import javax.faces.component.UISelectItem;
@@ -28,17 +30,24 @@
import javax.faces.model.SelectItem;
import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
+import org.ajax4jsf.tests.MockValueExpression;
import org.richfaces.component.UIInplaceSelect;
-import org.richfaces.renderkit.html.InplaceSelectRenderer;
+import org.w3c.dom.Node;
+import com.gargoylesoftware.htmlunit.html.DomNode;
import com.gargoylesoftware.htmlunit.html.HtmlElement;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
+/**
+ * @author Anton Belevich
+ *
+ */
public class InplaceSelectRenderTest extends AbstractAjax4JsfTestCase {
private UIInplaceSelect iselect;
- private InplaceSelectRenderer renderer;
- List selectItems = new ArrayList();
+
+ List <String> states = Arrays.asList("Kansas City", "Las Vegas", "Oklahoma City", "New Jersey", "Detroit", "Toronto", "Cleveland", "Indianapolis", "Indianapolis", "New York");
+ List <SelectItem> selectItems = new ArrayList <SelectItem>();
public InplaceSelectRenderTest(String name) {
super(name);
@@ -46,9 +55,8 @@
public void setUp() throws Exception {
super.setUp();
- renderer = new InplaceSelectRenderer();
iselect = (UIInplaceSelect)application.createComponent("org.richfaces.InplaceSelect");
- iselect.setValue("New York");
+
selectItems.add(new SelectItem("Kansas City"));
selectItems.add(new SelectItem("Las Vegas"));
selectItems.add(new SelectItem("Oklahoma City"));
@@ -66,26 +74,34 @@
UISelectItem item4 = new UISelectItem();
item4.setValue(new SelectItem("New York"));
-
+
+ UISelectItems items = new UISelectItems();
+ items.setValueExpression("value",new MockValueExpression(selectItems));
+
+ iselect.getChildren().add(items);
iselect.getChildren().add(item1);
iselect.getChildren().add(item2);
iselect.getChildren().add(item3);
iselect.getChildren().add(item4);
- UISelectItems items = new UISelectItems();
- items.setValue(selectItems);
- iselect.getChildren().add(items);
- iselect.setValue("New York");
-
facesContext.getViewRoot().getChildren().add(iselect);
}
public void testRender() throws Exception{
-
HtmlPage page = renderView();
assertNotNull(page);
- HtmlElement elem = page.getHtmlElementById(iselect.getClientId(facesContext));
+ String clientId = iselect.getClientId(facesContext);
+ HtmlElement elem = page.getHtmlElementById(clientId);
assertNotNull(elem);
assertEquals(elem.getTagName(), "span");
+ HtmlElement list = page.getHtmlElementById(clientId + "list");
+// test is list rendered correctly...
+ for (Iterator<HtmlElement> items = list.getChildIterator(); items.hasNext();) {
+ HtmlElement span = items.next();
+ assertEquals("span", span.getNodeName().toLowerCase());
+ DomNode node = span.getFirstDomChild();
+ assertEquals(Node.TEXT_NODE, node.getNodeType());
+ assertTrue(states.contains(node.getNodeValue()));
+ }
}
}
16 years
JBoss Rich Faces SVN: r11422 - trunk/ui/inplaceInput/src/test/java/org/richfaces/rendekit.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-11-28 05:50:13 -0500 (Fri, 28 Nov 2008)
New Revision: 11422
Modified:
trunk/ui/inplaceInput/src/test/java/org/richfaces/rendekit/InplaceInputRendererTest.java
Log:
extend test
Modified: trunk/ui/inplaceInput/src/test/java/org/richfaces/rendekit/InplaceInputRendererTest.java
===================================================================
--- trunk/ui/inplaceInput/src/test/java/org/richfaces/rendekit/InplaceInputRendererTest.java 2008-11-28 09:40:23 UTC (rev 11421)
+++ trunk/ui/inplaceInput/src/test/java/org/richfaces/rendekit/InplaceInputRendererTest.java 2008-11-28 10:50:13 UTC (rev 11422)
@@ -22,27 +22,21 @@
import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
import org.richfaces.component.UIInplaceInput;
-import org.richfaces.renderkit.html.InplaceInputRenderer;
-import org.w3c.dom.Node;
-import com.gargoylesoftware.htmlunit.html.DomNode;
import com.gargoylesoftware.htmlunit.html.HtmlElement;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
public class InplaceInputRendererTest extends AbstractAjax4JsfTestCase{
private UIInplaceInput iinput;
- private InplaceInputRenderer renderer;
+
-
public InplaceInputRendererTest(String name) {
super(name);
}
-
public void setUp() throws Exception {
super.setUp();
- renderer = new InplaceInputRenderer();
iinput = (UIInplaceInput)application.createComponent("org.richfaces.InplaceInput");
iinput.setValue("New York");
facesContext.getViewRoot().getChildren().add(iinput);
16 years
JBoss Rich Faces SVN: r11421 - in trunk/ui/inplaceInput/src/test/java/org/richfaces: rendekit and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-11-28 04:40:23 -0500 (Fri, 28 Nov 2008)
New Revision: 11421
Modified:
trunk/ui/inplaceInput/src/test/java/org/richfaces/component/InplaceInputComponentTest.java
trunk/ui/inplaceInput/src/test/java/org/richfaces/rendekit/InplaceInputRendererTest.java
Log:
https://jira.jboss.org/jira/browse/RF-5068
Modified: trunk/ui/inplaceInput/src/test/java/org/richfaces/component/InplaceInputComponentTest.java
===================================================================
--- trunk/ui/inplaceInput/src/test/java/org/richfaces/component/InplaceInputComponentTest.java 2008-11-27 19:34:54 UTC (rev 11420)
+++ trunk/ui/inplaceInput/src/test/java/org/richfaces/component/InplaceInputComponentTest.java 2008-11-28 09:40:23 UTC (rev 11421)
@@ -32,7 +32,9 @@
import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
import org.apache.commons.lang.StringUtils;
+import com.gargoylesoftware.htmlunit.html.DomNode;
import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import com.gargoylesoftware.htmlunit.html.HtmlLink;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import com.gargoylesoftware.htmlunit.html.HtmlScript;
@@ -41,7 +43,7 @@
UIForm form;
UIInplaceInput iinput;
- private static Set javaScripts = new HashSet();
+ private static Set <String>javaScripts = new HashSet<String>();
static {
javaScripts.add("org.ajax4jsf.javascript.PrototypeScript");
@@ -64,8 +66,6 @@
iinput = (UIInplaceInput)application.createComponent("org.richfaces.InplaceInput");
iinput.setValue("New York");
form.getChildren().add(iinput);
-
-
}
public void testRenderer() throws Exception {
@@ -76,30 +76,35 @@
public void testComboBoxStyles() throws Exception {
HtmlPage page = renderView();
assertNotNull(page);
- List links = page.getDocumentElement().getHtmlElementsByTagName("link");
- if(links.size()==0){fail();}
+ List <HtmlLink> links = page.getDocumentHtmlElement().getHtmlElementsByTagName("link");
+ if(links.size()==0){
+ fail();
+ }
+
for (int i = 0; i < links.size(); i++) {
HtmlElement link = (HtmlElement) links.get(i);
- assertTrue(link.getAttributeValue("href").contains(
- "css/inplaceinput.xcss"));
+ assertTrue(link.getAttributeValue("href").contains("css/inplaceinput.xcss"));
}
}
public void testComboBoxScripts() throws Exception {
HtmlPage page = renderView();
assertNotNull(page);
- List scripts = page.getDocumentElement().getHtmlElementsByTagName("script");
+ List <HtmlScript> scripts = page.getDocumentHtmlElement().getHtmlElementsByTagName("script");
- for (Iterator it = scripts.iterator(); it.hasNext();) {
- HtmlScript item = (HtmlScript) it.next();
+ for (Iterator <HtmlScript> it = scripts.iterator(); it.hasNext();) {
+
+ HtmlScript item = it.next();
String srcAttr = item.getSrcAttribute();
- if (item.getFirstChild() != null) {
- String scriptBodyString = item.getFirstChild().toString();
- assertTrue(scriptBodyString.contains("Richfaces.InplaceInput"));
+
+ if (item.getFirstDomChild() != null) {
+ DomNode script = item.getFirstDomChild();
+ assertTrue(script.getNodeValue().contains("Richfaces.InplaceInput"));
}
+
if (StringUtils.isNotBlank(srcAttr)) {
boolean found = false;
- for (Iterator srcIt = javaScripts.iterator(); srcIt.hasNext();) {
+ for (Iterator <String> srcIt = javaScripts.iterator(); srcIt.hasNext();) {
String src = (String) srcIt.next();
found = srcAttr.contains(src);
if (found) {
@@ -111,7 +116,6 @@
}
}
-
public void tearDown() throws Exception {
super.tearDown();
}
Modified: trunk/ui/inplaceInput/src/test/java/org/richfaces/rendekit/InplaceInputRendererTest.java
===================================================================
--- trunk/ui/inplaceInput/src/test/java/org/richfaces/rendekit/InplaceInputRendererTest.java 2008-11-27 19:34:54 UTC (rev 11420)
+++ trunk/ui/inplaceInput/src/test/java/org/richfaces/rendekit/InplaceInputRendererTest.java 2008-11-28 09:40:23 UTC (rev 11421)
@@ -23,7 +23,9 @@
import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
import org.richfaces.component.UIInplaceInput;
import org.richfaces.renderkit.html.InplaceInputRenderer;
+import org.w3c.dom.Node;
+import com.gargoylesoftware.htmlunit.html.DomNode;
import com.gargoylesoftware.htmlunit.html.HtmlElement;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
16 years