Author: jjamrich
Date: 2011-09-23 09:23:05 -0400 (Fri, 23 Sep 2011)
New Revision: 22736
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/attributes/AttributeList.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/AbstractAutocompleteTest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/AutocompleteAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/TestAutocompleteByKeys.java
Log:
RFPL-1439: update tests for rich:autocomplete to setting attributes by unified way
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/attributes/AttributeList.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/attributes/AttributeList.java 2011-09-23
12:29:35 UTC (rev 22735)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/attributes/AttributeList.java 2011-09-23
13:23:05 UTC (rev 22736)
@@ -9,6 +9,7 @@
import org.richfaces.tests.metamer.ftest.a4jStatus.StatusAttributes;
import org.richfaces.tests.metamer.ftest.abstractions.DataTableAttributes;
import org.richfaces.tests.metamer.ftest.abstractions.DataTableFacets;
+import org.richfaces.tests.metamer.ftest.richAutocomplete.AutocompleteAttributes;
import org.richfaces.tests.metamer.ftest.richTooltip.TooltipAttributes;
import static org.richfaces.tests.metamer.ftest.AbstractMetamerTest.pjq;
@@ -25,5 +26,6 @@
public static Attributes<StatusAttributes> statusAttributes = new
Attributes<StatusAttributes>();
public static Attributes<DataTableAttributes> dataTableAttributes = new
Attributes<DataTableAttributes>();
public static Attributes<DataTableFacets> dataTableFacets = new
Attributes<DataTableFacets>(RequestType.XHR); // for facets use XHR by default
+ public static Attributes<AutocompleteAttributes> autocompleteAttributes = new
Attributes<AutocompleteAttributes>();
}
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/AbstractAutocompleteTest.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/AbstractAutocompleteTest.java 2011-09-23
12:29:35 UTC (rev 22735)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/AbstractAutocompleteTest.java 2011-09-23
13:23:05 UTC (rev 22736)
@@ -35,13 +35,8 @@
*/
public abstract class AbstractAutocompleteTest extends AbstractMetamerTest {
- private AutocompleteAttributes attributes = new AutocompleteAttributes();
private Autocomplete autocomplete = new Autocomplete();
List<Capital> capitals = Model.unmarshallCapitals();
-
- protected AutocompleteAttributes getAttributes() {
- return attributes;
- }
protected Autocomplete getAutocomplete() {
return autocomplete;
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/AutocompleteAttributes.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/AutocompleteAttributes.java 2011-09-23
12:29:35 UTC (rev 22735)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/AutocompleteAttributes.java 2011-09-23
13:23:05 UTC (rev 22736)
@@ -21,59 +21,69 @@
*******************************************************************************/
package org.richfaces.tests.metamer.ftest.richAutocomplete;
-import org.jboss.test.selenium.encapsulated.JavaScript;
-import org.richfaces.tests.metamer.ftest.AbstractComponentAttributes;
+import org.richfaces.tests.metamer.ftest.attributes.AttributeEnum;
/**
* @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
* @version $Revision$
*/
-public class AutocompleteAttributes extends AbstractComponentAttributes {
- public void setAutofill(Boolean autofill) {
- setProperty("autofill", autofill);
- }
+public enum AutocompleteAttributes implements AttributeEnum {
+
+ autocompleteList,
+ autocompleteMethod,
+ autofill,
+ clientFilterFunction,
+ converter,
+ converterMessage,
+ disabled,
+ fetchValue,
+ filterFunction,
+ immediate,
+ inputClass,
+ layout,
+ minChars,
+ mode,
+ onbeforedomupdate,
+ onbegin,
+ onblur,
+ onchange,
+ onclick,
+ oncomplete,
+ ondblclick,
+ onerror,
+ onfocus,
+ onkeydown,
+ onkeypress,
+ onkeyup,
+ onlistclick,
+ onlistdblclick,
+ onlistkeydown,
+ onlistkeypress,
+ onlistkeyup,
+ onlistmousedown,
+ onlistmousemove,
+ onlistmouseout,
+ onlistmouseover,
+ onlistmouseup,
+ onmousedown,
+ onmousemove,
+ onmouseout,
+ onmouseover,
+ onmouseup,
+ onselectitem,
+ popupClass,
+ rendered,
+ required,
+ requiredMessage,
+ selectFirst,
+ selectedItemClass,
+ showButton,
+ tokens,
+ validator,
+ validatorMessage,
+ value,
+ valueChangeListener,
+
+}
- public void setClientFilter(JavaScript clientFilter) {
- setProperty("clientFilter", clientFilter);
- }
- public void setDisabled(Boolean disabled) {
- setProperty("disabled", disabled);
- }
-
- public void setImmediate(Boolean immediate) {
- setProperty("immediate", immediate);
- }
-
- public void setMinChars(int minChars) {
- setProperty("minChars", minChars);
- }
-
- public void setMode(Mode mode) {
- setProperty("mode", mode);
- }
-
- public void setRendered(Boolean rendered) {
- setProperty("rendered", rendered);
- }
-
- public void setRequired(Boolean required) {
- setProperty("required", required);
- }
-
- public void setSelectFirst(Boolean selectFirst) {
- setProperty("selectFirst", selectFirst);
- }
-
- public void setShowButton(Boolean showButton) {
- setProperty("showButton", showButton);
- }
-
- public void setTokens(String tokens) {
- setProperty("tokens", tokens);
- }
-
- public enum Mode {
- AJAX, CACHED_AJAX, CLIENT
- }
-}
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/TestAutocompleteByKeys.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/TestAutocompleteByKeys.java 2011-09-23
12:29:35 UTC (rev 22735)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/TestAutocompleteByKeys.java 2011-09-23
13:23:05 UTC (rev 22736)
@@ -26,6 +26,7 @@
import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertTrue;
+import static
org.richfaces.tests.metamer.ftest.attributes.AttributeList.autocompleteAttributes;
import java.net.URL;
@@ -59,8 +60,8 @@
@BeforeMethod
public void prepareProperties() {
- getAttributes().setAutofill(autofill);
- getAttributes().setSelectFirst(selectFirst);
+ autocompleteAttributes.set(AutocompleteAttributes.autofill, autofill);
+ autocompleteAttributes.set(AutocompleteAttributes.selectFirst, selectFirst);
if (autofill == null) {
autofill = false;
}