Author: andrei_exadel
Date: 2008-12-16 13:56:51 -0500 (Tue, 16 Dec 2008)
New Revision: 11835
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/calendar/testImmediate.xhtml
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java
Log:
RF-5230
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/calendar/testImmediate.xhtml
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/calendar/testImmediate.xhtml
(rev 0)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/calendar/testImmediate.xhtml 2008-12-16
18:56:51 UTC (rev 11835)
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
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">
+
+<ui:composition template="#{templateBean.template}">
+ <ui:define name="component">
+ <h:form id="_form">
+ <h:inputText id="input" value=""
required="true"/>
+ <h:message id="message" for="input"></h:message>
+ <rich:calendar
+ id="calendar"
+ mode="client"
+ popup="false"
+ immediate="true"
+ value="#{calendarBean.selectedDate}">
+ <f:validator validatorId="autoTestValidator" />
+ </rich:calendar>
+ <h:commandButton id="submit"
value="Submit"></h:commandButton>
+ </h:form>
+ </ui:define>
+</ui:composition>
+</html>
+
+
\ No newline at end of file
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java 2008-12-16
18:51:55 UTC (rev 11834)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java 2008-12-16
18:56:51 UTC (rev 11835)
@@ -64,6 +64,8 @@
static final String BUTTON_RELATED_TEST_URL =
"pages/calendar/buttonRelatedAttributesTest.xhtml";
static final String LAYOUT_TESTS_URL = "pages/calendar/layoutTests.xhtml";
+
+ static final String IMMEDIATE_TEST_URL =
"pages/calendar/testImmediate.xhtml";
static final String CONTROLS_FORM_ID = "_controls:";
@@ -406,6 +408,19 @@
Assert.fail("Calendar displays invalid date. It should contain
["+expected+"]. But was ["+headerDate+"]");
}
}
+
+ @Test
+ public void testImmediate(Template template) {
+ renderPage(IMMEDIATE_TEST_URL, template, RESET_METHOD);
+ initIds(getParentId());
+
+ String hMessageId = getParentId() + FORM_ID + "message";
+ String commandId = getParentId() + FORM_ID + "submit";
+ clickCommandAndWait(commandId);
+
+ AssertNotPresent(hMessageId, "Immediate attribute does not work. h:message for
required input should be absent, because validation for calendar should be failed before
on APPLY_REQUEST phase.");
+
+ }
@Test
public void testAjaxSingle(Template template) {