Author: jjamrich
Date: 2011-09-23 09:30:37 -0400 (Fri, 23 Sep 2011)
New Revision: 22752
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPickList/PickListAttributes.java
Removed:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPickList/RichPickListComponentAttribute.java
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/richPickList/TestPickList.java
Log:
RFPL-1439: Update pickList compoenent tests to use unified way to setting attributes
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
13:30:07 UTC (rev 22751)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/attributes/AttributeList.java 2011-09-23
13:30:37 UTC (rev 22752)
@@ -28,6 +28,7 @@
import org.richfaces.tests.metamer.ftest.richPanelMenu.PanelMenuAttributes;
import org.richfaces.tests.metamer.ftest.richPanelMenuGroup.PanelMenuGroupAttributes;
import org.richfaces.tests.metamer.ftest.richPanelMenuItem.PanelMenuItemAttributes;
+import org.richfaces.tests.metamer.ftest.richPickList.PickListAttributes;
import org.richfaces.tests.metamer.ftest.richTooltip.TooltipAttributes;
public class AttributeList {
@@ -59,5 +60,6 @@
public static Attributes<PanelMenuAttributes> panelMenuAttributes = new
Attributes<PanelMenuAttributes>();
public static Attributes<PanelMenuGroupAttributes> panelMenuGroupAttributes =
new Attributes<PanelMenuGroupAttributes>();
public static Attributes<PanelMenuItemAttributes> panelMenuItemAttributes = new
Attributes<PanelMenuItemAttributes>();
+ public static Attributes<PickListAttributes> pickListAttributes = new
Attributes<PickListAttributes>();
}
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPickList/PickListAttributes.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPickList/PickListAttributes.java
(rev 0)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPickList/PickListAttributes.java 2011-09-23
13:30:37 UTC (rev 22752)
@@ -0,0 +1,115 @@
+/*******************************************************************************
+ * 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.richPickList;
+
+import org.richfaces.tests.metamer.ftest.attributes.AttributeEnum;
+
+/**
+ * Rich Pick List component attributes
+ *
+ * @author <a href="mailto:jjamrich@redhat.com">Jan Jamrich</a>
+ *
+ * @version $Revision$
+ */
+public enum PickListAttributes implements AttributeEnum {
+
+ addAllText,
+ addText,
+ columnClasses,
+ columnVar,
+ defaultLabel,
+ disabled,
+ disabledClass,
+ downBottomText,
+ downText,
+ headerClass,
+ immediate,
+ itemClass,
+ listHeight,
+ listWidth,
+ maxListHeight,
+ minListHeight,
+ onadditems,
+ onblur,
+ onchange,
+ onclick,
+ ondblclick,
+ onfocus,
+ onkeydown,
+ onkeypress,
+ onkeyup,
+ onlistclick,
+ onlistdblclick,
+ onlistkeydown,
+ onlistkeypress,
+ onlistkeyup,
+ onlistmousedown,
+ onlistmousemove,
+ onlistmouseout,
+ onlistmouseover,
+ onlistmouseup,
+ onmousedown,
+ onmousemove,
+ onmouseout,
+ onmouseover,
+ onmouseup,
+ onremoveitems,
+ onsourceclick,
+ onsourcedblclick,
+ onsourcekeydown,
+ onsourcekeypress,
+ onsourcekeyup,
+ onsourcemousedown,
+ onsourcemousemove,
+ onsourcemouseout,
+ onsourcemouseover,
+ onsourcemouseup,
+ ontargetclick,
+ ontargetdblclick,
+ ontargetkeydown,
+ ontargetkeypress,
+ ontargetkeyup,
+ ontargetmousedown,
+ ontargetmousemove,
+ ontargetmouseout,
+ ontargetmouseover,
+ ontargetmouseup,
+ orderable,
+ removeAllText,
+ removeText,
+ rendered,
+ required,
+ requiredMessage,
+ selectItemClass,
+ showButton,
+ sourceCaption,
+ style,
+ styleClass,
+ targetCaption,
+ upText,
+ upTopText,
+ validator,
+ validatorMessage,
+ value,
+ valueChangeListener,
+
+}
Deleted:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPickList/RichPickListComponentAttribute.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPickList/RichPickListComponentAttribute.java 2011-09-23
13:30:07 UTC (rev 22751)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPickList/RichPickListComponentAttribute.java 2011-09-23
13:30:37 UTC (rev 22752)
@@ -1,351 +0,0 @@
-/*******************************************************************************
- * 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.richPickList;
-
-import org.richfaces.tests.metamer.ftest.AbstractComponentAttributes;
-
-/**
- * Rich Pick List component attributes bean
- *
- * @author <a href="mailto:jjamrich@redhat.com">Jan Jamrich</a>
- *
- * @version $Revision$
- */
-public class RichPickListComponentAttribute extends AbstractComponentAttributes {
-
- public void setAddAllText(String addAllText) {
- setProperty("addAllText", addAllText);
- }
-
- public void setAddText(String addText) {
- setProperty("addText", addText);
- }
-
- public void setColumnClasses(String columnClasses) {
- setProperty("columnClasses", columnClasses);
- }
-
- public void setColumnVar(String columnVar) {
- setProperty("columnVar", columnVar);
- }
-
- public void setDefaultLabel(String defaultLabel) {
- setProperty("defaultLabel", defaultLabel);
- }
-
- public void setDisabled(Boolean disabled) {
- setProperty("disabled", disabled);
- }
-
- public void setDisabledClass(String disabledClass) {
- setProperty("disabledClass", disabledClass);
- }
-
- public void setDownBottomText(String downBottomText) {
- setProperty("downBottomText", downBottomText);
- }
-
- public void setDownText(String downText) {
- setProperty("downText", downText);
- }
-
- public void setHeaderClass(String headerClass) {
- setProperty("headerClass", headerClass);
- }
-
- public void setImmediate(Boolean immediate) {
- setProperty("immediate", immediate);
- }
-
- public void setItemClass(String itemClass) {
- setProperty("itemClass", itemClass);
- }
-
- public void setListHeight(String listHeight) {
- setProperty("listHeight", listHeight);
- }
-
- public void setListWidth(String listWidth) {
- setProperty("listWidth", listWidth);
- }
-
- public void setMaxListHeight(String maxListHeight) {
- setProperty("maxListHeight", maxListHeight);
- }
-
- public void setMinListHeight(String minListHeight) {
- setProperty("minListHeight", minListHeight);
- }
-
- public void setOnadditems(String onadditems) {
- setProperty("onadditems", onadditems);
- }
-
- public void setOnblur(String onblur) {
- setProperty("onblur", onblur);
- }
-
- public void setOnchange(String onchange) {
- setProperty("onchange", onchange);
- }
-
- public void setOnclick(String onclick) {
- setProperty("onclick", onclick);
- }
-
- public void setOndblclick(String ondblclick) {
- setProperty("ondblclick", ondblclick);
- }
-
- public void setOnfocus(String onfocus) {
- setProperty("onfocus", onfocus);
- }
-
- public void setOnkeydown(String onkeydown) {
- setProperty("onkeydown", onkeydown);
- }
-
- public void setOnkeypress(String onkeypress) {
- setProperty("onkeypress", onkeypress);
- }
-
- public void setOnkeyup(String onkeyup) {
- setProperty("onkeyup", onkeyup);
- }
-
- public void setOnlistclick(String onlistclick) {
- setProperty("onlistclick", onlistclick);
- }
-
- public void setOnlistdblclick(String onlistdblclick) {
- setProperty("onlistdblclick", onlistdblclick);
- }
-
- public void setOnlistkeydown(String onlistkeydown) {
- setProperty("onlistkeydown", onlistkeydown);
- }
-
- public void setOnlistkeypress(String onlistkeypress) {
- setProperty("onlistkeypress", onlistkeypress);
- }
-
- public void setOnlistkeyup(String onlistkeyup) {
- setProperty("onlistkeyup", onlistkeyup);
- }
-
- public void setOnlistmousedown(String onlistmousedown) {
- setProperty("onlistmousedown", onlistmousedown);
- }
-
- public void setOnlistmousemove(String onlistmousemove) {
- setProperty("onlistmousemove", onlistmousemove);
- }
-
- public void setOnlistmouseout(String onlistmouseout) {
- setProperty("onlistmouseout", onlistmouseout);
- }
-
- public void setOnlistmouseover(String onlistmouseover) {
- setProperty("onlistmouseover", onlistmouseover);
- }
-
- public void setOnlistmouseup(String onlistmouseup) {
- setProperty("onlistmouseup", onlistmouseup);
- }
-
- public void setOnmousedown(String onmousedown) {
- setProperty("onmousedown", onmousedown);
- }
-
- public void setOnmousemove(String onmousemove) {
- setProperty("onmousemove", onmousemove);
- }
-
- public void setOnmouseout(String onmouseout) {
- setProperty("onmouseout", onmouseout);
- }
-
- public void setOnmouseover(String onmouseover) {
- setProperty("onmouseover", onmouseover);
- }
-
- public void setOnmouseup(String onmouseup) {
- setProperty("onmouseup", onmouseup);
- }
-
- public void setOnremoveitems(String onremoveitems) {
- setProperty("onremoveitems", onremoveitems);
- }
-
- public void setOnsourceclick(String onsourceclick) {
- setProperty("onsourceclick", onsourceclick);
- }
-
- public void setOnsourcedblclick(String onsourcedblclick) {
- setProperty("onsourcedblclick", onsourcedblclick);
- }
-
- public void setOnsourcekeydown(String onsourcekeydown) {
- setProperty("onsourcekeydown", onsourcekeydown);
- }
-
- public void setOnsourcekeypress(String onsourcekeypress) {
- setProperty("onsourcekeypress", onsourcekeypress);
- }
-
- public void setOnsourcekeyup(String onsourcekeyup) {
- setProperty("onsourcekeyup", onsourcekeyup);
- }
-
- public void setOnsourcemousedown(String onsourcemousedown) {
- setProperty("onsourcemousedown", onsourcemousedown);
- }
-
- public void setOnsourcemousemove(String onsourcemousemove) {
- setProperty("onsourcemousemove", onsourcemousemove);
- }
-
- public void setOnsourcemouseout(String onsourcemouseout) {
- setProperty("onsourcemouseout", onsourcemouseout);
- }
-
- public void setOnsourcemouseover(String onsourcemouseover) {
- setProperty("onsourcemouseover", onsourcemouseover);
- }
-
- public void setOnsourcemouseup(String onsourcemouseup) {
- setProperty("onsourcemouseup", onsourcemouseup);
- }
-
- public void setOntargetclick(String ontargetclick) {
- setProperty("ontargetclick", ontargetclick);
- }
-
- public void setOntargetdblclick(String ontargetdblclick) {
- setProperty("ontargetdblclick", ontargetdblclick);
- }
-
- public void setOntargetkeydown(String ontargetkeydown) {
- setProperty("ontargetkeydown", ontargetkeydown);
- }
-
- public void setOntargetkeypress(String ontargetkeypress) {
- setProperty("ontargetkeypress", ontargetkeypress);
- }
-
- public void setOntargetkeyup(String ontargetkeyup) {
- setProperty("ontargetkeyup", ontargetkeyup);
- }
-
- public void setOntargetmousedown(String ontargetmousedown) {
- setProperty("ontargetmousedown", ontargetmousedown);
- }
-
- public void setOntargetmousemove(String ontargetmousemove) {
- setProperty("ontargetmousemove", ontargetmousemove);
- }
-
- public void setOntargetmouseout(String ontargetmouseout) {
- setProperty("ontargetmouseout", ontargetmouseout);
- }
-
- public void setOntargetmouseover(String ontargetmouseover) {
- setProperty("ontargetmouseover", ontargetmouseover);
- }
-
- public void setOntargetmouseup(String ontargetmouseup) {
- setProperty("ontargetmouseup", ontargetmouseup);
- }
-
- public void setOrderable(Boolean orderable) {
- setProperty("orderable", orderable);
- }
-
- public void setRemoveAllText(String removeAllText) {
- setProperty("removeAllText", removeAllText);
- }
-
- public void setRemoveText(String removeText) {
- setProperty("removeText", removeText);
- }
-
- public void setRendered(Boolean rendered) {
- setProperty("rendered", rendered);
- }
-
- public void setRequired(Boolean required) {
- setProperty("required", required);
- }
-
- public void setRequiredMessage(String requiredMessage) {
- setProperty("requiredMessage", requiredMessage);
- }
-
- public void setSelectItemClass(String selectItemClass) {
- setProperty("selectItemClass", selectItemClass);
- }
-
- public void setShowButton(String showButton) {
- setProperty("showButton", showButton);
- }
-
- public void setSourceCaption(String sourceCaption) {
- setProperty("sourceCaption", sourceCaption);
- }
-
- public void setStyle(String style) {
- setProperty("style", style);
- }
-
- public void setStyleClass(String styleClass) {
- setProperty("styleClass", styleClass);
- }
-
- public void setTargetCaption(String targetCaption) {
- setProperty("targetCaption", targetCaption);
- }
-
- public void setUpText(String upText) {
- setProperty("upText", upText);
- }
-
- public void setUpTopText(String upTopText) {
- setProperty("upTopText", upTopText);
- }
-
- public void setValidator(String validator) {
- setProperty("validator", validator);
- }
-
- public void setValidatorMessage(String validatorMessage) {
- setProperty("validatorMessage", validatorMessage);
- }
-
- public void setValue(String value) {
- setProperty("value", value);
- }
-
- public void setValueChangeListener(String valueChangeListener) {
- setProperty("valueChangeListener", valueChangeListener);
- }
-
-}
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPickList/TestPickList.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPickList/TestPickList.java 2011-09-23
13:30:07 UTC (rev 22751)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPickList/TestPickList.java 2011-09-23
13:30:37 UTC (rev 22752)
@@ -26,6 +26,8 @@
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;
+import static
org.richfaces.tests.metamer.ftest.attributes.AttributeList.pickListAttributes;
+import static org.richfaces.tests.metamer.ftest.richPickList.PickListAttributes.*;
import java.net.URL;
@@ -47,8 +49,6 @@
*/
public class TestPickList extends AbstractMetamerTest {
- private RichPickListComponentAttribute attributes = new
RichPickListComponentAttribute();
-
private JQueryLocator phaseListenerFormat = jq("div#phasesPanel
li:eq({0})");
private JQueryLocator hSubmit = pjq("input[id$=hButton]");
@@ -145,14 +145,14 @@
@Test
public void testAddAllText() {
String label = "xxx";
- attributes.setAddAllText(label);
+ pickListAttributes.set(addAllText, label);
assertTrue(label.equals(selenium.getText(addAllBtn)));
}
@Test
public void testAddText() {
String label = "xxx";
- attributes.setAddText(label);
+ pickListAttributes.set(addText, label);
assertTrue(label.equals(selenium.getText(addBtn)));
}
@@ -174,7 +174,7 @@
waitGui.until(elementPresent.locator(pickListTargetItem.format(0)));
selenium.click(hSubmit);
- attributes.setDisabled(Boolean.TRUE);
+ pickListAttributes.set(disabled, Boolean.TRUE);
// check if source items are disabled (check second - first item after 0 item
added)
String pickListSourceItemClass =
selenium.getAttribute(pickListSrcItem.format(1).getAttribute(classAttr));
@@ -202,8 +202,8 @@
@Test
public void testDisabledClass() {
String disabledClass = "my-cool-disabled-class";
- attributes.setDisabledClass(disabledClass);
- attributes.setDisabled(Boolean.TRUE);
+ pickListAttributes.set(PickListAttributes.disabledClass, disabledClass);
+ pickListAttributes.set(disabled, Boolean.TRUE);
String found = selenium.getAttribute(pickListTop.getAttribute(classAttr));
assertTrue(found != null);
@@ -212,16 +212,16 @@
@Test
public void testDownBottomText() {
- attributes.setDownBottomText("xxx");
- attributes.setOrderable(Boolean.TRUE);
+ pickListAttributes.set(downBottomText, "xxx");
+ pickListAttributes.set(orderable, Boolean.TRUE);
assertEquals(selenium.getText(pickListOrderingControlsContainer.getDescendant(jq("button:eq(3)"))),
"xxx",
"Button's text did not change.");
}
@Test
public void testDownText() {
- attributes.setDownText("xxx");
- attributes.setOrderable(Boolean.TRUE);
+ pickListAttributes.set(downText, "xxx");
+ pickListAttributes.set(orderable, Boolean.TRUE);
assertEquals(selenium.getText(pickListOrderingControlsContainer.getDescendant(jq("button:eq(2)"))),
"xxx",
"Button's text did not change.");
}
@@ -233,7 +233,7 @@
public void testHeaderClass() {
// move to columns layout test
/*
- * String headerClass = "my-cool-header-class";
attributes.setHeaderClass(headerClass);
+ * String headerClass = "my-cool-header-class";
pickListAttributes.setHeaderClass(headerClass);
*
* String found = selenium.getAttribute(pickListTop.getAttribute(classAttr));
assertTrue(found != null);
* assertTrue(found.contains(headerClass));
@@ -242,7 +242,7 @@
@Test
public void testImmediate() {
- attributes.setImmediate(Boolean.TRUE);
+ pickListAttributes.set(immediate, Boolean.TRUE);
addItem("richfaces");
selenium.click(a4jSubmit);
@@ -254,61 +254,61 @@
@Test
public void testItemClass() {
- String itemClass = "xxx";
- attributes.setItemClass(itemClass);
+ String value = "xxx";
+ pickListAttributes.set(itemClass, value);
String classVal =
selenium.getAttribute(pickListSrcItemByText.format("richfaces").getAttribute(classAttr));
assertTrue(classVal != null);
- assertTrue(classVal.contains(itemClass));
+ assertTrue(classVal.contains(value));
}
@Test
public void testListHeight() {
- String listHeight = "333";
- attributes.setListHeight(listHeight);
+ String value = "333";
+ pickListAttributes.set(listHeight, value);
String found = selenium.getAttribute(pickListCtrl.getAttribute(styleAttr));
assertTrue(found != null);
- assertTrue(found.contains(listHeight));
+ assertTrue(found.contains(value));
}
@Test
public void testListWidth() {
- String listWidth = "222";
- attributes.setListWidth(listWidth);
+ String value = "222";
+ pickListAttributes.set(listWidth, value);
String found = selenium.getAttribute(pickListCtrl.getAttribute(styleAttr));
assertTrue(found != null);
- assertTrue(found.contains(listWidth));
+ assertTrue(found.contains(value));
}
@Test
public void testMaxListHeight() {
- String maxListHeight = "345";
- attributes.setMaxListHeight(maxListHeight);
+ String value = "345";
+ pickListAttributes.set(maxListHeight, value);
String found = selenium.getAttribute(pickListCtrl.getAttribute(styleAttr));
assertTrue(found != null);
- assertTrue(found.contains(maxListHeight));
+ assertTrue(found.contains(value));
}
@Test
public void testMinListHeight() {
- String minListHeight = "234";
- attributes.setMinListHeight(minListHeight);
+ String value = "234";
+ pickListAttributes.set(minListHeight, value);
String found = selenium.getAttribute(pickListCtrl.getAttribute(styleAttr));
assertTrue(found != null);
- assertTrue(found.contains(minListHeight));
+ assertTrue(found.contains(value));
}
@Test
public void testOnadditems() {
- attributes.setOnadditems("metamerEvents += \"additems \"");
+ pickListAttributes.set(onadditems, "metamerEvents += \"additems
\"");
addItem("North Carolina");
waitGui.failWith("Attribute onadditems does not work
correctly").until(
new EventFiredCondition(new Event("additems")));
@@ -383,7 +383,7 @@
@Test
public void testOnremoveitems() {
- attributes.setOnremoveitems("metamerEvents += \"removeitems
\"");
+ pickListAttributes.set(onremoveitems, "metamerEvents += \"removeitems
\"");
addItem("North Carolina");
addItem("Hawaii");
addItem("Arizona");
@@ -527,11 +527,11 @@
public void testOrderable() {
// firstly check ordering controls doesn't appear near pickList if not
"orderable"
- attributes.setOrderable(Boolean.FALSE);
+ pickListAttributes.set(orderable, Boolean.FALSE);
assertFalse(selenium.isElementPresent(pickListOrderingControlsContainer));
// then make sure that controls appear near pickList when allow ordering
behavior
- attributes.setOrderable(Boolean.TRUE);
+ pickListAttributes.set(orderable, Boolean.TRUE);
assertTrue(selenium.isElementPresent(pickListOrderingControlsContainer));
// then add some items to target list
@@ -590,26 +590,26 @@
@Test
public void testRemoveAllText() {
String label = "xxx";
- attributes.setRemoveAllText(label);
+ pickListAttributes.set(removeAllText, label);
assertTrue(label.equals(selenium.getText(removeAllBtn)));
}
@Test
public void testRemoveText() {
String label = "xxx";
- attributes.setRemoveText(label);
+ pickListAttributes.set(removeText, label);
assertTrue(label.equals(selenium.getText(removeBtn)));
}
@Test
public void testRendered() {
- attributes.setRendered(Boolean.FALSE);
+ pickListAttributes.set(rendered, Boolean.FALSE);
assertFalse(selenium.isElementPresent(pickListTop));
}
@Test
public void testRequired() {
- attributes.setRequired(Boolean.TRUE);
+ pickListAttributes.set(required, Boolean.TRUE);
addItem("richfaces");
selenium.click(a4jSubmit);
@@ -624,32 +624,32 @@
@Test
public void testRequiredMessage() {
- String requiredMessage = "Test validation message";
- attributes.setRequiredMessage(requiredMessage);
+ String value = "Test validation message";
+ pickListAttributes.set(requiredMessage, value);
- attributes.setRequired(Boolean.TRUE);
+ pickListAttributes.set(required, Boolean.TRUE);
selenium.click(a4jSubmit);
- assertEquals(selenium.getText(pickListMsgBox), requiredMessage);
+ assertEquals(selenium.getText(pickListMsgBox), value);
}
@Test
public void testSelectItemClass() {
- String selectItemClass = "my-select-item-class";
- attributes.setSelectItemClass(selectItemClass);
+ String value = "my-select-item-class";
+ pickListAttributes.set(selectItemClass, value);
selenium.click(pickListSrcItemByText.format("richfaces"));
String classVal =
selenium.getAttribute(pickListSrcItemByText.format("richfaces").getAttribute(classAttr));
- assertTrue(classVal.contains(selectItemClass));
+ assertTrue(classVal.contains(value));
}
@Test
public void testSourceCaption() {
- String sourceCaption = "This is source";
- attributes.setSourceCaption(sourceCaption);
+ String caption = "This is source";
+ pickListAttributes.set(sourceCaption, caption);
- waitModel.until(textEquals.locator(sourceCaptionLocator).text(sourceCaption));
+ waitModel.until(textEquals.locator(sourceCaptionLocator).text(caption));
}
@Test
@@ -664,25 +664,25 @@
@Test
public void testTargetCaption() {
- String targetCaption = "This is target";
- attributes.setTargetCaption(targetCaption);
+ String caption = "This is target";
+ pickListAttributes.set(targetCaption, caption);
waitModel.until(elementPresent.locator(targetCaptionLocator));
- assertTrue(targetCaption.equals(selenium.getText(targetCaptionLocator)));
+ assertTrue(caption.equals(selenium.getText(targetCaptionLocator)));
}
@Test
public void testUpText() {
- attributes.setUpText("xxx");
- attributes.setOrderable(Boolean.TRUE);
+ pickListAttributes.set(upText, "xxx");
+ pickListAttributes.set(orderable, Boolean.TRUE);
assertEquals(selenium.getText(pickListOrderingControlsContainer.getDescendant(jq("button:eq(1)"))),
"xxx",
"Button's text did not change.");
}
@Test
public void testUpTopText() {
- attributes.setUpTopText("xxx");
- attributes.setOrderable(Boolean.TRUE);
+ pickListAttributes.set(upTopText, "xxx");
+ pickListAttributes.set(orderable, Boolean.TRUE);
assertEquals(selenium.getText(pickListOrderingControlsContainer.getDescendant(jq("button:eq(0)"))),
"xxx",
"Button's text did not change.");
}
@@ -698,13 +698,13 @@
@Test
public void testValidatorMessage() {
- String validationMessage = "We are sorry, but @ is not allowed to join us!
Custom validatorMessage.";
- attributes.setValidatorMessage(validationMessage);
+ String message = "We are sorry, but @ is not allowed to join us! Custom
validatorMessage.";
+ pickListAttributes.set(validatorMessage, message);
addAllItems();
selenium.click(a4jSubmit);
// verify our own validation message
- waitModel.until(textEquals.locator(pickListMsgBox).text(validationMessage));
+ waitModel.until(textEquals.locator(pickListMsgBox).text(message));
}
@Test