Author: jjamrich
Date: 2011-09-12 16:11:32 -0400 (Mon, 12 Sep 2011)
New Revision: 22713
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richAutocomplete/csv.xhtml
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/TestAutocompleteCSV.java
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richAutocomplete/list.xhtml
Log:
RFPL-1240: add csv for rich:autocomplete (example + tests)
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richAutocomplete/csv.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richAutocomplete/csv.xhtml
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richAutocomplete/csv.xhtml 2011-09-12
20:11:32 UTC (rev 22713)
@@ -0,0 +1,107 @@
+<?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:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
+
xmlns:rich="http://richfaces.org/rich"
xmlns:a4j="http://richfaces.org/a4j">
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010-2011, 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.
+ -->
+
+ <ui:composition template="/templates/template.xhtml">
+
+ <ui:define name="view">
+ <f:metadata>
+ <f:viewParam name="templates"
value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ </ui:define>
+
+ <ui:define name="component">
+ <h:commandButton id="hButton" value="h:commandButton"
style="margin-right: 10px;"/>
+ <a4j:commandButton id="a4jButton"
value="a4j:commandButton"/>
+ <br/><br/>
+
+ <h:panelGrid columns="3">
+ not empty
+ <rich:autocomplete id="input1"
+
autocompleteMethod="#{richAutocompleteBean.autocomplete}"
+ value="#{richAutocompleteBean.value1}"
+ >
+ <rich:validator event="change" />
+ <a4j:ajax event="change"
render="output1"/>
+ </rich:autocomplete>
+ <rich:message id="inputMsg1" for="input1"/>
+
+ pattern [a-z].*
+ <rich:autocomplete id="input2"
+
autocompleteMethod="#{richAutocompleteBean.autocomplete}"
+ value="#{richAutocompleteBean.value2}"
+ >
+ <rich:validator event="change"/>
+ <a4j:ajax event="change"
render="output2"/>
+ </rich:autocomplete>
+ <rich:message id="inputMsg2" for="input2"/>
+
+ size 3-6
+ <rich:autocomplete id="input3"
+
autocompleteMethod="#{richAutocompleteBean.autocomplete}"
+ value="#{richAutocompleteBean.value3}"
+ >
+ <rich:validator event="change"/>
+ <a4j:ajax event="change"
render="output3"/>
+ </rich:autocomplete>
+ <rich:message id="inputMsg3" for="input3"/>
+
+ custom (RichFaces)
+ <rich:autocomplete id="input4"
+ value="#{richAutocompleteBean.value4}"
+ >
+ <f:validator
validatorId="org.richfaces.StringRichFacesValidator"/>
+ <rich:validator event="change"/>
+ <a4j:ajax event="change"
render="output4"/>
+ </rich:autocomplete>
+ <rich:message id="inputMsg4" for="input4"/>
+
+ </h:panelGrid>
+ <br/><br/>
+
+ <h:panelGrid columns="2">
+ output1
+ <h:outputText id="output1"
value="#{richAutocompleteBean.value1}"/>
+ output2
+ <h:outputText id="output2"
value="#{richAutocompleteBean.value2}"/>
+ output3
+ <h:outputText id="output3"
value="#{richAutocompleteBean.value3}"/>
+ output4
+ <h:outputText id="output4"
value="#{richAutocompleteBean.value4}"/>
+ </h:panelGrid>
+
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <metamer:attributes value="#{richAutocompleteBean.attributes}"
id="attributes" />
+ <metamer:attributes
value="#{richAutocompleteBean.ajaxAttributes}" id="ajaxAttributes"
/>
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richAutocomplete/list.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richAutocomplete/list.xhtml 2011-09-12
19:02:49 UTC (rev 22712)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richAutocomplete/list.xhtml 2011-09-12
20:11:32 UTC (rev 22713)
@@ -43,6 +43,10 @@
<metamer:testPageLink id="jsr303" outcome="jsr303"
value="JSR-303 Bean Validation">
Simple page that contains some <b>rich:autocomplete</b>s with
various JSR-303 validators.
</metamer:testPageLink>
+
+ <metamer:testPageLink id="csv" outcome="csv"
value="Client Side Validation">
+ Simple page that contains some <b>rich:autocomplete</b>s
testing client-side validation..
+ </metamer:testPageLink>
</ui:define>
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/TestAutocompleteCSV.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/TestAutocompleteCSV.java
(rev 0)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/TestAutocompleteCSV.java 2011-09-12
20:11:32 UTC (rev 22713)
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.richAutocomplete;
+
+import java.net.URL;
+
+import org.jboss.test.selenium.utils.URLUtils;
+import org.testng.annotations.Test;
+import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
+
+/**
+ * Test for page faces/components/richAutocomplete/jsr303.xhtml
+ *
+ * @author <a href="mailto:jjamrich@redhat.com">Jan Jamrich</a>
+ * @version $Revision$
+ */
+@IssueTracking("")
+public class TestAutocompleteCSV extends TestComponentWithJSR303 {
+
+ @Override
+ public URL getTestUrl() {
+ return URLUtils.buildUrl(contextPath,
"faces/components/richAutocomplete/csv.xhtml");
+ }
+
+ @Test
+ public void testNotEmpty() {
+ verifyNotEmpty();
+ }
+
+ @Test
+ public void testRegExpPattern() {
+ verifyRegExpPattern();
+ }
+
+ @Test
+ public void testStringSize() {
+ verifyStringSize();
+ }
+
+ @Test
+ public void testCustomString() {
+ verifyCustomString();
+ }
+
+ @Test
+ public void testAllInputsWrong() {
+ verifyAllInputsWrong();
+ }
+
+ @Test
+ public void testAllInputsCorrect() {
+ verifyAllInputsCorrect();
+ }
+
+}