JBoss Rich Faces SVN: r11280 - trunk/sandbox/samples.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-11-20 11:06:01 -0500 (Thu, 20 Nov 2008)
New Revision: 11280
Modified:
trunk/sandbox/samples/pom.xml
Log:
queue-sample removed from sandbox samples pom
Modified: trunk/sandbox/samples/pom.xml
===================================================================
--- trunk/sandbox/samples/pom.xml 2008-11-20 15:55:51 UTC (rev 11279)
+++ trunk/sandbox/samples/pom.xml 2008-11-20 16:06:01 UTC (rev 11280)
@@ -18,6 +18,5 @@
<!--module>contextMenuDemo</module-->
<module>fileUploadPOC</module>
<module>editor-sample</module>
- <module>queue-sample</module>
</modules>
</project>
\ No newline at end of file
17 years, 6 months
JBoss Rich Faces SVN: r11279 - trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/includes.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-11-20 10:55:51 -0500 (Thu, 20 Nov 2008)
New Revision: 11279
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/includes/testBody.xhtml
Log:
tests for inplaceselect
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/includes/testBody.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/includes/testBody.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/includes/testBody.xhtml 2008-11-20 15:55:51 UTC (rev 11279)
@@ -0,0 +1,21 @@
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+ <h:form id="_form">
+ <rich:inplaceSelect id="ii_#{test_prefix}" value="#{value}" required="#{required}" requiredMessage="#{requiredMessage}" editEvent="#{editEvent}" showControls="#{showControls}">
+ <f:selectItems value="#{inplaceSelectBean.treeItems}"/>
+ </rich:inplaceSelect>
+  
+ value: <h:outputText value="#{inplaceSelectBean.tree}" id="data1_#{test_prefix}"/>
+  
+ <span id="text_#{test_prefix}" >
+ text: <h:message for="ii_#{test_prefix}"/><h:outputText value="#{inplaceInputBean.text}"></h:outputText>
+ </span>
+ <br/>
+ <br/>
+ <h:commandButton id="bn_#{test_prefix}" action="#{inplaceSelectBean.action}" value="Submit"></h:commandButton>
+ </h:form>
+</ui:composition>
\ No newline at end of file
17 years, 6 months
JBoss Rich Faces SVN: r11277 - in trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces: testng and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-11-20 10:44:49 -0500 (Thu, 20 Nov 2008)
New Revision: 11277
Added:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InplacesTest.java
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InplaceInputTest.java
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InplaceSelectTest.java
Log:
tests for inplaceselect
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-11-20 15:43:45 UTC (rev 11276)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-11-20 15:44:49 UTC (rev 11277)
@@ -1277,4 +1277,5 @@
}
}
+
}
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InplaceInputTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InplaceInputTest.java 2008-11-20 15:43:45 UTC (rev 11276)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InplaceInputTest.java 2008-11-20 15:44:49 UTC (rev 11277)
@@ -13,7 +13,7 @@
import org.testng.Assert;
import org.testng.annotations.Test;
-public class InplaceInputTest extends SeleniumTestBase {
+public class InplaceInputTest extends InplacesTest {
private static final String INPLACE_INPUT_SIMPLE = "inplaceInput";
@@ -31,78 +31,10 @@
private static final String INPLACE_INPUT_PAGE = "inplaceInputTest.xhtml";
- private static final String REQUIRED_ATTRIBUTES_PAGE = "testRequiredAttributes.xhtml";
-
- private static final String REQUIRED_ATTRIBUTES_ID_PREFIX = "_tra";
-
- private static final String EDITEVENT_ATTRIBUTES_PAGE = "testEditEventAttribute.xhtml";
-
- private static final String EDITEVENT_ATTRIBUTES_ID_PREFIX = "_teea";
-
- private static final String CONTROLS_FACET_PAGE = "testControlsFacet.xhtml";
-
- private static final String CONTROLS_FACET_ID_PREFIX = "_tcf";
-
- private static final String CONTROLS_FACET_BN_OK = "ok";
-
- private static final String CONTROLS_FACET_BN_CANCEL = "cancel";
-
private static final String DEFAULTLABEL_AND_SPACES_PAGE = "testDefaultLabelAndSpaces.xhtml";
private static final String DEFAULTLABEL_AND_SPACES_PAGE_ID_PREFIX = "_dfas";
- private static final String SHOW_CONTROLS_ATTRIBUTE1_PAGE = "testShowControlsAttribute1.xhtml";
-
- private static final String SHOW_CONTROLS_ATTRIBUTE1_PAGE_ID_PREFIX = "_tsca1";
-
- private static final String SHOW_CONTROLS_ATTRIBUTE2_PAGE = "testShowControlsAttribute2.xhtml";
-
- private static final String SHOW_CONTROLS_ATTRIBUTE2_PAGE_ID_PREFIX = "_tsca2";
-
- private static final String SHOW_CONTROLS_ATTRIBUTE_BAR = "bar";
-
- private static final String VALIDATOR_PAGE = "testValidator.xhtml";
-
- private static final String VALIDATOR_PAGE_ID_PREFIX = "_tv";
-
- private static final String STANDART_ATTRIBUTES_PAGE = "testStandartAttributes.xhtml";
-
- private static final String STANDART_ATTRIBUTES_ID_PREFIX = "_tsa";
-
- private static final String IMMEDIATE_ATTRIBUTE_PAGE = "testImmediateAttribute.xhtml";
-
- private static final String IMMEDIATE_ATTRIBUTE_ID_PREFIX = "_tia";
-
- private static final String VALUE_CHANGE_LISTENER_PAGE = "testValueChangeListener.xhtml";
-
- private static final String VALUE_CHANGE_LISTENER_ID_PREFIX = "_tvcl";
-
- private static final String PROCESSING_INVALID_VALUE_PAGE = "testProcessingInvalidValue.xhtml";
-
- private static final String PROCESSING_INVALID_VALUE_ID_PREFIX = "_tpiv";
-
- private static final String JS_API_PAGE = "testJSApi.xhtml";
-
- private static final String JS_API_ID_PREFIX = "_tja";
-
- private static final String RENDERED_ATTRIBUTE_PAGE = "testRenderedAttribute.xhtml";
-
- private static final String RENDERED_ATTRIBUTE_ID_PREFIX = "_tra";
-
- private static final String BASIC_BEHAVIOUR_PAGE = "testBasicBehaviour.xhtml";
-
- private static final String BASIC_BEHAVIOUR_ID_PREFIX = "_tbb";
-
- private String testUrl;
-
- private String formId;
-
- private String buttonId;
-
- private String inplaceInputId;
-
- private String messageId;
-
@Test
public void testInplaceInputComponentLayout(Template template) {
setTestUrl(INPLACE_INPUT_PAGE);
@@ -224,54 +156,8 @@
AssertTextEquals(inplaceInputD, "Sun", "An inputted text has not to be saved with cancel");
}
-
- /**
- * 'required' and 'requiredMessage' attributes work
- *
- * @param template - current template
- */
- @Test
- public void testRequiredAttributes(Template template) {
- setTestUrl(REQUIRED_ATTRIBUTES_PAGE);
- init(template);
-
- selenium.click("id=" + buttonId + REQUIRED_ATTRIBUTES_ID_PREFIX);
- waitForPageToLoad();
- checkMessage(messageId + REQUIRED_ATTRIBUTES_ID_PREFIX, "text:requiredMsg", CommonUtils.getSuccessfulTestMessage(inplaceInputId + REQUIRED_ATTRIBUTES_ID_PREFIX), CommonUtils.getFailedTestMessage(inplaceInputId + REQUIRED_ATTRIBUTES_ID_PREFIX));
- }
-
- /**
- * Check 'editEvent' attribute
- *
- * @param template - current template
- */
- @Test
- public void testEditEventAttribute(Template template) {
- setTestUrl(EDITEVENT_ATTRIBUTES_PAGE);
- init(template);
-
- selenium.doubleClick(inplaceInputId + EDITEVENT_ATTRIBUTES_ID_PREFIX);
- Map<String, String> expMap = new HashMap<String, String>();
- expMap.put("clip", "rect(auto auto auto auto)");
- assertStyleAttributes(inplaceInputId + EDITEVENT_ATTRIBUTES_ID_PREFIX + "tempValue", expMap);
- }
/**
- * Check 'controls' facet
- *
- * @param template - current template
- */
- @Test
- public void testControlsFacet(Template template) {
- setTestUrl(CONTROLS_FACET_PAGE);
- init(template);
-
- check((isPresentById(CONTROLS_FACET_BN_OK + CONTROLS_FACET_ID_PREFIX) || isPresentById(CONTROLS_FACET_BN_CANCEL + CONTROLS_FACET_ID_PREFIX)),
- CommonUtils.getSuccessfulTestMessage(inplaceInputId + CONTROLS_FACET_ID_PREFIX),
- CommonUtils.getFailedTestMessage(inplaceInputId + CONTROLS_FACET_ID_PREFIX));
- }
-
- /**
* Input some spaces in inplaceInput; verify that defaultLabel is
* displayed after selecting; component does not disappear from the page
*
@@ -282,321 +168,30 @@
setTestUrl(DEFAULTLABEL_AND_SPACES_PAGE);
init(template);
- String iid = inplaceInputId + DEFAULTLABEL_AND_SPACES_PAGE_ID_PREFIX;
+ String iid = inplaceId + DEFAULTLABEL_AND_SPACES_PAGE_ID_PREFIX;
checkMessage(iid, "defaultLabel",
CommonUtils.getSuccessfulTestMessage(iid),
CommonUtils.getFailedTestMessage(iid));
typeAndCheck(iid, " ", "defaultLabel");
- typeAndCheck(iid, "test", "test");
+ //typeAndCheck(iid, "test", "test");
}
- /**
- * Verify component behaviour with showControls="false" attribute
- *
- * @param template - current template
- */
- @Test
- public void testShowControlsAttribute1(Template template) {
- setTestUrl(SHOW_CONTROLS_ATTRIBUTE1_PAGE);
- init(template);
-
- String iid = inplaceInputId + SHOW_CONTROLS_ATTRIBUTE1_PAGE_ID_PREFIX;
-
- clickById(iid);
- check(!isVisibleById(iid + SHOW_CONTROLS_ATTRIBUTE_BAR),
- CommonUtils.getSuccessfulTestMessage(iid),
- CommonUtils.getFailedTestMessage(iid));
-
- Map<String, String> expMap = new HashMap<String, String>();
- expMap.put("clip", "rect(auto auto auto auto)");
- assertStyleAttributes(iid+ "tempValue", expMap);
- selenium.fireEvent(iid + "tempValue", "blur");
- expMap.remove("clip");
- expMap.put("clip", "rect(0px 0px 0px 0px)");
- assertStyleAttributes(iid+ "tempValue", expMap);
- }
-
- /**
- * The same as previous but with showControls="true" attribute
- *
- * @param template - current template
- */
- @Test
- public void testShowControlsAttribute2(Template template) {
- setTestUrl(SHOW_CONTROLS_ATTRIBUTE2_PAGE);
- init(template);
-
- String iid = inplaceInputId + SHOW_CONTROLS_ATTRIBUTE2_PAGE_ID_PREFIX;
-
- clickById(iid);
- check(isVisibleById(iid + SHOW_CONTROLS_ATTRIBUTE_BAR),
- CommonUtils.getSuccessfulTestMessage(iid),
- CommonUtils.getFailedTestMessage(iid));
-
- Map<String, String> expMap = new HashMap<String, String>();
- expMap.put("clip", "rect(auto auto auto auto)");
- assertStyleAttributes(iid+ "tempValue", expMap);
- selenium.fireEvent(iid + "tempValue", "blur");
- expMap.remove("clip");
- expMap.put("clip", "rect(auto auto auto auto)");
- assertStyleAttributes(iid+ "tempValue", expMap);
- }
-
- /**
- * Validator defined by component attribute and nested tags work
- *
- * @param template - current template
- */
- @Test
- public void testValidator1(Template template) {
- setTestUrl(VALIDATOR_PAGE);
- init(template);
-
- String iid = inplaceInputId + VALIDATOR_PAGE_ID_PREFIX;
-
- clickById(buttonId + VALIDATOR_PAGE_ID_PREFIX + "1");
- waitForAjaxCompletion();
- check("".equals(getTextById(messageId + VALIDATOR_PAGE_ID_PREFIX + "1")),
- CommonUtils.getSuccessfulTestMessage(iid + "1"),
- CommonUtils.getFailedTestMessage(iid + "1"));
-
- clickById(buttonId + VALIDATOR_PAGE_ID_PREFIX + "2");
- waitForAjaxCompletion();
- check("".equals(getTextById(messageId + VALIDATOR_PAGE_ID_PREFIX + "2")),
- CommonUtils.getSuccessfulTestMessage(iid + "2"),
- CommonUtils.getFailedTestMessage(iid + "2"));
- }
-
- /**
- * Validator defined by component attribute and nested tags work
- *
- * @param template - current template
- */
- @Test
- public void testValidator2(Template template) {
- setTestUrl(VALIDATOR_PAGE);
- init(template);
-
- String iid = inplaceInputId + VALIDATOR_PAGE_ID_PREFIX;
-
- setValueById(iid + "1" + "value", "test1");
- setValueById(iid + "2" + "value", "test1");
-
- clickById(buttonId + VALIDATOR_PAGE_ID_PREFIX + "1");
- waitForAjaxCompletion();
- check("Value isn't correct!".equals(getTextById(messageId + VALIDATOR_PAGE_ID_PREFIX + "1")),
- CommonUtils.getSuccessfulTestMessage(iid + "1"),
- CommonUtils.getFailedTestMessage(iid + "1"));
-
- clickById(buttonId + VALIDATOR_PAGE_ID_PREFIX + "2");
- waitForAjaxCompletion();
- check("Value isn't correct!".equals(getTextById(messageId + VALIDATOR_PAGE_ID_PREFIX + "2")),
- CommonUtils.getSuccessfulTestMessage(iid + "2"),
- CommonUtils.getFailedTestMessage(iid + "2"));
- }
-
- /**
- * Immediate = true component works respectively
- *
- * @param template - current template
- */
- @Test
- public void testImmediateAttribute(Template template) {
- setTestUrl(IMMEDIATE_ATTRIBUTE_PAGE);
- init(template);
-
- String iid = inplaceInputId + IMMEDIATE_ATTRIBUTE_ID_PREFIX;
-
- setValueById(iid + "value", "test1");
- clickById(buttonId + IMMEDIATE_ATTRIBUTE_ID_PREFIX);
- waitForAjaxCompletion();
- check("Value isn't correct!".equals(getTextById(messageId + IMMEDIATE_ATTRIBUTE_ID_PREFIX)),
- CommonUtils.getSuccessfulTestMessage(iid),
- CommonUtils.getFailedTestMessage(iid));
- }
-
- /**
- * valueChangeListener should fire on submit
- * and model binding should be updated on value changed
- *
- * @param template - current template
- */
- @Test
- public void testValueChangeListener(Template template) {
- setTestUrl(VALUE_CHANGE_LISTENER_PAGE);
- init(template);
-
- String iid = inplaceInputId + VALUE_CHANGE_LISTENER_ID_PREFIX;
-
- setValueById(iid + "value", "test1");
- clickById(buttonId + VALUE_CHANGE_LISTENER_ID_PREFIX);
- waitForAjaxCompletion();
- check(("test1" + InplaceInputTestBean.Messages.VALUECHANGELISTENER_CALLED).equals(getTextById(messageId + VALUE_CHANGE_LISTENER_ID_PREFIX)),
- CommonUtils.getSuccessfulTestMessage(iid),
- CommonUtils.getFailedTestMessage(iid));
- }
-
-
- /**
- * style and classes, standard HTML attributes are output to client
- *
- * @param template - current template
- */
- @Test
- public void testStandartAttributes(Template template) {
- setTestUrl(STANDART_ATTRIBUTES_PAGE);
- init(template);
-
- String iid = inplaceInputId + STANDART_ATTRIBUTES_ID_PREFIX;
- Map<String, String> styleAttributes = new HashMap<String, String>();
- styleAttributes.put("border", "3px");
-
- List<SeleniumEvent> events = new ArrayList<SeleniumEvent>();
- events.add(SeleniumEvent.ONMOUSEMOVE);
- events.add(SeleniumEvent.ONMOUSEOUT);
- events.add(SeleniumEvent.ONMOUSEOVER);
- events.add(SeleniumEvent.ONCLICK);
- events.add(SeleniumEvent.ONDBLCLICK);
- events.add(SeleniumEvent.ONKEYDOWN);
- events.add(SeleniumEvent.ONKEYPRESS);
- events.add(SeleniumEvent.ONKEYUP);
- events.add(SeleniumEvent.ONMOUSEUP);
-
- assertClassNames(iid,new String [] {"classForInplaceinput"}, "Component's rendering invalid", true);
- assertStyleAttributes(iid, styleAttributes);
-
- assertEvents(iid, events);
- }
-
- /**
- * Component displays submitted value after
- * submission of invalid value
- *
- * @param template - current template
- */
- @Test
- public void testProcessingInvalidValue(Template template) {
- setTestUrl(PROCESSING_INVALID_VALUE_PAGE);
- init(template);
-
- String iid = inplaceInputId + PROCESSING_INVALID_VALUE_ID_PREFIX;
- String newVlaue = "ddd";
- setValueById(iid + "value", newVlaue);
- clickById(buttonId + PROCESSING_INVALID_VALUE_ID_PREFIX);
- waitForAjaxCompletion();
- String value = getTextById(iid);
- check(newVlaue.equals(value),
- CommonUtils.getSuccessfulTestMessage(iid),
- CommonUtils.getFailedTestMessage(iid));
- }
-
- /**
- * Verify JS API of the component
- *
- * @param template - current template
- */
- @Test
- public void testJSApi(Template template) {
- setTestUrl(JS_API_PAGE);
- init(template);
-
- String iid = inplaceInputId + JS_API_ID_PREFIX;
-
- selenium.runScript("var inplaceinput = ($('" + iid + "')).component;");
- Assert.assertTrue("test".equals(selenium.getEval("window.inplaceinput.getValue()")));
-
- selenium.getEval("window.inplaceinput.setValue(\"\", {value: \"JSApi\"})");
- Assert.assertTrue("JSApi".equals(selenium.getEval("window.inplaceinput.getValue()")));
-
- selenium.getEval("window.inplaceinput.edit()");
- Map<String, String> expMap = new HashMap<String, String>();
- expMap.put("clip", "rect(auto, auto, auto, auto)");
- assertStyleAttributes(iid + "tempValue", expMap);
-
- clickById(iid);
- type(iid + "tempValue", "testInplaceInput");
- selenium.getEval("window.inplaceinput.save()");
- check("testInplaceInput".equals(getValueById(iid + "value")), CommonUtils.getSuccessfulTestMessage(iid), CommonUtils.getFailedTestMessage(iid));
-
- clickById(iid);
- type(iid + "tempValue", "test");
- selenium.getEval("window.inplaceinput.cancel()");
- check("testInplaceInput".equals(getValueById(iid + "value")), CommonUtils.getSuccessfulTestMessage(iid), CommonUtils.getFailedTestMessage(iid));
- }
-
- /**
- * InplaceInput is present on the page and shows model value
- *
- * @param template - current temlate
- */
- @Test
- public void testBasicBehaviour(Template template) {
- setTestUrl(BASIC_BEHAVIOUR_PAGE);
- init(template);
-
- AssertValueEquals(inplaceInputId + BASIC_BEHAVIOUR_ID_PREFIX + "value", "test");
- }
-
- /**
- * Component with rendered = false is not present on the page
- *
- * @param template - current template
- */
- @Test
- public void testRenderedAttribute(Template template) {
- setTestUrl(RENDERED_ATTRIBUTE_PAGE);
- init(template);
-
- AssertNotRendered(inplaceInputId + RENDERED_ATTRIBUTE_ID_PREFIX);
- }
-
- private void typeAndCheck(String iid, String word, String expectedWord) {
- typeWord(iid, word);
- checkMessage(iid, expectedWord,
- CommonUtils.getSuccessfulTestMessage(iid),
- CommonUtils.getFailedTestMessage(iid));
- }
-
- private void typeWord(String iid, String word) {
- clickById(iid);
- type(iid + "tempValue", word);
- selenium.fireEvent(iid + "tempValue", "blur");
- }
-
- private void checkMessage(String elementId, String expectedValue, String okMsg, String errMsg) {
- String currentValue = getTextById(elementId);
- check((expectedValue).equals(currentValue), okMsg, errMsg);
- }
-
- private void check(boolean expression, String okMsg, String errMsg) {
- if (expression) {
- writeStatus(okMsg);
- } else {
- writeStatus(errMsg, true);
- Assert.fail(errMsg);
- }
- }
-
- private void init(Template template) {
- renderPage(template);
- initIds();
- }
-
- private void initIds() {
- formId = getParentId() + "_form:";
- buttonId = formId + "bn";
- inplaceInputId = formId + "ii";
- messageId = "text";
- }
-
- @Override
- public String getTestUrl() {
- return testUrl;
- }
-
- public void setTestUrl(String testUrl) {
- this.testUrl = "pages/inplaceInput/" + testUrl;
- }
-}
+ @Override
+ public void setTestUrl(String testUrl) {
+ this.testUrl = "pages/inplaceInput/" + testUrl;
+ }
+
+ public void initIds() {
+ super.initIds();
+ inplaceId = formId + "ii";
+ inplaceValuePrefix = "value";
+ iTempValuePx = "tempValue";
+ }
+
+ protected void setValue(String id, String newValue) {
+ selenium.runScript("($('" + id + "')).component.setValue(\"\", {value: \""+ newValue + "\"})");
+ //type(id, newValue);
+ }
+}
\ No newline at end of file
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InplaceSelectTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InplaceSelectTest.java 2008-11-20 15:43:45 UTC (rev 11276)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InplaceSelectTest.java 2008-11-20 15:44:49 UTC (rev 11277)
@@ -1,12 +1,11 @@
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
-import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
import org.testng.annotations.Test;
-public class InplaceSelectTest extends SeleniumTestBase {
-
+public class InplaceSelectTest extends InplacesTest {
+
@Test
public void testInplaceSelectComponent(Template template) {
renderPage(template);
@@ -70,8 +69,24 @@
Assert.assertEquals(runScript("theLatestEvent"), "viewactivated", "viewactivated event has not been triggered");
}
- public String getTestUrl() {
- return "pages/inplaceSelect/inplaceSelectTest.xhtml";
+ protected void testJSApiSetValue() {
+ selenium.getEval("window.inplace.setValue(\"\", {itemValue: \"JSApi\", itemLabel : \"JSApi\"})");
+ Assert.assertTrue("JSApi".equals(selenium.getEval("window.inplace.getValue()")));
}
+
+ @Override
+ public void setTestUrl(String testUrl) {
+ this.testUrl = "pages/inplaceSelect/" + testUrl;
+ }
+
+ public void initIds() {
+ super.initIds();
+ inplaceValuePrefix = "inplaceValue";
+ inplaceId = formId + "ii";
+ iTempValuePx = "inplaceTmpValue";
+ }
+ protected void setValue(String id, String newValue) {
+ selenium.runScript("($('" + id + "')).component.setValue(\"\", {itemValue: \""+ newValue + "\", itemLabel : \"" + newValue + "\"})");
+ }
}
Added: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InplacesTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InplacesTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InplacesTest.java 2008-11-20 15:44:49 UTC (rev 11277)
@@ -0,0 +1,467 @@
+/**
+ *
+ */
+package org.richfaces.testng;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.ajax4jsf.bean.InplaceInputTestBean;
+import org.ajax4jsf.template.Template;
+import org.richfaces.SeleniumEvent;
+import org.richfaces.SeleniumTestBase;
+import org.richfaces.testng.util.CommonUtils;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/**
+ * @author Vladimir Molotkov
+ *
+ */
+public abstract class InplacesTest extends SeleniumTestBase {
+
+ private static final String REQUIRED_ATTRIBUTES_PAGE = "testRequiredAttributes.xhtml";
+
+ private static final String REQUIRED_ATTRIBUTES_ID_PREFIX = "_tra";
+
+ private static final String EDITEVENT_ATTRIBUTES_PAGE = "testEditEventAttribute.xhtml";
+
+ private static final String EDITEVENT_ATTRIBUTES_ID_PREFIX = "_teea";
+
+ private static final String CONTROLS_FACET_PAGE = "testControlsFacet.xhtml";
+
+ private static final String CONTROLS_FACET_ID_PREFIX = "_tcf";
+
+ private static final String CONTROLS_FACET_BN_OK = "ok";
+
+ private static final String CONTROLS_FACET_BN_CANCEL = "cancel";
+
+ private static final String SHOW_CONTROLS_ATTRIBUTE1_PAGE = "testShowControlsAttribute1.xhtml";
+
+ private static final String SHOW_CONTROLS_ATTRIBUTE1_PAGE_ID_PREFIX = "_tsca1";
+
+ private static final String SHOW_CONTROLS_ATTRIBUTE2_PAGE = "testShowControlsAttribute2.xhtml";
+
+ private static final String SHOW_CONTROLS_ATTRIBUTE2_PAGE_ID_PREFIX = "_tsca2";
+
+ private static final String SHOW_CONTROLS_ATTRIBUTE_BAR = "bar";
+
+ private static final String VALIDATOR_PAGE = "testValidator.xhtml";
+
+ private static final String VALIDATOR_PAGE_ID_PREFIX = "_tv";
+
+ private static final String STANDART_ATTRIBUTES_PAGE = "testStandartAttributes.xhtml";
+
+ private static final String STANDART_ATTRIBUTES_ID_PREFIX = "_tsa";
+
+ private static final String IMMEDIATE_ATTRIBUTE_PAGE = "testImmediateAttribute.xhtml";
+
+
+ private static final String IMMEDIATE_ATTRIBUTE_ID_PREFIX = "_tia";
+
+ private static final String VALUE_CHANGE_LISTENER_PAGE = "testValueChangeListener.xhtml";
+
+ private static final String VALUE_CHANGE_LISTENER_ID_PREFIX = "_tvcl";
+
+ private static final String PROCESSING_INVALID_VALUE_PAGE = "testProcessingInvalidValue.xhtml";
+
+ private static final String PROCESSING_INVALID_VALUE_ID_PREFIX = "_tpiv";
+
+ private static final String JS_API_PAGE = "testJSApi.xhtml";
+
+ private static final String JS_API_ID_PREFIX = "_tja";
+
+ private static final String RENDERED_ATTRIBUTE_PAGE = "testRenderedAttribute.xhtml";
+
+ private static final String RENDERED_ATTRIBUTE_ID_PREFIX = "_tra";
+
+ private static final String BASIC_BEHAVIOUR_PAGE = "testBasicBehaviour.xhtml";
+
+ private static final String BASIC_BEHAVIOUR_ID_PREFIX = "_tbb";
+
+ protected String testUrl;
+
+ protected String formId;
+
+ protected String buttonId;
+
+ protected String inplaceId;
+
+ protected String messageId;
+
+ protected String iTempValuePx;
+
+ protected String inplaceValuePrefix;
+
+
+ /**
+ * 'required' and 'requiredMessage' attributes work
+ *
+ * @param template - current template
+ */
+ @Test
+ public void testRequiredAttributes(Template template) {
+ setTestUrl(REQUIRED_ATTRIBUTES_PAGE);
+ init(template);
+
+ selenium.click("id=" + buttonId + REQUIRED_ATTRIBUTES_ID_PREFIX);
+ waitForPageToLoad();
+ checkMessage(messageId + REQUIRED_ATTRIBUTES_ID_PREFIX, "text:requiredMsg", CommonUtils.getSuccessfulTestMessage(inplaceId + REQUIRED_ATTRIBUTES_ID_PREFIX), CommonUtils.getFailedTestMessage(inplaceId + REQUIRED_ATTRIBUTES_ID_PREFIX));
+ }
+
+ /**
+ * Check 'editEvent' attribute
+ *
+ * @param template - current template
+ */
+ @Test
+ public void testEditEventAttribute(Template template) {
+ setTestUrl(EDITEVENT_ATTRIBUTES_PAGE);
+ init(template);
+
+ String iid = inplaceId + EDITEVENT_ATTRIBUTES_ID_PREFIX;
+ selenium.doubleClick(iid);
+ String clip = getStyleAttributeString(iid + iTempValuePx, "clip");
+ check(("rect(auto, auto, auto, auto)".equals(clip)) || ("rect(auto auto auto auto)".equals(clip)),
+ CommonUtils.getSuccessfulTestMessage(iid),
+ CommonUtils.getFailedTestMessage(iid));
+ }
+
+ /**
+ * Check 'controls' facet
+ *
+ * @param template - current template
+ */
+ @Test
+ public void testControlsFacet(Template template) {
+ setTestUrl(CONTROLS_FACET_PAGE);
+ init(template);
+
+ check((isPresentById(CONTROLS_FACET_BN_OK + CONTROLS_FACET_ID_PREFIX) || isPresentById(CONTROLS_FACET_BN_CANCEL + CONTROLS_FACET_ID_PREFIX)),
+ CommonUtils.getSuccessfulTestMessage(inplaceId + CONTROLS_FACET_ID_PREFIX),
+ CommonUtils.getFailedTestMessage(inplaceId + CONTROLS_FACET_ID_PREFIX));
+ }
+
+ /**
+ * Verify component behaviour with showControls="false" attribute
+ *
+ * @param template - current template
+ */
+ @Test
+ public void testShowControlsAttribute1(Template template) {
+ setTestUrl(SHOW_CONTROLS_ATTRIBUTE1_PAGE);
+ init(template);
+
+ String iid = inplaceId + SHOW_CONTROLS_ATTRIBUTE1_PAGE_ID_PREFIX;
+
+ clickById(iid);
+ check(!isVisibleById(iid + SHOW_CONTROLS_ATTRIBUTE_BAR),
+ CommonUtils.getSuccessfulTestMessage(iid),
+ CommonUtils.getFailedTestMessage(iid));
+
+ String clip = getStyleAttributeString(iid + iTempValuePx, "clip");
+ check(("rect(auto, auto, auto, auto)".equals(clip)) || ("rect(auto auto auto auto)".equals(clip)),
+ CommonUtils.getSuccessfulTestMessage(iid),
+ CommonUtils.getFailedTestMessage(iid));
+ //selenium.fireEvent(iid + iTempValuePx, "blur");
+ selenium.focus(buttonId + SHOW_CONTROLS_ATTRIBUTE1_PAGE_ID_PREFIX);
+
+ clip = getStyleAttributeString(iid + iTempValuePx, "clip");
+ check(("rect(0px, 0px, 0px, 0px)".equals(clip)) || ("rect(0px 0px 0px 0px)".equals(clip)),
+ CommonUtils.getSuccessfulTestMessage(iid),
+ CommonUtils.getFailedTestMessage(iid));
+ }
+
+ /**
+ * The same as previous but with showControls="true" attribute
+ *
+ * @param template - current template
+ */
+ @Test
+ public void testShowControlsAttribute2(Template template) {
+ setTestUrl(SHOW_CONTROLS_ATTRIBUTE2_PAGE);
+ init(template);
+
+ String iid = inplaceId + SHOW_CONTROLS_ATTRIBUTE2_PAGE_ID_PREFIX;
+
+ clickById(iid);
+ check(isVisibleById(iid + SHOW_CONTROLS_ATTRIBUTE_BAR),
+ CommonUtils.getSuccessfulTestMessage(iid),
+ CommonUtils.getFailedTestMessage(iid));
+
+ String clip = getStyleAttributeString(iid + iTempValuePx, "clip");
+ check(("rect(auto, auto, auto, auto)".equals(clip)) || ("rect(auto auto auto auto)".equals(clip)),
+ CommonUtils.getSuccessfulTestMessage(iid),
+ CommonUtils.getFailedTestMessage(iid));
+ selenium.focus(buttonId + SHOW_CONTROLS_ATTRIBUTE2_PAGE_ID_PREFIX);
+ clip = getStyleAttributeString(iid + iTempValuePx, "clip");
+ check(("rect(auto, auto, auto, auto)".equals(clip)) || ("rect(auto auto auto auto)".equals(clip)),
+ CommonUtils.getSuccessfulTestMessage(iid),
+ CommonUtils.getFailedTestMessage(iid));
+ }
+
+ /**
+ * Validator defined by component attribute and nested tags work
+ *
+ * @param template - current template
+ */
+ @Test
+ public void testValidator1(Template template) {
+ setTestUrl(VALIDATOR_PAGE);
+ init(template);
+
+ String iid = inplaceId + VALIDATOR_PAGE_ID_PREFIX;
+
+ clickById(buttonId + VALIDATOR_PAGE_ID_PREFIX + "1");
+ waitForAjaxCompletion();
+ check("".equals(getTextById(messageId + VALIDATOR_PAGE_ID_PREFIX + "1")),
+ CommonUtils.getSuccessfulTestMessage(iid + "1"),
+ CommonUtils.getFailedTestMessage(iid + "1"));
+
+ clickById(buttonId + VALIDATOR_PAGE_ID_PREFIX + "2");
+ waitForAjaxCompletion();
+ check("".equals(getTextById(messageId + VALIDATOR_PAGE_ID_PREFIX + "2")),
+ CommonUtils.getSuccessfulTestMessage(iid + "2"),
+ CommonUtils.getFailedTestMessage(iid + "2"));
+ }
+
+ /**
+ * Validator defined by component attribute and nested tags work
+ *
+ * @param template - current template
+ */
+ @Test
+ public void testValidator2(Template template) {
+ setTestUrl(VALIDATOR_PAGE);
+ init(template);
+
+ String iid = inplaceId + VALIDATOR_PAGE_ID_PREFIX;
+
+ setValue(iid + "1", "Pine");
+ setValue(iid + "2", "Pine");
+
+ clickById(buttonId + VALIDATOR_PAGE_ID_PREFIX + "1");
+ waitForAjaxCompletion();
+ check("Value isn't correct!".equals(getTextById(messageId + VALIDATOR_PAGE_ID_PREFIX + "1")),
+ CommonUtils.getSuccessfulTestMessage(iid + "1"),
+ CommonUtils.getFailedTestMessage(iid + "1"));
+
+ clickById(buttonId + VALIDATOR_PAGE_ID_PREFIX + "2");
+ waitForAjaxCompletion();
+ check("Value isn't correct!".equals(getTextById(messageId + VALIDATOR_PAGE_ID_PREFIX + "2")),
+ CommonUtils.getSuccessfulTestMessage(iid + "2"),
+ CommonUtils.getFailedTestMessage(iid + "2"));
+ }
+
+ /**
+ * Immediate = true component works respectively
+ *
+ * @param template - current template
+ */
+ @Test
+ public void testImmediateAttribute(Template template) {
+ setTestUrl(IMMEDIATE_ATTRIBUTE_PAGE);
+ init(template);
+
+ String iid = inplaceId + IMMEDIATE_ATTRIBUTE_ID_PREFIX;
+
+ setValueById(iid + inplaceValuePrefix, "test1");
+ clickById(buttonId + IMMEDIATE_ATTRIBUTE_ID_PREFIX);
+ waitForAjaxCompletion();
+ check("Value isn't correct!".equals(getTextById(messageId + IMMEDIATE_ATTRIBUTE_ID_PREFIX)),
+ CommonUtils.getSuccessfulTestMessage(iid),
+ CommonUtils.getFailedTestMessage(iid));
+ }
+
+ /**
+ * valueChangeListener should fire on submit
+ * and model binding should be updated on value changed
+ *
+ * @param template - current template
+ */
+ @Test
+ public void testValueChangeListener(Template template) {
+ setTestUrl(VALUE_CHANGE_LISTENER_PAGE);
+ init(template);
+
+ String iid = inplaceId + VALUE_CHANGE_LISTENER_ID_PREFIX;
+
+ clickById(iid);
+ setValue(iid, "Aspen");
+ clickById(buttonId + VALUE_CHANGE_LISTENER_ID_PREFIX);
+ waitForAjaxCompletion();
+ check(("Aspen" + InplaceInputTestBean.Messages.VALUECHANGELISTENER_CALLED).equals(getTextById(messageId + VALUE_CHANGE_LISTENER_ID_PREFIX)),
+ CommonUtils.getSuccessfulTestMessage(iid),
+ CommonUtils.getFailedTestMessage(iid));
+ }
+
+
+ /**
+ * style and classes, standard HTML attributes are output to client
+ *
+ * @param template - current template
+ */
+ @Test
+ public void testStandartAttributes(Template template) {
+ setTestUrl(STANDART_ATTRIBUTES_PAGE);
+ init(template);
+
+ String iid = inplaceId + STANDART_ATTRIBUTES_ID_PREFIX;
+
+ List<SeleniumEvent> events = new ArrayList<SeleniumEvent>();
+ events.add(SeleniumEvent.ONMOUSEMOVE);
+ events.add(SeleniumEvent.ONMOUSEOUT);
+ events.add(SeleniumEvent.ONMOUSEOVER);
+ events.add(SeleniumEvent.ONCLICK);
+ events.add(SeleniumEvent.ONDBLCLICK);
+ events.add(SeleniumEvent.ONKEYDOWN);
+ events.add(SeleniumEvent.ONKEYPRESS);
+ events.add(SeleniumEvent.ONKEYUP);
+ events.add(SeleniumEvent.ONMOUSEUP);
+
+ assertClassNames(iid,new String [] {"classForInplaceinput"}, "Component's rendering invalid", true);
+ String color = getStyleAttributeString(iid, "color");
+ check(("rgb(255, 0, 0)".equals(color)) || ("red".equals(color)),
+ CommonUtils.getSuccessfulTestMessage(iid),
+ CommonUtils.getFailedTestMessage(iid));
+
+ assertEvents(iid, events);
+ }
+
+ /**
+ * Component displays submitted value after
+ * submission of invalid value
+ *
+ * @param template - current template
+ */
+ @Test
+ public void testProcessingInvalidValue(Template template) {
+ setTestUrl(PROCESSING_INVALID_VALUE_PAGE);
+ init(template);
+
+ String iid = inplaceId + PROCESSING_INVALID_VALUE_ID_PREFIX;
+ String newVlaue = "Aspen";
+ setValue(iid, newVlaue);
+ clickById(buttonId + PROCESSING_INVALID_VALUE_ID_PREFIX);
+ waitForAjaxCompletion();
+ String value = getTextById(iid);
+ check(newVlaue.equals(value),
+ CommonUtils.getSuccessfulTestMessage(iid),
+ CommonUtils.getFailedTestMessage(iid));
+ }
+
+ /**
+ * Verify JS API of the component
+ *
+ * @param template - current template
+ */
+ @Test
+ public void testJSApi(Template template) {
+ setTestUrl(JS_API_PAGE);
+ init(template);
+
+ String iid = inplaceId + JS_API_ID_PREFIX;
+
+ selenium.runScript("var inplace = ($('" + iid + "')).component;");
+ Assert.assertTrue("test".equals(selenium.getEval("window.inplace.getValue()")));
+
+ //testJSApiSetValue();
+ setValue(iid, "999");
+ Assert.assertTrue("999".equals(selenium.getEval("window.inplace.getValue()")));
+
+ selenium.getEval("window.inplace.edit()");
+ String clip = getStyleAttributeString(iid + iTempValuePx, "clip");
+ check(("rect(auto, auto, auto, auto)".equals(clip)) || ("rect(auto auto auto auto)".equals(clip)),
+ CommonUtils.getSuccessfulTestMessage(iid),
+ CommonUtils.getFailedTestMessage(iid));
+
+ setValue(iid, "Aspen");
+ Assert.assertEquals("Aspen", getValueById(iid + iTempValuePx), CommonUtils.getFailedTestMessage(iid));
+
+ selenium.click(iid);
+ selenium.runScript("document.getElementById('" + iid + iTempValuePx + "').value = '999';");
+ selenium.getEval("window.inplace.cancel();");
+ Assert.assertEquals("Aspen", getValueById(iid + iTempValuePx), CommonUtils.getFailedTestMessage(iid));
+ }
+
+ protected void testJSApiSetValue() {
+ selenium.getEval("window.inplace.setValue(\"\", {value: \"JSApi\"})");
+ Assert.assertTrue("JSApi".equals(selenium.getEval("window.inplace.getValue()")));
+ }
+
+ protected abstract void setValue(String id, String newValue);
+
+ /**
+ * Component is present on the page and shows model value
+ *
+ * @param template - current temlate
+ */
+ @Test
+ public void testBasicBehaviour(Template template) {
+ setTestUrl(BASIC_BEHAVIOUR_PAGE);
+ init(template);
+
+ AssertValueEquals(inplaceId + BASIC_BEHAVIOUR_ID_PREFIX + inplaceValuePrefix, "test");
+ }
+
+ /**
+ * Component with rendered = false is not present on the page
+ *
+ * @param template - current template
+ */
+ @Test
+ public void testRenderedAttribute(Template template) {
+ setTestUrl(RENDERED_ATTRIBUTE_PAGE);
+ init(template);
+
+ AssertNotRendered(inplaceId + RENDERED_ATTRIBUTE_ID_PREFIX);
+ }
+
+ protected void typeAndCheck(String iid, String word, String expectedWord) {
+ typeWord(iid, word);
+ checkMessage(iid, expectedWord,
+ CommonUtils.getSuccessfulTestMessage(iid),
+ CommonUtils.getFailedTestMessage(iid));
+ }
+
+ protected void typeWord(String iid, String word) {
+ clickById(iid);
+ type(iid + "tempValue", word);
+ selenium.fireEvent(iid + "tempValue", "blur");
+ }
+
+ protected void checkMessage(String elementId, String expectedValue, String okMsg, String errMsg) {
+ String currentValue = getTextById(elementId);
+ check(currentValue.indexOf(expectedValue) != -1, okMsg, errMsg); //firefox returns '// + currentVlaue'
+ }
+
+ private void check(boolean expression, String okMsg, String errMsg) {
+ if (expression) {
+ writeStatus(okMsg);
+ } else {
+ writeStatus(errMsg, true);
+ Assert.fail(errMsg);
+ }
+ }
+
+ protected void init(Template template) {
+ renderPage(template);
+ initIds();
+ }
+
+ public void initIds() {
+ formId = getParentId() + "_form:";
+ buttonId = formId + "bn";
+ messageId = "text";
+ }
+
+ @Override
+ public String getTestUrl() {
+ return testUrl;
+ }
+
+ public abstract void setTestUrl(String testUrl);
+
+}
17 years, 6 months
JBoss Rich Faces SVN: r11276 - trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-11-20 10:43:45 -0500 (Thu, 20 Nov 2008)
New Revision: 11276
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testBasicBehaviour.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testControlsFacet.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testDefaultLabelAndSpaces.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testEditEventAttribute.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testImmediateAttribute.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testJSApi.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testProcessingInvalidValue.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testRenderedAttribute.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testRequiredAttributes.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testShowControlsAttribute1.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testShowControlsAttribute2.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testStandartAttributes.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testValidator.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testValueChangeListener.xhtml
Log:
tests for inplaceinput
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testBasicBehaviour.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testBasicBehaviour.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testBasicBehaviour.xhtml 2008-11-20 15:43:45 UTC (rev 11276)
@@ -0,0 +1,26 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ template="../../template/caseTemplate.xhtml">
+ <ui:define name="caseName">testBasicBehaviour</ui:define>
+ <ui:define name="caseBody">
+ <h:form id="_form">
+ <h:panelGroup id="group_tbb">
+ <table cellpadding="5" >
+ <tr>
+ <td></td>
+ <td>
+ <rich:inplaceSelect id="ii_tbb" value="#{inplaceInputBean.iiValue}">
+ <f:selectItems value="#{inplaceSelectBean.treeItems}"/>
+ </rich:inplaceSelect>
+ </td>
+ </tr>
+ </table>
+ </h:panelGroup>
+ </h:form>
+ </ui:define>
+</ui:composition>
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testControlsFacet.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testControlsFacet.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testControlsFacet.xhtml 2008-11-20 15:43:45 UTC (rev 11276)
@@ -0,0 +1,21 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ template="../../template/caseTemplate.xhtml">
+ <ui:define name="caseName">testControlsFacet</ui:define>
+ <ui:define name="caseBody">
+ <h:form id="_form">
+ <rich:inplaceSelect id="ii_tcf" value="#{inplaceSelectBean.isValue}" showControls="true">
+ <f:selectItems value="#{inplaceSelectBean.treeItems}"/>
+ <f:facet name="controls">
+ <button id="ok_tcf">ok</button>
+ <button id="canclel_tcf">cancel</button>
+ </f:facet>
+ </rich:inplaceSelect>
+ </h:form>
+ </ui:define>
+</ui:composition>
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testDefaultLabelAndSpaces.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testDefaultLabelAndSpaces.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testDefaultLabelAndSpaces.xhtml 2008-11-20 15:43:45 UTC (rev 11276)
@@ -0,0 +1,17 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ template="../../template/caseTemplate.xhtml">
+ <ui:define name="caseName">testControlsFacet</ui:define>
+ <ui:define name="caseBody">
+ <h:form id="_form">
+ <rich:inplaceSelect id="ii_dfas" value="" defaultLabel="defaultLabel">
+ <f:selectItems value="#{inplaceSelectBean.treeItems}"/>
+ </rich:inplaceSelect>
+ </h:form>
+ </ui:define>
+</ui:composition>
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testEditEventAttribute.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testEditEventAttribute.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testEditEventAttribute.xhtml 2008-11-20 15:43:45 UTC (rev 11276)
@@ -0,0 +1,19 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ template="../../template/caseTemplate.xhtml">
+ <ui:define name="caseName">testEditEventAttribute</ui:define>
+ <ui:define name="caseBody">
+ <ui:include src="includes/testBody.xhtml">
+ <ui:param name="test_prefix" value="teea"/>
+ <ui:param name="required" value="false"/>
+ <ui:param name="value" value="value"/>
+ <ui:param name="requiredMessage" value="" />
+ <ui:param name="editEvent" value="ondblclick" />
+ </ui:include>
+ </ui:define>
+</ui:composition>
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testImmediateAttribute.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testImmediateAttribute.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testImmediateAttribute.xhtml 2008-11-20 15:43:45 UTC (rev 11276)
@@ -0,0 +1,29 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ template="../../template/caseTemplate.xhtml">
+ <ui:define name="caseName">testImmediateAttribute</ui:define>
+ <ui:define name="caseBody">
+ <h:panelGroup id="group_tia">
+ <h:form id="_form">
+ <table cellpadding="5" >
+ <tr>
+ <td></td>
+ <td>
+ <h:inputText value="" required="true" ></h:inputText>
+ <rich:inplaceSelect id="ii_tia" value="#{inplaceSelectBean.isValue}" validator="#{inplaceSelectBean.validator}" immediate="true">
+ <f:selectItems value="#{inplaceSelectBean.treeItems}"/>
+ </rich:inplaceSelect>
+ <a4j:commandButton id="bn_tia" reRender="group_tia" value="Submit"/>
+ </td>
+ <td><span id="text_tia">#{inplaceSelectBean.isValue}<h:messages /></span></td>
+ </tr>
+ </table>
+ </h:form>
+ </h:panelGroup>
+ </ui:define>
+</ui:composition>
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testJSApi.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testJSApi.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testJSApi.xhtml 2008-11-20 15:43:45 UTC (rev 11276)
@@ -0,0 +1,31 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ template="../../template/caseTemplate.xhtml">
+ <ui:define name="caseName">testJSApi</ui:define>
+ <ui:define name="caseBody">
+ <h:form id="_form">
+ <h:panelGroup id="group_tpiv">
+ <table cellpadding="5" >
+ <tr>
+ <td></td>
+ <td>
+ <rich:inplaceSelect id="ii_tja" value="#{inplaceSelectBean.isValue}" showControls="true">
+ <f:selectItems value="#{inplaceSelectBean.treeItems}"/>
+ </rich:inplaceSelect>
+
+ <button id="okButton_tja" onclick="#{rich:component('ii_tja')}.save();return false;">ok</button>
+ <button id="cancelButton_tja" onclick="#{rich:component('ii_tja')}.cancel();return false;">cancel</button>
+
+ </td>
+ <td></td>
+ </tr>
+ </table>
+ </h:panelGroup>
+ </h:form>
+ </ui:define>
+</ui:composition>
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testProcessingInvalidValue.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testProcessingInvalidValue.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testProcessingInvalidValue.xhtml 2008-11-20 15:43:45 UTC (rev 11276)
@@ -0,0 +1,29 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ template="../../template/caseTemplate.xhtml">
+ <ui:define name="caseName">testValidator</ui:define>
+ <ui:define name="caseBody">
+ <h:form id="_form">
+ <h:panelGroup id="group_tpiv">
+ <table cellpadding="5" >
+ <tr>
+ <td></td>
+ <td>
+ <rich:inplaceSelect id="ii_tpiv" value="#{inplaceSelectBean.isNumberValue}">
+ <f:selectItems value="#{inplaceSelectBean.treeItems}"/>
+ <f:convertNumber integerOnly="true"/>
+ </rich:inplaceSelect>
+ <a4j:commandButton id="bn_tpiv" reRender="group_tpiv" value="Submit"/>
+ </td>
+ <td><span id="text_tpiv"><h:message for="ii_tpiv"/></span></td>
+ </tr>
+ </table>
+ </h:panelGroup>
+ </h:form>
+ </ui:define>
+</ui:composition>
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testRenderedAttribute.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testRenderedAttribute.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testRenderedAttribute.xhtml 2008-11-20 15:43:45 UTC (rev 11276)
@@ -0,0 +1,26 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ template="../../template/caseTemplate.xhtml">
+ <ui:define name="caseName">testRenderedAttribute</ui:define>
+ <ui:define name="caseBody">
+ <h:form id="_form">
+ <h:panelGroup id="group_tra">
+ <table cellpadding="5" >
+ <tr>
+ <td></td>
+ <td>
+ <rich:inplaceSelect id="ii_tra" value="#{inplaceSelectBean.isValue}" rendered="false">
+ <f:selectItems value="#{inplaceSelectBean.treeItems}"/>
+ </rich:inplaceSelect>
+ </td>
+ </tr>
+ </table>
+ </h:panelGroup>
+ </h:form>
+ </ui:define>
+</ui:composition>
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testRequiredAttributes.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testRequiredAttributes.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testRequiredAttributes.xhtml 2008-11-20 15:43:45 UTC (rev 11276)
@@ -0,0 +1,19 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ template="../../template/caseTemplate.xhtml">
+ <ui:define name="caseName">testRequiredAttributes</ui:define>
+ <ui:define name="caseBody">
+ <ui:include src="includes/testBody.xhtml">
+ <ui:param name="test_prefix" value="tra"/>
+ <ui:param name="required" value="true"/>
+ <ui:param name="value" value="#{inplaceSelectBean.tree}"/>
+ <ui:param name="requiredMessage" value="requiredMsg" />
+ <ui:param name="editEvent" value="" />
+ </ui:include>
+ </ui:define>
+</ui:composition>
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testShowControlsAttribute1.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testShowControlsAttribute1.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testShowControlsAttribute1.xhtml 2008-11-20 15:43:45 UTC (rev 11276)
@@ -0,0 +1,20 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ template="../../template/caseTemplate.xhtml">
+ <ui:define name="caseName">testShowControlsAttribute</ui:define>
+ <ui:define name="caseBody">
+ <ui:include src="includes/testBody.xhtml">
+ <ui:param name="test_prefix" value="tsca1"/>
+ <ui:param name="required" value="false"/>
+ <ui:param name="value" value="#{inplaceSelectBean.isValue}"/>
+ <ui:param name="requiredMessage" value="" />
+ <ui:param name="showControls" value="false" />
+ <ui:param name="editEvent" value="onclick" />
+ </ui:include>
+ </ui:define>
+</ui:composition>
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testShowControlsAttribute2.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testShowControlsAttribute2.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testShowControlsAttribute2.xhtml 2008-11-20 15:43:45 UTC (rev 11276)
@@ -0,0 +1,20 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ template="../../template/caseTemplate.xhtml">
+ <ui:define name="caseName">testShowControlsAttribute2</ui:define>
+ <ui:define name="caseBody">
+ <ui:include src="includes/testBody.xhtml">
+ <ui:param name="test_prefix" value="tsca2"/>
+ <ui:param name="required" value="false"/>
+ <ui:param name="value" value="#{inplaceSelectBean.isValue}"/>
+ <ui:param name="requiredMessage" value="" />
+ <ui:param name="showControls" value="true" />
+ <ui:param name="editEvent" value="onclick" />
+ </ui:include>
+ </ui:define>
+</ui:composition>
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testStandartAttributes.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testStandartAttributes.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testStandartAttributes.xhtml 2008-11-20 15:43:45 UTC (rev 11276)
@@ -0,0 +1,41 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ template="../../template/caseTemplate.xhtml">
+ <ui:define name="caseName">testStandartAttributes</ui:define>
+ <ui:define name="caseBody">
+ <style>
+ .classForInplaceinput {
+ color: red;
+ }
+ </style>
+ <h:form id="_form">
+ <table cellpadding="5" >
+ <tr>
+ <td></td>
+ <td>
+ <rich:inplaceSelect id="ii_tsa" value="#{inplaceSelectBean.isValue}" style="color: red"
+ styleClass="classForInplaceinput"
+ onclick="EventQueue.fire('onclick')"
+ ondblclick="EventQueue.fire('ondblclick')"
+ onkeydown="EventQueue.fire('onkeydown')"
+ onkeypress="EventQueue.fire('onkeypress')"
+ onkeyup="EventQueue.fire('onkeyup')"
+ onmousedown="EventQueue.fire('onmousedown')"
+ onmousemove="EventQueue.fire('onmousemove')"
+ onmouseout="EventQueue.fire('onmouseout')"
+ onmouseover="EventQueue.fire('onmouseover')"
+ onmouseup="EventQueue.fire('onmouseup')">
+ <f:selectItems value="#{inplaceSelectBean.treeItems}"/>
+ </rich:inplaceSelect>
+ </td>
+ <td></td>
+ </tr>
+ </table>
+ </h:form>
+ </ui:define>
+</ui:composition>
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testValidator.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testValidator.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testValidator.xhtml 2008-11-20 15:43:45 UTC (rev 11276)
@@ -0,0 +1,39 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ template="../../template/caseTemplate.xhtml">
+ <ui:define name="caseName">testValidator</ui:define>
+ <ui:define name="caseBody">
+ <h:form id="_form">
+ <h:panelGroup id="group_tv2">
+ <table cellpadding="5" >
+ <tr>
+ <td>1</td>
+ <td>
+ <rich:inplaceSelect id="ii_tv1" value="#{inplaceSelectBean.isValue}" validator="#{inplaceSelectBean.validator}">
+ <f:selectItems value="#{inplaceSelectBean.treeItems}"/>
+ </rich:inplaceSelect>
+ <a4j:commandButton id="bn_tv1" reRender="group_tv2" value="Submit"/>
+ </td>
+ <td><span id="text_tv1"><h:message for="ii_tv1"/></span></td>
+ </tr>
+ <tr>
+ <td>2</td>
+ <td>
+ <rich:inplaceSelect id="ii_tv2" value="#{inplaceSelectBean.isValue}" >
+ <f:selectItems value="#{inplaceSelectBean.treeItems}"/>
+ <f:validator validatorId="inplaceInputValidator" />
+ </rich:inplaceSelect>
+ <a4j:commandButton id="bn_tv2" reRender="group_tv2" value="Submit"/>
+ </td>
+ <td><span id="text_tv2"><h:message for="ii_tv2"></h:message></span></td>
+ </tr>
+ </table>
+ </h:panelGroup>
+ </h:form>
+ </ui:define>
+</ui:composition>
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testValueChangeListener.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testValueChangeListener.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceSelect/testValueChangeListener.xhtml 2008-11-20 15:43:45 UTC (rev 11276)
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ template="../../template/caseTemplate.xhtml">
+ <ui:define name="caseName">testValueChangeListener</ui:define>
+ <ui:define name="caseBody">
+ <h:panelGroup id="group_tvcl">
+ <h:form id="_form">
+ <table cellpadding="5" >
+ <tr>
+ <td></td>
+ <td>
+ <rich:inplaceSelect id="ii_tvcl" value="#{inplaceSelectBean.isValue}" valueChangeListener="#{inplaceSelectBean.valueChangeListener}">
+ <f:selectItems value="#{inplaceSelectBean.treeItems}"/>
+ </rich:inplaceSelect>
+ <a4j:commandButton id="bn_tvcl" reRender="group_tvcl" value="Submit"/>
+ </td>
+ <td><span id="text_tvcl">#{inplaceSelectBean.isValue}#{inplaceSelectBean.newValue}</span></td>
+ </tr>
+ </table>
+ </h:form>
+ </h:panelGroup>
+ </ui:define>
+</ui:composition>
17 years, 6 months
JBoss Rich Faces SVN: r11275 - in trunk/test-applications/seleniumTest/richfaces/src/main: webapp/pages/inplaceInput and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-11-20 10:42:15 -0500 (Thu, 20 Nov 2008)
New Revision: 11275
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/InplaceSelectTestBean.java
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/includes/testBody.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testProcessingInvalidValue.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testValidator.xhtml
Log:
tests for inplaceselect
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/InplaceSelectTestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/InplaceSelectTestBean.java 2008-11-20 15:33:04 UTC (rev 11274)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/InplaceSelectTestBean.java 2008-11-20 15:42:15 UTC (rev 11275)
@@ -4,15 +4,28 @@
import java.util.Arrays;
import java.util.List;
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.event.ValueChangeEvent;
import javax.faces.model.SelectItem;
+import javax.faces.validator.ValidatorException;
+import org.ajax4jsf.bean.InplaceInputTestBean.Messages;
+
public class InplaceSelectTestBean {
private List<SelectItem> treeItems = new ArrayList<SelectItem>();
- private List<String> treeNames = Arrays.asList("Pine", "Birch", "Aspen", "Spruce", "Oak", "Maple", "Ash", "Lime");
+ private List<String> treeNames = Arrays.asList("Pine", "Birch", "Aspen", "Spruce", "Oak", "Maple", "Ash", "Lime", "test", "999");
private String tree = "";
+
+ private String isValue = "test";
+
+ private String isNumberValue = "999";
+
+ private String newValue;
/**
* Gets value of tree field.
@@ -47,5 +60,61 @@
public List<SelectItem> getTreeItems() {
return treeItems;
}
+
+ public void validator(FacesContext arg0, UIComponent arg1, Object arg2) {
+ if (!"test".equals(arg2)) {
+ throw new ValidatorException(new FacesMessage("Value isn't correct!"));
+ }
+ }
+
+ public void valueChangeListener(ValueChangeEvent ve) {
+ setNewValue(Messages.VALUECHANGELISTENER_CALLED);
+ }
+
+ public void action() {
+ setIsValue(InplaceInputTestBean.Messages.ACTION_CALLED);
+ }
+ /**
+ * @return the isValue
+ */
+ public String getIsValue() {
+ return isValue;
+ }
+
+ /**
+ * @param isValue the isValue to set
+ */
+ public void setIsValue(String isValue) {
+ this.isValue = isValue;
+ }
+
+ /**
+ * @return the newValue
+ */
+ public String getNewValue() {
+ return newValue;
+ }
+
+ /**
+ * @param newValue the newValue to set
+ */
+ public void setNewValue(String newValue) {
+ this.newValue = newValue;
+ }
+
+ /**
+ * @return the isNumberValue
+ */
+ public String getIsNumberValue() {
+ return isNumberValue;
+ }
+
+ /**
+ * @param isNumberValue the isNumberValue to set
+ */
+ public void setIsNumberValue(String isNumberValue) {
+ this.isNumberValue = isNumberValue;
+ }
+
}
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/includes/testBody.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/includes/testBody.xhtml 2008-11-20 15:33:04 UTC (rev 11274)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/includes/testBody.xhtml 2008-11-20 15:42:15 UTC (rev 11275)
@@ -15,5 +15,6 @@
<br/>
<br/>
<h:commandButton id="bn_#{test_prefix}" action="#{inplaceInputBean.action}" value="Submit"></h:commandButton>
+
</h:form>
</ui:composition>
\ No newline at end of file
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testProcessingInvalidValue.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testProcessingInvalidValue.xhtml 2008-11-20 15:33:04 UTC (rev 11274)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testProcessingInvalidValue.xhtml 2008-11-20 15:42:15 UTC (rev 11275)
@@ -14,7 +14,7 @@
<tr>
<td></td>
<td>
- <rich:inplaceInput id="ii_tpiv" value="999">
+ <rich:inplaceInput id="ii_tpiv" value="#{inplaceInputBean.iiValue}">
<f:convertNumber integerOnly="true"/>
</rich:inplaceInput>
<a4j:commandButton id="bn_tpiv" reRender="group_tpiv" value="Submit"/>
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testValidator.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testValidator.xhtml 2008-11-20 15:33:04 UTC (rev 11274)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testValidator.xhtml 2008-11-20 15:42:15 UTC (rev 11275)
@@ -14,7 +14,7 @@
<tr>
<td>1</td>
<td>
- <rich:inplaceInput id="ii_tv1" value="test" validator="#{inplaceInputBean.validator}">
+ <rich:inplaceInput id="ii_tv1" value="#{inplaceInputBean.iiValue}" validator="#{inplaceInputBean.validator}">
</rich:inplaceInput>
<a4j:commandButton id="bn_tv1" reRender="group_tv2" value="Submit"/>
</td>
@@ -23,7 +23,7 @@
<tr>
<td>2</td>
<td>
- <rich:inplaceInput id="ii_tv2" value="test" >
+ <rich:inplaceInput id="ii_tv2" value="#{inplaceInputBean.iiValue}" >
<f:validator validatorId="inplaceInputValidator" />
</rich:inplaceInput>
<a4j:commandButton id="bn_tv2" reRender="group_tv2" value="Submit"/>
17 years, 6 months
JBoss Rich Faces SVN: r11274 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: smukhina
Date: 2008-11-20 10:33:04 -0500 (Thu, 20 Nov 2008)
New Revision: 11274
Modified:
trunk/docs/userguide/en/src/main/docbook/included/listShuttle.xml
trunk/docs/userguide/en/src/main/docbook/included/orderingList.xml
Log:
https://jira.jboss.org/jira/browse/RF-398 - Language and content correction
Modified: trunk/docs/userguide/en/src/main/docbook/included/listShuttle.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/listShuttle.xml 2008-11-20 15:23:19 UTC (rev 11273)
+++ trunk/docs/userguide/en/src/main/docbook/included/listShuttle.xml 2008-11-20 15:33:04 UTC (rev 11274)
@@ -358,11 +358,11 @@
<!--Sorting API -->
<row>
<entry>Home</entry>
- <entry>Moves selected set to the top of a list</entry>
+ <entry>Moves selected set to the top of a list (for target list only)</entry>
</row>
<row>
<entry>End</entry>
- <entry>Moves selected set to the bottomof a list</entry>
+ <entry>Moves selected set to the bottom of a list (for target list only)</entry>
</row>
<row>
<entry>CTRL+Up arrow</entry>
Modified: trunk/docs/userguide/en/src/main/docbook/included/orderingList.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/orderingList.xml 2008-11-20 15:23:19 UTC (rev 11273)
+++ trunk/docs/userguide/en/src/main/docbook/included/orderingList.xml 2008-11-20 15:33:04 UTC (rev 11274)
@@ -350,7 +350,7 @@
</row>
<row>
<entry>Page Down</entry>
- <entry>Moves selected set to the bottomof a list</entry>
+ <entry>Moves selected set to the bottom of a list</entry>
</row>
<row>
<entry>CTRL+Up arrow</entry>
17 years, 6 months
JBoss Rich Faces SVN: r11273 - trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-11-20 10:23:19 -0500 (Thu, 20 Nov 2008)
New Revision: 11273
Modified:
trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererDelegate.java
Log:
RF-2937
Modified: trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererDelegate.java
===================================================================
--- trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererDelegate.java 2008-11-20 15:22:55 UTC (rev 11272)
+++ trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererDelegate.java 2008-11-20 15:23:19 UTC (rev 11273)
@@ -21,7 +21,6 @@
package org.richfaces.renderkit.html;
-import javax.faces.FacesException;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
@@ -33,11 +32,21 @@
protected void initializeStyles(FacesContext context, UIComponent menuItem,
boolean disabled, ComponentVariables variables) {
UIComponent parentMenu = getParentMenu(context, menuItem);
- Object itemClass = parentMenu.getAttributes().get("itemClass");
- Object itemStyle = parentMenu.getAttributes().get("itemStyle");
- Object disabledItemClass = parentMenu.getAttributes().get("disabledItemClass");
- Object disabledItemStyle = parentMenu.getAttributes().get("disabledItemStyle");
- Object selectItemClass = parentMenu.getAttributes().get("selectItemClass");
+
+ Object itemClass = "";
+ Object itemStyle = "";
+ Object disabledItemClass = "";
+ Object disabledItemStyle = "";
+ Object selectItemClass = "";
+
+ if (parentMenu != null) {
+ itemClass = parentMenu.getAttributes().get("itemClass");
+ itemStyle = parentMenu.getAttributes().get("itemStyle");
+ disabledItemClass = parentMenu.getAttributes().get("disabledItemClass");
+ disabledItemStyle = parentMenu.getAttributes().get("disabledItemStyle");
+ selectItemClass = parentMenu.getAttributes().get("selectItemClass");
+
+ }
Object selectClass = menuItem.getAttributes().get("selectClass");
Object styleClass = menuItem.getAttributes().get("styleClass");
Object style = menuItem.getAttributes().get("style");
@@ -126,9 +135,14 @@
Object selectStyle = menuItem.getAttributes().get("selectStyle");
UIComponent parentMenu = getParentMenu(context, menuItem);
- Object selectItemStyle = parentMenu.getAttributes().get("selectItemStyle");
- Object itemStyle = parentMenu.getAttributes().get("itemStyle");
+ Object selectItemStyle = null;
+ Object itemStyle = null;
+ if (parentMenu != null) {
+ selectItemStyle = parentMenu.getAttributes().get("selectItemStyle");
+ itemStyle = parentMenu.getAttributes().get("itemStyle");
+ }
+
if (null == selectStyle) {
selectStyle = "";
}
@@ -164,8 +178,9 @@
}
parent = parent.getParent();
}
- throw new FacesException( "Parent menu for menu group (id="
- + menuItem.getClientId(context) + ") has not been found.");
+ return null;
+// throw new FacesException( "Parent menu for menu group (id="
+// + menuItem.getClientId(context) + ") has not been found.");
}
protected Class getComponentClass() {
17 years, 6 months
JBoss Rich Faces SVN: r11272 - trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-11-20 10:22:55 -0500 (Thu, 20 Nov 2008)
New Revision: 11272
Modified:
trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java
Log:
fix error with getSelectedItemLabel method
Modified: trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java
===================================================================
--- trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java 2008-11-20 14:50:44 UTC (rev 11271)
+++ trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java 2008-11-20 15:22:55 UTC (rev 11272)
@@ -128,12 +128,16 @@
}
public String getSelectedItemLabel(FacesContext context, UIInplaceSelect component) {
- Object submittedValue = component.getSubmittedValue();
- Object value = submittedValue != null ? getConvertedValue(context, component, submittedValue) : component.getAttributes().get("value");
- if (value == null || "".equals(value)) {
- return createDefaultLabel(component);
+ String selectedItemLabel = (String)component.getSubmittedValue();
+ if(selectedItemLabel == null) {
+ Object value = component.getAttributes().get("value");
+ if (value == null || "".equals(value)) {
+ selectedItemLabel = createDefaultLabel(component);
+ } else {
+ selectedItemLabel = getItemLabel(context, component, value);
+ }
}
- return getItemLabel(context, component, value);
+ return selectedItemLabel;
}
protected String getItemLabel(FacesContext context, UIInplaceSelect component, Object value) {
17 years, 6 months
JBoss Rich Faces SVN: r11271 - in trunk/test-applications/seleniumTest/richfaces/src: test/java/org/richfaces/testng and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-11-20 09:50:44 -0500 (Thu, 20 Nov 2008)
New Revision: 11271
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/orderingList/orderingListTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/OrderingListTest.java
Log:
RF-4943
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/orderingList/orderingListTest.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/OrderingListTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/OrderingListTest.java 2008-11-20 14:45:18 UTC (rev 11270)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/OrderingListTest.java 2008-11-20 14:50:44 UTC (rev 11271)
@@ -21,7 +21,13 @@
package org.richfaces.testng;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
import org.ajax4jsf.template.Template;
+import org.richfaces.SeleniumEvent;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
import org.testng.annotations.Test;
@@ -82,6 +88,30 @@
private String immediateId;
+ /**
+ * style and classes, standard HTML attributes are output to client
+ */
+ @Test
+ public void testHTMLAttributes(Template template) {
+ renderPage(template, initMethod);
+ initFields();
+ Map<String, String> styleAttributes = new HashMap<String, String>();
+ styleAttributes.put("color", "blue");
+ styleAttributes.put("text-decoration", "underline");
+
+ List<SeleniumEvent> events = new ArrayList<SeleniumEvent>();
+ events.add(SeleniumEvent.ONCLICK);
+ events.add(SeleniumEvent.ONDBLCLICK);
+ events.add(SeleniumEvent.ONMOUSEMOVE);
+ events.add(SeleniumEvent.ONMOUSEOUT);
+ events.add(SeleniumEvent.ONMOUSEOVER);
+
+ assertClassNames(orderingListId,new String [] {"noname"}, "Component's rendering invalid", true);
+ assertStyleAttributes(orderingListId, styleAttributes);
+
+ assertEvents(orderingListId, events);
+ }
+
/**
* respective number of columns created; header dimensions are ok
*/
17 years, 6 months