Author: dsvyatobatsko
Date: 2009-03-09 13:23:40 -0400 (Mon, 09 Mar 2009)
New Revision: 12894
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/SuggestionBoxBean.java
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/suggestionBox/
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/suggestionBox/suggestionBoxAutoTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/SuggestionBoxTest.java
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/WEB-INF/faces-config.xml
Log:
https://jira.jboss.org/jira/browse/RF-6237 started
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/SuggestionBoxBean.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/SuggestionBoxBean.java
(rev 0)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/SuggestionBoxBean.java 2009-03-09
17:23:40 UTC (rev 12894)
@@ -0,0 +1,93 @@
+package org.ajax4jsf.bean;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class SuggestionBoxBean {
+
+ private List<Country> countries = new ArrayList<Country>();
+
+ private String countryName;
+
+ public SuggestionBoxBean() {
+ countries.add(new Country("Armenia", "Yerevan", 603628D,
46372700L));
+ countries.add(new Country("Azerbaijan", "Baku", 86600D,
8676000L));
+ countries.add(new Country("Belarus", "Minsk", 207600D,
9689800L));
+ countries.add(new Country("Georgia", "Tbilisi", 69700D,
4630841L));
+ countries.add(new Country("Kazakhstan", "Astana", 2724900D,
15217711L));
+ countries.add(new Country("Kyrgyzstan", "Bishkek", 199900D,
5264000L));
+ countries.add(new Country("Moldova", "Kishinev", 33846D,
4128047L));
+ countries.add(new Country("Russia", "Moscow", 17075400D,
142008838L));
+ countries.add(new Country("Tajikistan", "Dushanbe", 143100D,
6920300L));
+ countries.add(new Country("Turkmenistan", "Ashgabat", 488100D,
5110023L));
+ countries.add(new Country("Ukraine", "Kiev", 603628D,
46372700L));
+ countries.add(new Country("Uzbekistan", "Tashkent", 447400D,
27372000L));
+ }
+
+ public List<Country> getCountries() {
+ return countries;
+ }
+
+ /**
+ * Gets value of countryName field.
+ * @return value of countryName field
+ */
+ public String getCountryName() {
+ return countryName;
+ }
+
+ /**
+ * Set a new value for countryName field.
+ * @param countryName a new value for countryName field
+ */
+ public void setCountryName(String countryName) {
+ this.countryName = countryName;
+ }
+
+ public List<Country> autocomplete(Object suggestion) {
+ String s = (String) suggestion;
+ ArrayList<Country> retVal = new ArrayList<Country>();
+ for (Country country : countries) {
+ // if ("".equals(s) ||
+ // country.getName().toLowerCase().startsWith(s.toLowerCase())) {
+ if (country.getName().matches(".*" + s + ".*")) {
+ retVal.add(country);
+ }
+ }
+ return retVal;
+ }
+
+ /**
+ * Country
+ */
+ public static class Country {
+ private String name;
+ private String capital;
+ private Double area;
+ private Long population;
+
+ public Country(String name, String capital, Double area, Long population) {
+ this.name = name;
+ this.capital = capital;
+ this.area = area;
+ this.population = population;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getCapital() {
+ return capital;
+ }
+
+ public Double getArea() {
+ return area;
+ }
+
+ public Long getPopulation() {
+ return population;
+ }
+ }
+
+}
Property changes on:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/SuggestionBoxBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/WEB-INF/faces-config.xml 2009-03-09
16:28:19 UTC (rev 12893)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/WEB-INF/faces-config.xml 2009-03-09
17:23:40 UTC (rev 12894)
@@ -358,7 +358,12 @@
<managed-bean-name>columnGroupBean</managed-bean-name>
<managed-bean-class>org.ajax4jsf.bean.ColumnGroupBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
- </managed-bean>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>suggestionBean</managed-bean-name>
+ <managed-bean-class>org.ajax4jsf.bean.SuggestionBoxBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
<navigation-rule>
<from-view-id>/pages/ajaxInclude/step1.xhtml</from-view-id>
<navigation-case>
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/suggestionBox/suggestionBoxAutoTest.xhtml
===================================================================
(Binary files differ)
Property changes on:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/suggestionBox/suggestionBoxAutoTest.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/SuggestionBoxTest.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/SuggestionBoxTest.java
(rev 0)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/SuggestionBoxTest.java 2009-03-09
17:23:40 UTC (rev 12894)
@@ -0,0 +1,53 @@
+package org.richfaces.testng;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.ajax4jsf.template.Template;
+import org.richfaces.AutoTester;
+import org.richfaces.SeleniumTestBase;
+import org.testng.annotations.Test;
+
+public class SuggestionBoxTest extends SeleniumTestBase {
+
+ private static Map<String, String> params = new HashMap<String,
String>();
+
+ static {
+ params.put("parameter1", "value1");
+ params.put("parameter2", "value2");
+ params.put("parameter3", "value3");
+ }
+
+ @Test
+ public void testRenderedAttribute(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, null);
+ writeStatus("Test component with rendered = false is not present on the
page");
+ tester.testRendered();
+ }
+
+ @Test
+ public void testNestedParams(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, null);
+ writeStatus("Test component encodes nested f:param tags and their values are
present as request parameters");
+ tester.testRequestParameters(params);
+ }
+
+ @Override
+ public void sendAjax() {
+ type(getAutoTester(this).getClientId("suggestion"), "Bel");
+ waitForAjaxCompletion();
+ }
+
+ @Override
+ public String getAutoTestUrl() {
+ return "pages/suggestionBox/suggestionBoxAutoTest.xhtml";
+ }
+
+ @Override
+ public String getTestUrl() {
+ return null;
+ }
+
+}
Property changes on:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/SuggestionBoxTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native