Author: amarkhel
Date: 2010-11-29 09:35:51 -0500 (Mon, 29 Nov 2010)
New Revision: 20206
Added:
trunk/ui/input/ui/src/test/java/org/richfaces/component/
trunk/ui/input/ui/src/test/java/org/richfaces/component/CalendarBean.java
trunk/ui/input/ui/src/test/java/org/richfaces/component/CalendarDataModelImpl.java
trunk/ui/input/ui/src/test/java/org/richfaces/component/CalendarDataModelItemImpl.java
trunk/ui/input/ui/src/test/java/org/richfaces/component/CalendarRenderTest.java
trunk/ui/input/ui/src/test/resources/org/richfaces/component/
trunk/ui/input/ui/src/test/resources/org/richfaces/component/calendarContent.xmlunit.xml
trunk/ui/input/ui/src/test/resources/org/richfaces/component/calendarScript.xmlunit.xml
trunk/ui/input/ui/src/test/resources/org/richfaces/component/calendarTest.xhtml
trunk/ui/input/ui/src/test/resources/org/richfaces/component/faces-config.xml
Log:
RF-9171:Calendar: server side tests development (junit)
Added: trunk/ui/input/ui/src/test/java/org/richfaces/component/CalendarBean.java
===================================================================
--- trunk/ui/input/ui/src/test/java/org/richfaces/component/CalendarBean.java
(rev 0)
+++ trunk/ui/input/ui/src/test/java/org/richfaces/component/CalendarBean.java 2010-11-29
14:35:51 UTC (rev 20206)
@@ -0,0 +1,100 @@
+package org.richfaces.component;
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.Locale;
+
+import javax.faces.event.ValueChangeEvent;
+
+public class CalendarBean {
+
+ public static int CURRENT_YEAR = 2010;
+ public static int CURRENT_MONTH = 10;
+ public static int CURRENT_DAY = 16;
+
+ private Locale locale;
+ private boolean popup;
+ private String pattern;
+ private Date selectedDate = null;
+ private boolean showApply = true;
+ private boolean useCustomDayLabels;
+ private String mode;
+
+ public CalendarBean() {
+
+ locale = Locale.US;
+ popup = true;
+ pattern = "d/M/yy HH:mm";
+ mode = "client";
+
+ Calendar calendar = Calendar.getInstance();
+ calendar.set(CURRENT_YEAR, CURRENT_MONTH, CURRENT_DAY, 0, 0, 0);
+ selectedDate = calendar.getTime();
+ }
+
+ public String getMode() {
+ return mode;
+ }
+
+ public void setMode(String mode) {
+ this.mode = mode;
+ }
+
+ public Locale getLocale() {
+ return locale;
+ }
+
+ public void setLocale(Locale locale) {
+ this.locale = locale;
+ }
+
+ public boolean isPopup() {
+ return popup;
+ }
+
+ public void setPopup(boolean popup) {
+ this.popup = popup;
+ }
+
+ public String getPattern() {
+ return pattern;
+ }
+
+ public void setPattern(String pattern) {
+ this.pattern = pattern;
+ }
+
+ public void selectLocale(ValueChangeEvent event) {
+
+ String tLocale = (String) event.getNewValue();
+ if (tLocale != null) {
+ String lang = tLocale.substring(0, 2);
+ String country = tLocale.substring(3);
+ locale = new Locale(lang, country, "");
+ }
+ }
+
+ public boolean isUseCustomDayLabels() {
+ return useCustomDayLabels;
+ }
+
+ public void setUseCustomDayLabels(boolean useCustomDayLabels) {
+ this.useCustomDayLabels = useCustomDayLabels;
+ }
+
+ public Date getSelectedDate() {
+ return selectedDate;
+ }
+
+ public void setSelectedDate(Date selectedDate) {
+ this.selectedDate = selectedDate;
+ }
+
+ public boolean isShowApply() {
+ return showApply;
+ }
+
+ public void setShowApply(boolean showApply) {
+ this.showApply = showApply;
+ }
+}
\ No newline at end of file
Added: trunk/ui/input/ui/src/test/java/org/richfaces/component/CalendarDataModelImpl.java
===================================================================
--- trunk/ui/input/ui/src/test/java/org/richfaces/component/CalendarDataModelImpl.java
(rev 0)
+++
trunk/ui/input/ui/src/test/java/org/richfaces/component/CalendarDataModelImpl.java 2010-11-29
14:35:51 UTC (rev 20206)
@@ -0,0 +1,64 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.component;
+
+import java.util.Date;
+
+import javax.faces.bean.ApplicationScoped;
+import javax.faces.bean.ManagedBean;
+
+import org.richfaces.model.CalendarDataModel;
+import org.richfaces.model.CalendarDataModelItem;
+
+/**
+ * @author Nick Belaevski - mailto:nbelaevski@exadel.com
+ * created 30.06.2007
+ *
+ */
+@ManagedBean(name="calendarDataModel")
+@ApplicationScoped
+public class CalendarDataModelImpl implements CalendarDataModel {
+
+ /* (non-Javadoc)
+ * @see org.richfaces.component.CalendarDataModel#getData(java.util.Date[])
+ */
+ public CalendarDataModelItem[] getData(Date[] dateArray) {
+ if (dateArray == null) {
+ return null;
+ }
+
+ CalendarDataModelItem[] items = new CalendarDataModelItem[dateArray.length];
+ for (int i = 0; i < dateArray.length; i++) {
+ items[i] = createDataModelItem(dateArray[i]);
+ }
+
+ return items;
+ }
+
+ protected CalendarDataModelItem createDataModelItem(Date date) {
+ CalendarDataModelItemImpl item = new CalendarDataModelItemImpl();
+
+ item.setEnabled(false);
+
+ return item;
+ }
+}
Added:
trunk/ui/input/ui/src/test/java/org/richfaces/component/CalendarDataModelItemImpl.java
===================================================================
---
trunk/ui/input/ui/src/test/java/org/richfaces/component/CalendarDataModelItemImpl.java
(rev 0)
+++
trunk/ui/input/ui/src/test/java/org/richfaces/component/CalendarDataModelItemImpl.java 2010-11-29
14:35:51 UTC (rev 20206)
@@ -0,0 +1,58 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.component;
+
+import org.richfaces.model.CalendarDataModelItem;
+
+/**
+ * @author Nick Belaevski - mailto:nbelaevski@exadel.com
+ * created 04.07.2007
+ *
+ */
+public class CalendarDataModelItemImpl implements CalendarDataModelItem {
+
+ private boolean enabled = true;
+ private String styleClass = "";
+
+
+ /* (non-Javadoc)
+ * @see org.richfaces.component.CalendarDataModelItem#isEnabled()
+ */
+ public boolean isEnabled() {
+ return enabled;
+ }
+
+ /**
+ * @param enabled the enabled to set
+ */
+ public void setEnabled(boolean enabled) {
+ this.enabled = enabled;
+ }
+
+ public String getStyleClass() {
+ return styleClass;
+ }
+
+ public void setStyleClass(String styleClass) {
+ this.styleClass = styleClass;
+ }
+}
Added: trunk/ui/input/ui/src/test/java/org/richfaces/component/CalendarRenderTest.java
===================================================================
--- trunk/ui/input/ui/src/test/java/org/richfaces/component/CalendarRenderTest.java
(rev 0)
+++
trunk/ui/input/ui/src/test/java/org/richfaces/component/CalendarRenderTest.java 2010-11-29
14:35:51 UTC (rev 20206)
@@ -0,0 +1,91 @@
+package org.richfaces.component;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.net.URISyntaxException;
+import java.util.Calendar;
+import java.util.List;
+import java.util.Locale;
+
+import org.jboss.test.faces.htmlunit.HtmlUnitEnvironment;
+import org.junit.Assert;
+import org.junit.Test;
+import org.richfaces.renderkit.html.RendererTestBase;
+
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import com.gargoylesoftware.htmlunit.html.HtmlImage;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import com.gargoylesoftware.htmlunit.html.HtmlTableDataCell;
+
+public class CalendarRenderTest extends RendererTestBase {
+
+ @Override
+ public void setUp() throws URISyntaxException {
+ environment = new HtmlUnitEnvironment();
+ environment.withWebRoot(new
File(this.getClass().getResource(".").toURI()));
+ environment.withResource("/WEB-INF/faces-config.xml",
"org/richfaces/component/faces-config.xml");
+ environment.start();
+ }
+
+ @Test
+ public void testExistenceCalendarPopup() throws Exception {
+ HtmlPage page = environment.getPage("/calendarTest.jsf");
+ HtmlElement calendarPopupElement =
page.getElementById("form:calendarPopup");
+ Assert.assertNotNull("form:calendarPopup element missed.",
calendarPopupElement);
+ }
+
+ @Test
+ public void testExistenceCalendarContent() throws Exception {
+ HtmlPage page = environment.getPage("/calendarTest.jsf");
+ HtmlElement calendarContentElement =
page.getElementById("form:calendarContent");
+ Assert.assertNotNull("form:calendarContent element missed.",
calendarContentElement);
+ }
+
+ @Test
+ public void testRenderCalendarScript() throws Exception {
+ doTest("calendarTest", "calendarScript",
"form:calendarScript");
+ }
+
+ @Test
+ public void testRenderCalendarContent() throws Exception {
+ doTest("calendarTest", "calendarContent",
"form:calendarContent");
+ }
+
+ @Test
+ public void testCalendarScrolling() throws Exception {
+ HtmlPage page = environment.getPage("/calendarTest.jsf");
+
+ HtmlImage calendarPopupButton = (HtmlImage)
page.getElementById("form:calendarPopupButton");
+ assertNotNull(calendarPopupButton);
+ page = (HtmlPage) calendarPopupButton.click();
+ HtmlElement calendarHeaderElement =
page.getElementById("form:calendarHeader");
+ assertNotNull("form:calendarHeader element missed.",
calendarHeaderElement);
+
+ HtmlTableDataCell nextTD = null;
+ List<?> tds =
calendarHeaderElement.getByXPath("table/tbody/tr/td");
+ for (Object td : tds)
+ {
+ HtmlTableDataCell htdc = (HtmlTableDataCell) td;
+ if (">".equals(htdc.asText())) {
+ nextTD = htdc;
+ }
+ }
+ assertNotNull(nextTD);
+ HtmlElement div = nextTD.getChildElements().iterator().next();
+
+ //Before click
+ Calendar calendar = Calendar.getInstance();
+ calendar.set(CalendarBean.CURRENT_YEAR, CalendarBean.CURRENT_MONTH,
CalendarBean.CURRENT_DAY);
+ String month = calendar.getDisplayName(Calendar.MONTH, Calendar.LONG,
Locale.US);
+ assertTrue(calendarHeaderElement.asText().indexOf(month) > -1);
+
+ page = div.click();
+
+ //After click
+ calendar.add(Calendar.MONTH, 1);
+ month = calendar.getDisplayName(Calendar.MONTH, Calendar.LONG, Locale.US);
+ assertTrue(calendarHeaderElement.asText().indexOf(month) > -1);
+ }
+}
Added:
trunk/ui/input/ui/src/test/resources/org/richfaces/component/calendarContent.xmlunit.xml
===================================================================
---
trunk/ui/input/ui/src/test/resources/org/richfaces/component/calendarContent.xmlunit.xml
(rev 0)
+++
trunk/ui/input/ui/src/test/resources/org/richfaces/component/calendarContent.xmlunit.xml 2010-11-29
14:35:51 UTC (rev 20206)
@@ -0,0 +1,108 @@
+<table id="form:calendarContent" border="0"
cellpadding="0" cellspacing="0" class="rf-ca-extr rf-ca-popup
undefined" style="display:none; position:absolute;z-index: 3;width:200px"
onclick="RichFaces.$('form:calendar').skipEventOnCollapse=true;">
+ <tbody>
+ <tr>
+ <td class="rf-ca-hdr" colspan="8"
id="form:calendarHeader"/>
+ </tr>
+ <tr id="form:calendarWeekDay">
+ <td class="rf-ca-days">
+ <br/>
+ </td>
+ <td class="rf-ca-days rf-ca-weekends"
id="form:calendarWeekDayCell0">
+ Sun
+ </td>
+ <td class="rf-ca-days" id="form:calendarWeekDayCell1">
+ Mon
+ </td>
+ <td class="rf-ca-days" id="form:calendarWeekDayCell2">
+ Tue
+ </td>
+ <td class="rf-ca-days" id="form:calendarWeekDayCell3">
+ Wed
+ </td>
+ <td class="rf-ca-days" id="form:calendarWeekDayCell4">
+ Thu
+ </td>
+ <td class="rf-ca-days" id="form:calendarWeekDayCell5">
+ Fri
+ </td>
+ <td class="rf-ca-days rf-ca-weekends rf-rgh-cell"
id="form:calendarWeekDayCell6">
+ Sat
+ </td>
+ </tr>
+ <tr id="form:calendarWeekNum1">
+ <td class="rf-ca-week " id="form:calendarWeekNumCell1">
+ 1
+ </td>
+ <td class="rf-ca-c-size rf-ca-c rf-ca-holly"
id="form:calendarDayCell0"
onclick="RichFaces.$('form:calendar').eventCellOnClick(event,
this);"
onmouseover="RichFaces.$('form:calendar').eventCellOnMouseOver(event,
this);"
onmouseout="RichFaces.$('form:calendar').eventCellOnMouseOut(event,
this);"/>
+ <td class="rf-ca-c-size rf-ca-c" id="form:calendarDayCell1"
onclick="RichFaces.$('form:calendar').eventCellOnClick(event,
this);"
onmouseover="RichFaces.$('form:calendar').eventCellOnMouseOver(event,
this);"
onmouseout="RichFaces.$('form:calendar').eventCellOnMouseOut(event,
this);"/>
+ <td class="rf-ca-c-size rf-ca-c" id="form:calendarDayCell2"
onclick="RichFaces.$('form:calendar').eventCellOnClick(event,
this);"
onmouseover="RichFaces.$('form:calendar').eventCellOnMouseOver(event,
this);"
onmouseout="RichFaces.$('form:calendar').eventCellOnMouseOut(event,
this);"/>
+ <td class="rf-ca-c-size rf-ca-c" id="form:calendarDayCell3"
onclick="RichFaces.$('form:calendar').eventCellOnClick(event,
this);"
onmouseover="RichFaces.$('form:calendar').eventCellOnMouseOver(event,
this);"
onmouseout="RichFaces.$('form:calendar').eventCellOnMouseOut(event,
this);"/>
+ <td class="rf-ca-c-size rf-ca-c" id="form:calendarDayCell4"
onclick="RichFaces.$('form:calendar').eventCellOnClick(event,
this);"
onmouseover="RichFaces.$('form:calendar').eventCellOnMouseOver(event,
this);"
onmouseout="RichFaces.$('form:calendar').eventCellOnMouseOut(event,
this);"/>
+ <td class="rf-ca-c-size rf-ca-c" id="form:calendarDayCell5"
onclick="RichFaces.$('form:calendar').eventCellOnClick(event,
this);"
onmouseover="RichFaces.$('form:calendar').eventCellOnMouseOver(event,
this);"
onmouseout="RichFaces.$('form:calendar').eventCellOnMouseOut(event,
this);"/>
+ <td class="rf-ca-c-size rf-ca-c rf-ca-holly rf-rgh-c"
id="form:calendarDayCell6"
onclick="RichFaces.$('form:calendar').eventCellOnClick(event,
this);"
onmouseover="RichFaces.$('form:calendar').eventCellOnMouseOver(event,
this);"
onmouseout="RichFaces.$('form:calendar').eventCellOnMouseOut(event,
this);"/>
+ </tr>
+ <tr id="form:calendarWeekNum2">
+ <td class="rf-ca-week " id="form:calendarWeekNumCell2">
+ 2
+ </td>
+ <td class="rf-ca-c-size rf-ca-c rf-ca-holly"
id="form:calendarDayCell7"
onclick="RichFaces.$('form:calendar').eventCellOnClick(event,
this);"
onmouseover="RichFaces.$('form:calendar').eventCellOnMouseOver(event,
this);"
onmouseout="RichFaces.$('form:calendar').eventCellOnMouseOut(event,
this);"/>
+ <td class="rf-ca-c-size rf-ca-c" id="form:calendarDayCell8"
onclick="RichFaces.$('form:calendar').eventCellOnClick(event,
this);"
onmouseover="RichFaces.$('form:calendar').eventCellOnMouseOver(event,
this);"
onmouseout="RichFaces.$('form:calendar').eventCellOnMouseOut(event,
this);"/>
+ <td class="rf-ca-c-size rf-ca-c" id="form:calendarDayCell9"
onclick="RichFaces.$('form:calendar').eventCellOnClick(event,
this);"
onmouseover="RichFaces.$('form:calendar').eventCellOnMouseOver(event,
this);"
onmouseout="RichFaces.$('form:calendar').eventCellOnMouseOut(event,
this);"/>
+ <td class="rf-ca-c-size rf-ca-c" id="form:calendarDayCell10"
onclick="RichFaces.$('form:calendar').eventCellOnClick(event,
this);"
onmouseover="RichFaces.$('form:calendar').eventCellOnMouseOver(event,
this);"
onmouseout="RichFaces.$('form:calendar').eventCellOnMouseOut(event,
this);"/>
+ <td class="rf-ca-c-size rf-ca-c" id="form:calendarDayCell11"
onclick="RichFaces.$('form:calendar').eventCellOnClick(event,
this);"
onmouseover="RichFaces.$('form:calendar').eventCellOnMouseOver(event,
this);"
onmouseout="RichFaces.$('form:calendar').eventCellOnMouseOut(event,
this);"/>
+ <td class="rf-ca-c-size rf-ca-c" id="form:calendarDayCell12"
onclick="RichFaces.$('form:calendar').eventCellOnClick(event,
this);"
onmouseover="RichFaces.$('form:calendar').eventCellOnMouseOver(event,
this);"
onmouseout="RichFaces.$('form:calendar').eventCellOnMouseOut(event,
this);"/>
+ <td class="rf-ca-c-size rf-ca-c rf-ca-holly rf-rgh-c"
id="form:calendarDayCell13"
onclick="RichFaces.$('form:calendar').eventCellOnClick(event,
this);"
onmouseover="RichFaces.$('form:calendar').eventCellOnMouseOver(event,
this);"
onmouseout="RichFaces.$('form:calendar').eventCellOnMouseOut(event,
this);"/>
+ </tr>
+ <tr id="form:calendarWeekNum3">
+ <td class="rf-ca-week " id="form:calendarWeekNumCell3">
+ 3
+ </td>
+ <td class="rf-ca-c-size rf-ca-c rf-ca-holly"
id="form:calendarDayCell14"
onclick="RichFaces.$('form:calendar').eventCellOnClick(event,
this);"
onmouseover="RichFaces.$('form:calendar').eventCellOnMouseOver(event,
this);"
onmouseout="RichFaces.$('form:calendar').eventCellOnMouseOut(event,
this);"/>
+ <td class="rf-ca-c-size rf-ca-c" id="form:calendarDayCell15"
onclick="RichFaces.$('form:calendar').eventCellOnClick(event,
this);"
onmouseover="RichFaces.$('form:calendar').eventCellOnMouseOver(event,
this);"
onmouseout="RichFaces.$('form:calendar').eventCellOnMouseOut(event,
this);"/>
+ <td class="rf-ca-c-size rf-ca-c" id="form:calendarDayCell16"
onclick="RichFaces.$('form:calendar').eventCellOnClick(event,
this);"
onmouseover="RichFaces.$('form:calendar').eventCellOnMouseOver(event,
this);"
onmouseout="RichFaces.$('form:calendar').eventCellOnMouseOut(event,
this);"/>
+ <td class="rf-ca-c-size rf-ca-c" id="form:calendarDayCell17"
onclick="RichFaces.$('form:calendar').eventCellOnClick(event,
this);"
onmouseover="RichFaces.$('form:calendar').eventCellOnMouseOver(event,
this);"
onmouseout="RichFaces.$('form:calendar').eventCellOnMouseOut(event,
this);"/>
+ <td class="rf-ca-c-size rf-ca-c" id="form:calendarDayCell18"
onclick="RichFaces.$('form:calendar').eventCellOnClick(event,
this);"
onmouseover="RichFaces.$('form:calendar').eventCellOnMouseOver(event,
this);"
onmouseout="RichFaces.$('form:calendar').eventCellOnMouseOut(event,
this);"/>
+ <td class="rf-ca-c-size rf-ca-c" id="form:calendarDayCell19"
onclick="RichFaces.$('form:calendar').eventCellOnClick(event,
this);"
onmouseover="RichFaces.$('form:calendar').eventCellOnMouseOver(event,
this);"
onmouseout="RichFaces.$('form:calendar').eventCellOnMouseOut(event,
this);"/>
+ <td class="rf-ca-c-size rf-ca-c rf-ca-holly rf-rgh-c"
id="form:calendarDayCell20"
onclick="RichFaces.$('form:calendar').eventCellOnClick(event,
this);"
onmouseover="RichFaces.$('form:calendar').eventCellOnMouseOver(event,
this);"
onmouseout="RichFaces.$('form:calendar').eventCellOnMouseOut(event,
this);"/>
+ </tr>
+ <tr id="form:calendarWeekNum4">
+ <td class="rf-ca-week " id="form:calendarWeekNumCell4">
+ 4
+ </td>
+ <td class="rf-ca-c-size rf-ca-c rf-ca-holly"
id="form:calendarDayCell21"
onclick="RichFaces.$('form:calendar').eventCellOnClick(event,
this);"
onmouseover="RichFaces.$('form:calendar').eventCellOnMouseOver(event,
this);"
onmouseout="RichFaces.$('form:calendar').eventCellOnMouseOut(event,
this);"/>
+ <td class="rf-ca-c-size rf-ca-c" id="form:calendarDayCell22"
onclick="RichFaces.$('form:calendar').eventCellOnClick(event,
this);"
onmouseover="RichFaces.$('form:calendar').eventCellOnMouseOver(event,
this);"
onmouseout="RichFaces.$('form:calendar').eventCellOnMouseOut(event,
this);"/>
+ <td class="rf-ca-c-size rf-ca-c" id="form:calendarDayCell23"
onclick="RichFaces.$('form:calendar').eventCellOnClick(event,
this);"
onmouseover="RichFaces.$('form:calendar').eventCellOnMouseOver(event,
this);"
onmouseout="RichFaces.$('form:calendar').eventCellOnMouseOut(event,
this);"/>
+ <td class="rf-ca-c-size rf-ca-c" id="form:calendarDayCell24"
onclick="RichFaces.$('form:calendar').eventCellOnClick(event,
this);"
onmouseover="RichFaces.$('form:calendar').eventCellOnMouseOver(event,
this);"
onmouseout="RichFaces.$('form:calendar').eventCellOnMouseOut(event,
this);"/>
+ <td class="rf-ca-c-size rf-ca-c" id="form:calendarDayCell25"
onclick="RichFaces.$('form:calendar').eventCellOnClick(event,
this);"
onmouseover="RichFaces.$('form:calendar').eventCellOnMouseOver(event,
this);"
onmouseout="RichFaces.$('form:calendar').eventCellOnMouseOut(event,
this);"/>
+ <td class="rf-ca-c-size rf-ca-c" id="form:calendarDayCell26"
onclick="RichFaces.$('form:calendar').eventCellOnClick(event,
this);"
onmouseover="RichFaces.$('form:calendar').eventCellOnMouseOver(event,
this);"
onmouseout="RichFaces.$('form:calendar').eventCellOnMouseOut(event,
this);"/>
+ <td class="rf-ca-c-size rf-ca-c rf-ca-holly rf-rgh-c"
id="form:calendarDayCell27"
onclick="RichFaces.$('form:calendar').eventCellOnClick(event,
this);"
onmouseover="RichFaces.$('form:calendar').eventCellOnMouseOver(event,
this);"
onmouseout="RichFaces.$('form:calendar').eventCellOnMouseOut(event,
this);"/>
+ </tr>
+ <tr id="form:calendarWeekNum5">
+ <td class="rf-ca-week " id="form:calendarWeekNumCell5">
+ 5
+ </td>
+ <td class="rf-ca-c-size rf-ca-c rf-ca-holly"
id="form:calendarDayCell28"
onclick="RichFaces.$('form:calendar').eventCellOnClick(event,
this);"
onmouseover="RichFaces.$('form:calendar').eventCellOnMouseOver(event,
this);"
onmouseout="RichFaces.$('form:calendar').eventCellOnMouseOut(event,
this);"/>
+ <td class="rf-ca-c-size rf-ca-c" id="form:calendarDayCell29"
onclick="RichFaces.$('form:calendar').eventCellOnClick(event,
this);"
onmouseover="RichFaces.$('form:calendar').eventCellOnMouseOver(event,
this);"
onmouseout="RichFaces.$('form:calendar').eventCellOnMouseOut(event,
this);"/>
+ <td class="rf-ca-c-size rf-ca-c" id="form:calendarDayCell30"
onclick="RichFaces.$('form:calendar').eventCellOnClick(event,
this);"
onmouseover="RichFaces.$('form:calendar').eventCellOnMouseOver(event,
this);"
onmouseout="RichFaces.$('form:calendar').eventCellOnMouseOut(event,
this);"/>
+ <td class="rf-ca-c-size rf-ca-c" id="form:calendarDayCell31"
onclick="RichFaces.$('form:calendar').eventCellOnClick(event,
this);"
onmouseover="RichFaces.$('form:calendar').eventCellOnMouseOver(event,
this);"
onmouseout="RichFaces.$('form:calendar').eventCellOnMouseOut(event,
this);"/>
+ <td class="rf-ca-c-size rf-ca-c" id="form:calendarDayCell32"
onclick="RichFaces.$('form:calendar').eventCellOnClick(event,
this);"
onmouseover="RichFaces.$('form:calendar').eventCellOnMouseOver(event,
this);"
onmouseout="RichFaces.$('form:calendar').eventCellOnMouseOut(event,
this);"/>
+ <td class="rf-ca-c-size rf-ca-c" id="form:calendarDayCell33"
onclick="RichFaces.$('form:calendar').eventCellOnClick(event,
this);"
onmouseover="RichFaces.$('form:calendar').eventCellOnMouseOver(event,
this);"
onmouseout="RichFaces.$('form:calendar').eventCellOnMouseOut(event,
this);"/>
+ <td class="rf-ca-c-size rf-ca-c rf-ca-holly rf-rgh-c"
id="form:calendarDayCell34"
onclick="RichFaces.$('form:calendar').eventCellOnClick(event,
this);"
onmouseover="RichFaces.$('form:calendar').eventCellOnMouseOver(event,
this);"
onmouseout="RichFaces.$('form:calendar').eventCellOnMouseOut(event,
this);"/>
+ </tr>
+ <tr id="form:calendarWeekNum6">
+ <td class="rf-ca-week rf-btm-c "
id="form:calendarWeekNumCell6">
+ 6
+ </td>
+ <td class="rf-btm-c rf-ca-c-size rf-ca-c rf-ca-holly"
id="form:calendarDayCell35"
onclick="RichFaces.$('form:calendar').eventCellOnClick(event,
this);"
onmouseover="RichFaces.$('form:calendar').eventCellOnMouseOver(event,
this);"
onmouseout="RichFaces.$('form:calendar').eventCellOnMouseOut(event,
this);"/>
+ <td class="rf-btm-c rf-ca-c-size rf-ca-c"
id="form:calendarDayCell36"
onclick="RichFaces.$('form:calendar').eventCellOnClick(event,
this);"
onmouseover="RichFaces.$('form:calendar').eventCellOnMouseOver(event,
this);"
onmouseout="RichFaces.$('form:calendar').eventCellOnMouseOut(event,
this);"/>
+ <td class="rf-btm-c rf-ca-c-size rf-ca-c"
id="form:calendarDayCell37"
onclick="RichFaces.$('form:calendar').eventCellOnClick(event,
this);"
onmouseover="RichFaces.$('form:calendar').eventCellOnMouseOver(event,
this);"
onmouseout="RichFaces.$('form:calendar').eventCellOnMouseOut(event,
this);"/>
+ <td class="rf-btm-c rf-ca-c-size rf-ca-c"
id="form:calendarDayCell38"
onclick="RichFaces.$('form:calendar').eventCellOnClick(event,
this);"
onmouseover="RichFaces.$('form:calendar').eventCellOnMouseOver(event,
this);"
onmouseout="RichFaces.$('form:calendar').eventCellOnMouseOut(event,
this);"/>
+ <td class="rf-btm-c rf-ca-c-size rf-ca-c"
id="form:calendarDayCell39"
onclick="RichFaces.$('form:calendar').eventCellOnClick(event,
this);"
onmouseover="RichFaces.$('form:calendar').eventCellOnMouseOver(event,
this);"
onmouseout="RichFaces.$('form:calendar').eventCellOnMouseOut(event,
this);"/>
+ <td class="rf-btm-c rf-ca-c-size rf-ca-c"
id="form:calendarDayCell40"
onclick="RichFaces.$('form:calendar').eventCellOnClick(event,
this);"
onmouseover="RichFaces.$('form:calendar').eventCellOnMouseOver(event,
this);"
onmouseout="RichFaces.$('form:calendar').eventCellOnMouseOut(event,
this);"/>
+ <td class="rf-btm-c rf-ca-c-size rf-ca-c rf-ca-holly rf-rgh-c"
id="form:calendarDayCell41"
onclick="RichFaces.$('form:calendar').eventCellOnClick(event,
this);"
onmouseover="RichFaces.$('form:calendar').eventCellOnMouseOver(event,
this);"
onmouseout="RichFaces.$('form:calendar').eventCellOnMouseOut(event,
this);"/>
+ </tr>
+ <tr>
+ <td class="rf-ca-ftr" colspan="8"
id="form:calendarFooter"/>
+ </tr>
+ </tbody>
+</table>
\ No newline at end of file
Added:
trunk/ui/input/ui/src/test/resources/org/richfaces/component/calendarScript.xmlunit.xml
===================================================================
---
trunk/ui/input/ui/src/test/resources/org/richfaces/component/calendarScript.xmlunit.xml
(rev 0)
+++
trunk/ui/input/ui/src/test/resources/org/richfaces/component/calendarScript.xmlunit.xml 2010-11-29
14:35:51 UTC (rev 20206)
@@ -0,0 +1,7 @@
+ <span id="form:calendarScript" style="display: none;">
+ <script type="text/javascript">
+//<![CDATA[
+RichFaces.ui.Calendar.addLocale("en_US",{"monthLabels":["January","February","March","April","May","June","July","August","September","October","November","December"]
,"minDaysInFirstWeek":1,"monthLabelsShort":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]
,"firstWeekDay":0,"weekDayLabels":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]
,"weekDayLabelsShort":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]
} );new
RichFaces.ui.Calendar("form:calendar","en_US",{"horizontalOffset":"0","showApplyButton":true,"showFooter":true,"selectedDate":new
Date(2010,10,16,0,0,0),"verticalOffset":"0","datePattern":"d\/M\/yy
HH:mm","direction":"AA","labels":{}
,"mode":"client","todayControlMode":"select","showWeeksBar":true,"resetTimeOnDateSelect":false,"style":"z\u002Dindex:
3;width:200px","showWeekDaysBar":true,"currentDate":new
Date(2010,10,16),"showHeader":true,"popup":true,"enableManualInput":false,"showInput":true,"boundaryDatesMode":"ina!
ctive","disabled":false,"jointPoint":"AA","hidePopupOnScroll":"true"}
,"").load({"startDate":{"month":10,"year":2010}
,"days":[{"enabled":false,"styleClass":""}
,{"enabled":false,"styleClass":""}
,{"enabled":false,"styleClass":""}
,{"enabled":false,"styleClass":""}
,{"enabled":false,"styleClass":""}
,{"enabled":false,"styleClass":""}
,{"enabled":false,"styleClass":""}
,{"enabled":false,"styleClass":""}
,{"enabled":false,"styleClass":""}
,{"enabled":false,"styleClass":""}
,{"enabled":false,"styleClass":""}
,{"enabled":false,"styleClass":""}
,{"enabled":false,"styleClass":""}
,{"enabled":false,"styleClass":""}
,{"enabled":false,"styleClass":""}
,{"enabled":false,"styleClass":""}
,{"enabled":false,"styleClass":""}
,{"enabled":false,"styleClass":""}
,{"enabled":false,"styleClass":""}
,{"enabled":false,"styleClass":""}
,{"enabled":false,"styleClass":""}
,{"enabled":false,"styleClass":""}
,{"enabled":false,"styleClass":""}
,{"enabled":false,"styleClass":""}
,{"enabled":false,"sty!
leClass":""}
,{"enabled":false,"styleClass":""}
,{"enabled":fa!
lse,"sty
leClass":""}
,{"enabled":false,"styleClass":""}
,{"enabled":false,"styleClass":""}
,{"enabled":false,"styleClass":""} ] } );
+//]]>
+ </script>
+ </span>
\ No newline at end of file
Added: trunk/ui/input/ui/src/test/resources/org/richfaces/component/calendarTest.xhtml
===================================================================
--- trunk/ui/input/ui/src/test/resources/org/richfaces/component/calendarTest.xhtml
(rev 0)
+++
trunk/ui/input/ui/src/test/resources/org/richfaces/component/calendarTest.xhtml 2010-11-29
14:35:51 UTC (rev 20206)
@@ -0,0 +1,29 @@
+<!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:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:in="http://richfaces.org/input">
+<f:view contentType="text/html" />
+
+<h:head>
+ <title>Richfaces Calendar</title>
+</h:head>
+
+<h:body>
+ <h:form id="form">
+ <in:calendar value="#{calendarBean.selectedDate}"
id="calendar"
+ locale="#{calendarBean.locale}"
popup="#{calendarBean.popup}"
+ datePattern="#{calendarBean.pattern}"
+ dataModel="#{calendarDataModel}"
+ mode="#{calendarBean.mode}"
+ showHeader="true"
+ currentDate="#{calendarBean.selectedDate}"
+ showApplyButton="#{calendarBean.showApply}"
cellWidth="24px"
+ cellHeight="22px" style="width:200px">
+ <f:convertDateTime pattern="#{calendarBean.pattern}"
+ onchange="alert('1')" />
+ </in:calendar>
+ </h:form>
+</h:body>
+</html>
Added: trunk/ui/input/ui/src/test/resources/org/richfaces/component/faces-config.xml
===================================================================
--- trunk/ui/input/ui/src/test/resources/org/richfaces/component/faces-config.xml
(rev 0)
+++
trunk/ui/input/ui/src/test/resources/org/richfaces/component/faces-config.xml 2010-11-29
14:35:51 UTC (rev 20206)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<faces-config
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
+ version="2.0">
+
+ <managed-bean>
+ <managed-bean-name>calendarBean</managed-bean-name>
+ <managed-bean-class>org.richfaces.component.CalendarBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>calendarDataModel</managed-bean-name>
+
<managed-bean-class>org.richfaces.component.CalendarDataModelImpl</managed-bean-class>
+ <managed-bean-scope>application</managed-bean-scope>
+ </managed-bean>
+
+</faces-config>
\ No newline at end of file