From richfaces-svn-commits at lists.jboss.org Mon Aug 8 04:27:22 2011 Content-Type: multipart/mixed; boundary="===============3723771133974396138==" MIME-Version: 1.0 From: richfaces-svn-commits at lists.jboss.org To: richfaces-svn-commits at lists.jboss.org Subject: [richfaces-svn-commits] JBoss Rich Faces SVN: r22599 - in modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest: richPickList and 1 other directory. Date: Mon, 08 Aug 2011 04:27:22 -0400 Message-ID: <201108080827.p788RMct011008@svn01.web.mwc.hst.phx2.redhat.com> --===============3723771133974396138== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: jjamrich Date: 2011-08-08 04:27:22 -0400 (Mon, 08 Aug 2011) New Revision: 22599 Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tes= ts/metamer/ftest/richPickList/ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tes= ts/metamer/ftest/richPickList/RichPickListComponentAttribute.java modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tes= ts/metamer/ftest/richPickList/TestPickList.java Log: Add initial tests for rich:pickList component There are prepared methods for testing all attributes, but much of them are= still not implemented. Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces= /tests/metamer/ftest/richPickList/RichPickListComponentAttribute.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/te= sts/metamer/ftest/richPickList/RichPickListComponentAttribute.java = (rev 0) +++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/te= sts/metamer/ftest/richPickList/RichPickListComponentAttribute.java 2011-08-= 08 08:27:22 UTC (rev 22599) @@ -0,0 +1,331 @@ +/*************************************************************************= ****** + * 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 Jan Jamrich + * + * @version $Revision$ + */ +public class RichPickListComponentAttribute extends AbstractComponentAttri= butes { + = + 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 setHeaderClass(String headerClass) { + setProperty("headerClass", headerClass); + } + + public void setImmediate(String 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 setOnadditem(String onadditem) { + setProperty("onadditem", onadditem); + } + + 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 setOnremoveitem(String onremoveitem) { + setProperty("onremoveitem", onremoveitem); + } + + 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 setRemoveAllText(String removeAllText) { + setProperty("removeAllText", removeAllText); + } + + public void setRemoveText(String removeText) { + setProperty("removeText", removeText); + } + + public void setRendered(String rendered) { + setProperty("rendered", rendered); + } + + public void setRequired(String 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 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); + } + = +} Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces= /tests/metamer/ftest/richPickList/TestPickList.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/te= sts/metamer/ftest/richPickList/TestPickList.java (r= ev 0) +++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/te= sts/metamer/ftest/richPickList/TestPickList.java 2011-08-08 08:27:22 UTC (r= ev 22599) @@ -0,0 +1,629 @@ +/*************************************************************************= ****** + * 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 static org.jboss.test.selenium.locator.LocatorFactory.jq; +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertTrue; +import static org.testng.Assert.assertFalse; + +import java.net.URL; +import org.jboss.test.selenium.locator.Attribute; +import org.jboss.test.selenium.locator.JQueryLocator; +import org.jboss.test.selenium.utils.URLUtils; +import org.richfaces.tests.metamer.ftest.AbstractMetamerTest; +import org.testng.annotations.Test; + +/** + * Test for rich:pickList on page faces/components/richPickList/simple.xht= ml. + * + * @author Jan Jamrich + * + * @version $Revision$ + */ +public class TestPickList extends AbstractMetamerTest { + = + private RichPickListComponentAttribute attributes =3D new RichPickList= ComponentAttribute(); + private JQueryLocator hSubmit =3D pjq("input[id$=3DhButton]"); + private JQueryLocator a4jSubmit =3D pjq("input[id$=3Da4jButton]"); + = + private JQueryLocator pickListSourceItems =3D pjq("div[id$=3DpickListS= ourceItems]"); + private JQueryLocator pickListSourceItem =3D pickListSourceItems.getCh= ild(jq("div[id$=3DpickListItem{0}]")); + = + private JQueryLocator pickListTargetItems =3D pjq("div[id$=3DpickListT= argetItems]"); + private JQueryLocator pickListTargetItem =3D pickListTargetItems.getCh= ild(jq("div[id$=3DpickListItem{0}]")); + = + // after click on 'add' button, item is moved to 'staging' container (= not child of #pickListTargetItems) + private JQueryLocator pickListTargetItemsStage =3D pjq("div[id$=3Dpick= ListTargetList] div.rf-pick-lst-scrl"); + private JQueryLocator pickListTargetItemStage =3D pickListTargetItemsS= tage.getChild(jq("div[id$=3DpickListItem{0}]")); + = + private JQueryLocator addBtn =3D pjq("button.rf-pick-add"); + private JQueryLocator addAllBtn =3D pjq("button.rf-pick-add-all"); + private JQueryLocator removeBtn =3D pjq("button.rf-pick-rem"); + private JQueryLocator removeAllBtn =3D pjq("button.rf-pick-rem-all"); + = + private Attribute classAttr =3D new Attribute("class"); + private Attribute disabledAttr =3D new Attribute("disabled"); + = + private String STYLE_CLASS_ITEM_DISABLED =3D "rf-pick-opt-dis"; + private String STYLE_CLASS_BTN_DISABLED =3D "rf-pick-btn-dis"; + private String STYLE_CLASS_ITEM_SELECTED =3D "rf-pick-sel"; + + @Override + public URL getTestUrl() { + return URLUtils.buildUrl(contextPath, "faces/components/richPickLi= st/simple.xhtml"); + } + = + private void addItem(int id) { + selenium.click(pickListSourceItem.format(id)); + selenium.click(addBtn); + } + = + private void removeItem(int id) { + selenium.click(pickListTargetItem.format(id)); + selenium.click(removeBtn); + } + = + private void addAllItems() { + selenium.click(addAllBtn); + } + = + private void removeAllItems(){ + selenium.click(removeAllBtn); + } + = + @Test + public void testAddAllText() { + attributes.setAddAllText("addAll"); + assertEquals(selenium.getText(addAllBtn), "addAll"); = + } + + @Test + public void testAddText() { + attributes.setAddText("add"); + assertEquals(selenium.getText(addBtn), "add"); + } + + // @Test + public void testColumnClasses() { + // TODO JJa 2011-08-05: ask Brian about this attr: + // attributes.setColumnClasses(columnClasses); + } + + // @Test + public void testColumnVar() { + // TODO JJa 2011-08-05: ask Brian about this attr: + // attributes.setColumnVar(columnVar); + } + + // @Test + public void testDefaultLabel() { + // TODO JJa 2011-08-05: ask Brian about this attr: + // attributes.setDefaultLabel(defaultLabel); + } + + @Test + public void testDisabled() { + = + // add first item [idx=3D0], then submit and disable + addItem(0); + selenium.click(hSubmit); + = + attributes.setDisabled(Boolean.TRUE); + = + // check if source items are disabled (check second - first item a= fter 0 item added) + String pickListSourceItemClass =3D selenium.getAttribute( + pickListSourceItem.format(1).getAttribute(classAttr)); + assertTrue(pickListSourceItemClass.contains(STYLE_CLASS_ITEM_DISAB= LED)); + = + // all buttons should be disabled + assertTrue(selenium.getAttribute(addBtn.getAttribute(classAttr)).c= ontains(STYLE_CLASS_BTN_DISABLED)); + assertTrue("disabled".equals(selenium.getAttribute(addBtn.getAttri= bute(disabledAttr)))); + = + assertTrue(selenium.getAttribute(addAllBtn.getAttribute(classAttr)= ).contains(STYLE_CLASS_BTN_DISABLED)); + assertTrue("disabled".equals(selenium.getAttribute(addAllBtn.getAt= tribute(disabledAttr)))); + = + assertTrue(selenium.getAttribute(removeBtn.getAttribute(classAttr)= ).contains(STYLE_CLASS_BTN_DISABLED)); + assertTrue("disabled".equals(selenium.getAttribute(removeBtn.getAt= tribute(disabledAttr)))); + = + assertTrue(selenium.getAttribute(removeAllBtn.getAttribute(classAt= tr)).contains(STYLE_CLASS_BTN_DISABLED)); + assertTrue("disabled".equals(selenium.getAttribute(removeAllBtn.ge= tAttribute(disabledAttr)))); + = + // check item added to target list if disabled (remember - item in= dex in id didn't change) + assertTrue(selenium.getAttribute(pickListTargetItem.format(0).getA= ttribute(classAttr)) + .contains(STYLE_CLASS_ITEM_DISABLED)); + = + } + + // @Test + public void testDisabledClass() { + // TODO JJa 2011-08-05: ask Brian about this attr: = + // attributes.setDisabledClass(disabledClass); + } + + // @Test + public void testHeaderClass() { + // attributes.setHeaderClass(headerClass); + } + + // @Test + public void testImmediate() { + // attributes.setImmediate(immediate); + } + + // @Test + public void testItemClass() { + // attributes.setItemClass(itemClass); + } + + // @Test + public void testListHeight() { + // attributes.setListHeight(listHeight); + } + + // @Test + public void testListWidth() { + // attributes.setListWidth(listWidth)setMaxListHeight(maxListHeigh= t); + } + + // @Test + public void testMaxListHeight() { + // attributes.setMaxListHeight(maxListHeight); + } + + // @Test + public void testMinListHeight() { + // attributes.setMinListHeight(minListHeight); + } + + // @Test + public void testOnadditem() { + // attributes.setOnadditem(onadditem); + } + + // @Test + public void testOnblur() { + // attributes.setOnblur(onblur); + } + + // @Test + public void testOnchange() { + // attributes.setOnchange(onchange); + } + + // @Test + public void testOnclick() { + // attributes.setOnclick(onclick); + } + + // @Test + public void testOndblclick() { + // attributes.setOndblclick(ondblclick); + } + + // @Test + public void testOnfocus() { + // attributes.setOnfocus(onfocus); + } + + // @Test + public void testOnkeydown() { + // attributes.setOnkeydown(onkeydown); + } + + // @Test + public void testOnkeypress() { + // attributes.setOnkeypress(onkeypress); + } + + // @Test + public void testOnkeyup() { + // attributes.setOnkeyup(onkeyup); + } + + // @Test + public void testOnlistclick() { + // attributes.setOnlistclick(onlistclick); + } + + // @Test + public void testOnlistdblclick() { + // attributes.setOnlistdblclick(onlistdblclick); + } + + // @Test + public void testOnlistkeydown() { + // attributes.setOnlistkeydown(onlistkeydown); + } + + // @Test + public void testOnlistkeypress() { + // attributes.setOnlistkeypress(onlistkeypress); + } + + // @Test + public void testOnlistkeyup() { + // attributes.setOnlistkeyup(onlistkeyup); + } + + // @Test + public void testOnlistmousedown() { + // attributes.setOnlistmousedown(onlistmousedown); + } + + // @Test + public void testOnlistmousemove() { + // attributes.setOnlistmousemove(onlistmousemove); + } + + // @Test + public void testOnlistmouseout() { + // attributes.setOnlistmouseout(onlistmouseout); + } + + // @Test + public void testOnlistmouseover() { + // attributes.setOnlistmouseover(onlistmouseover); + } + + // @Test + public void testOnlistmouseup() { + // attributes.setOnlistmouseup(onlistmouseup); + } + + // @Test + public void testOnmousedown() { + // attributes.setOnmousedown(onmousedown); + } + + // @Test + public void testOnmousemove() { + // attributes.setOnmousemove(onmousemove); + } + + // @Test + public void testOnmouseout() { + // attributes.setOnmouseout(onmouseout); + } + + // @Test + public void testOnmouseover() { + // attributes.setOnmouseover(onmouseover); + } + + // @Test + public void testOnmouseup() { + // attributes.setOnmouseup(onmouseup); + } + + // @Test + public void testOnremoveitem() { + // attributes.setOnremoveitem(onremoveitem); + } + + // @Test + public void testOnsourceclick() { + // attributes.setOnsourceclick(onsourceclick); + } + + // @Test + public void testOnsourcedblclick() { + // attributes.setOnsourcedblclick(onsourcedblclick); + } + + // @Test + public void testOnsourcekeydown() { + // attributes.setOnsourcekeydown(onsourcekeydown); + } + + // @Test + public void testOnsourcekeypress() { + // attributes.setOnsourcekeypress(onsourcekeypress); + } + + // @Test + public void testOnsourcekeyup() { + // attributes.setOnsourcekeyup(onsourcekeyup); + } + + // @Test + public void testOnsourcemousedown() { + // attributes.setOnsourcemousedown(onsourcemousedown); + } + + // @Test + public void testOnsourcemousemove() { + // attributes.setOnsourcemousemove(onsourcemousemove); + } + + // @Test + public void testOnsourcemouseout() { + // attributes.setOnsourcemouseout(onsourcemouseout); + } + + // @Test + public void testOnsourcemouseover() { + // attributes.setOnsourcemouseover(onsourcemouseover); + } + + // @Test + public void testOnsourcemouseup() { + // attributes.setOnsourcemouseup(onsourcemouseup); + } + + // @Test + public void testOntargetclick() { + // attributes.setOntargetclick(ontargetclick); + } + + // @Test + public void testOntargetdblclick() { + // attributes.setOntargetdblclick(ontargetdblclick); + } + + // @Test + public void testOntargetkeydown() { + // attributes.setOntargetkeydown(ontargetkeydown); + } + + // @Test + public void testOntargetkeypress() { + // attributes.setOntargetkeypress(ontargetkeypress); + } + + // @Test + public void testOntargetkeyup() { + // attributes.setOntargetkeyup(ontargetkeyup); + } + + // @Test + public void testOntargetmousedown() { + // attributes.setOntargetmousedown(ontargetmousedown); + } + + // @Test + public void testOntargetmousemove() { + // attributes.setOntargetmousemove(ontargetmousemove); + } + + // @Test + public void testOntargetmouseout() { + // attributes.setOntargetmouseout(ontargetmouseout); + } + + // @Test + public void testOntargetmouseover() { + // attributes.setOntargetmouseover(ontargetmouseover); + } + + // @Test + public void testOntargetmouseup() { + // attributes.setOntargetmouseup(ontargetmouseup); + } + + // @Test + public void testRemoveAllText() { + // attributes.setRemoveAllText(removeAllText); + } + + // @Test + public void testRemoveText() { + // attributes.setRemoveText(removeText); + } + + // @Test + public void testRendered() { + // attributes.setRendered(rendered); + } + + // @Test + public void testRequired() { + // attributes.setRequired(required); + } + + // @Test + public void testRequiredMessage() { + // attributes.setRequiredMessage(requiredMessage); + } + + // @Test + public void testSelectItemClass() { + // attributes.setSelectItemClass(selectItemClass); + } + + // @Test + public void testShowButton() { + // TODO JJa 2011-08-05: create JIRA for this attribute: its not wo= rking + } + + // @Test + public void testSourceCaption() { + // attributes.setSourceCaption(sourceCaption); + } + + // @Test + public void testStyle() { + // attributes.setStyle(style); + } + + // @Test + public void testStyleClass() { + // attributes.setStyleClass(styleClass); + } + + // @Test + public void testTargetCaption() { + // attributes.setTargetCaption(targetCaption); + } + + // @Test + public void testValidator() { + = + // verify difference between submit incorrect value by h and a4j b= tn. + // Seems that while h submit cause incorrect value removed from ta= rget list, a4j don't do it + = + // attributes.setValidator(validator); + } + + // @Test + public void testValidatorMessage() { + // attributes.setValidatorMessage(validatorMessage); + } + + // @Test + public void testValue() { + // attributes.setValue(value); + } + + // @Test + public void testValueChangeListener() { + = + } + = + /** + * Verify that addBtn is disabled until item from source items picked + */ + // @Test + public void testDisableAddBtn() { + = + } + = + /** + * Verify that removeBtn is disabled until item from target items pick= ed + */ + // @Test + public void testDisableRemoveBtn() { + = + } + = + /** + * Verify addAll button working correctly + */ + // @Test + public void testAddAllBtn(){ + = + } + = + /** + * Verify removeAll button working correctly + */ + // @Test + public void testRemoveAllBtn() { + = + } + = + /** + * Verify submit by JSF submit button + */ + // @Test + public void testSaveJSF() { + = + } + = + /** + * Verify submit by ajax button + */ + // @Test + public void testSaveAjax() { + = + } + = + /** + * Verify that item keep selected even moved from source to target, + * or back. If selected Alaska from sources, and then added to target, + * it should remain selected in target list + * @return + */ + @Test + public void testKeepSelected() { + int itemIdx =3D 0; + = + String classBeforeSelect =3D selenium.getAttribute(pickListSourceI= tem.format(itemIdx).getAttribute(classAttr)); + assertFalse(classBeforeSelect.contains(STYLE_CLASS_ITEM_SELECTED), = + "pickList item shouldn't be selected before any click made! Cu= rrent class(es) found: " + classBeforeSelect); + = + selenium.click(pickListSourceItem.format(itemIdx)); + = + String pickedItemText =3D selenium.getText(pickListSourceItem.form= at(itemIdx)); + = + String classAfterSelect =3D selenium.getAttribute(pickListSourceIt= em.format(itemIdx).getAttribute(classAttr)); + assertTrue(classAfterSelect.contains(STYLE_CLASS_ITEM_SELECTED), + "pickList item should be selected after click on item was made= . Current class(es) found: " + classAfterSelect); + = + // now move selected item to target list + selenium.click(addBtn); + = + waitGui.until(elementPresent.locator(jq("div[id$=3DpickListTargetL= ist] div.rf-pick-lst-scrl > div[id$=3DpickListItem0]"))); + = + // and check if item remain selected + String classAfterMove =3D selenium.getAttribute(pickListTargetItem= Stage.format(itemIdx).getAttribute(classAttr)); + assertTrue(classAfterMove.contains(STYLE_CLASS_ITEM_SELECTED), + "pickList item should keep selected after move to target list.= Current class(es) found: " + classAfterMove); + = + // verify that the same text is within item with the same ID index + assertEquals(selenium.getText(pickListTargetItemStage.format(itemI= dx)), pickedItemText); + } + = + /** + * Verify that selected item is moved to appropriate list + * after click on add/remove button + */ + @Test + public void testMoveItem() { + int itemIdx =3D 5; + = + // select item + selenium.click(pickListSourceItem.format(itemIdx)); + = + String pickedItemText =3D selenium.getText(pickListSourceItem.form= at(itemIdx)); + = + // add item to target list + selenium.click(addBtn); + = + // item index doesn't change when moved to target list + assertTrue(selenium.isElementPresent(pickListTargetItemStage.forma= t(itemIdx))); + // verify that the same text is within item with the same ID index + assertEquals(selenium.getText(pickListTargetItemStage.format(itemI= dx)), pickedItemText); + } + = + /** + * Verify that item get selected when click on it + */ + @Test + public void testGetSelected() { + // this item will be selected and verified appropriate class chang= e/add + int itemIdx =3D 0; + = + String classBeforeSelect =3D selenium.getAttribute(pickListSourceI= tem.format(itemIdx).getAttribute(classAttr)); + assertFalse(classBeforeSelect.contains(STYLE_CLASS_ITEM_SELECTED), = + "pickList item shouldn't be selected before any click made! Cu= rrent class(es) found: " + classBeforeSelect); + = + selenium.click(pickListSourceItem.format(itemIdx)); + = + String classAfterSelect =3D selenium.getAttribute(pickListSourceIt= em.format(itemIdx).getAttribute(classAttr)); + assertTrue(classAfterSelect.contains(STYLE_CLASS_ITEM_SELECTED), + "pickList item should be selected after click on item was made= . Current class(es) found: " + classAfterSelect); + + } + = + +} --===============3723771133974396138==--