Author: ppitonak(a)redhat.com
Date: 2011-02-16 07:59:51 -0500 (Wed, 16 Feb 2011)
New Revision: 21692
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richCalendar/fAjax.xhtml
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCalendar/TestRichCalendarFAjax.java
Log:
added new sample for calendar + tests
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richCalendar/fAjax.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richCalendar/fAjax.xhtml
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richCalendar/fAjax.xhtml 2011-02-16
12:59:51 UTC (rev 21692)
@@ -0,0 +1,181 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!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:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
xmlns:rich="http://richfaces.org/rich"
+
xmlns:h="http://java.sun.com/jsf/html">
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010-2011, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ -->
+
+ <ui:composition template="/templates/template.xhtml">
+
+ <ui:define name="head">
+ <f:metadata>
+ <f:viewParam name="templates"
value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ <style type="text/css">
+ .yellowDay {
+ background: yellow !important;
+ }
+
+ .aquaDay {
+ background: aqua !important;
+ }
+
+ </style>
+
+ <script type="text/javascript">
+ function yellowTuesdays(day) {
+ if (day.date.getDay() == 2) {
+ return 'yellowDay';
+ }
+ return false;
+ }
+
+ function aquaWeekends(day) {
+ if (day.isWeekend) {
+ return 'aquaDay';
+ }
+ return false;
+ }
+
+ function disableTuesdays(day) {
+ if (day.date.getDay() == 2) {
+ return false;
+ }
+ return true;
+ }
+
+ function disableWeekends(day) {
+ if (day.isWeekend) {
+ return false;
+ }
+ return true;
+ }
+
+ testedComponentId = "#{rich:clientId('calendar')}";
+ </script>
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ </ui:define>
+
+ <ui:define name="component">
+ <div style="padding: 250px">
+ <rich:calendar id="calendar"
+
boundaryDatesMode="#{richCalendarBean.attributes['boundaryDatesMode'].value}"
+
buttonClass="#{richCalendarBean.attributes['buttonClass'].value}"
+
buttonDisabledIcon="#{richCalendarBean.attributes['buttonDisabledIcon'].value}"
+
buttonIcon="#{richCalendarBean.attributes['buttonIcon'].value}"
+
buttonLabel="#{richCalendarBean.attributes['buttonLabel'].value}"
+
converterMessage="#{richCalendarBean.attributes['converterMessage'].value}"
+
currentDate="#{richCalendarBean.attributes['currentDate'].value}"
+
datePattern="#{richCalendarBean.attributes['datePattern'].value}"
+
dayClassFunction="#{richCalendarBean.attributes['dayClassFunction'].value}"
+
dayDisableFunction="#{richCalendarBean.attributes['dayDisableFunction'].value}"
+
defaultTime="#{richCalendarBean.attributes['defaultTime'].value}"
+
direction="#{richCalendarBean.attributes['direction'].value}"
+
disabled="#{richCalendarBean.attributes['disabled'].value}"
+
enableManualInput="#{richCalendarBean.attributes['enableManualInput'].value}"
+
firstWeekDay="#{richCalendarBean.attributes['firstWeekDay'].value}"
+
hidePopupOnScroll="#{richCalendarBean.attributes['hidePopupOnScroll'].value}"
+
horizontalOffset="#{richCalendarBean.attributes['horizontalOffset'].value}"
+
immediate="#{richCalendarBean.attributes['immediate'].value}"
+
inputClass="#{richCalendarBean.attributes['inputClass'].value}"
+
inputSize="#{richCalendarBean.attributes['inputSize'].value}"
+
inputStyle="#{richCalendarBean.attributes['inputStyle'].value}"
+
jointPoint="#{richCalendarBean.attributes['jointPoint'].value}"
+
locale="#{richCalendarBean.attributes['locale'].value}"
+
minDaysInFirstWeek="#{richCalendarBean.attributes['minDaysInFirstWeek'].value}"
+
mode="#{richCalendarBean.attributes['mode'].value}"
+
onbeforecurrentdateselect="#{richCalendarBean.attributes['onbeforecurrentdateselect'].value}"
+
onbeforedateselect="#{richCalendarBean.attributes['onbeforedateselect'].value}"
+
onbeforetimeselect="#{richCalendarBean.attributes['onbeforetimeselect'].value}"
+
onchange="#{richCalendarBean.attributes['onchange'].value}"
+
onclean="#{richCalendarBean.attributes['onclean'].value}"
+
oncomplete="#{richCalendarBean.attributes['oncomplete'].value}"
+
oncurrentdateselect="#{richCalendarBean.attributes['oncurrentdateselect'].value}"
+
ondatemouseout="#{richCalendarBean.attributes['ondatemouseout'].value}"
+
ondatemouseover="#{richCalendarBean.attributes['ondatemouseover'].value}"
+
ondateselect="#{richCalendarBean.attributes['ondateselect'].value}"
+
onhide="#{richCalendarBean.attributes['ondateselect'].value}"
+
oninputblur="#{richCalendarBean.attributes['oninputblur'].value}"
+
oninputchange="#{richCalendarBean.attributes['oninputchange'].value}"
+
oninputclick="#{richCalendarBean.attributes['oninputclick'].value}"
+
oninputdblclick="#{richCalendarBean.attributes['oninputdblclick'].value}"
+
oninputfocus="#{richCalendarBean.attributes['oninputfocus'].value}"
+
oninputkeydown="#{richCalendarBean.attributes['oninputkeydown'].value}"
+
oninputkeypress="#{richCalendarBean.attributes['oninputkeypress'].value}"
+
oninputkeyup="#{richCalendarBean.attributes['oninputkeyup'].value}"
+
oninputmousedown="#{richCalendarBean.attributes['oninputmousedown'].value}"
+
oninputmousemove="#{richCalendarBean.attributes['oninputmousemove'].value}"
+
oninputmouseout="#{richCalendarBean.attributes['oninputmouseout'].value}"
+
oninputmouseover="#{richCalendarBean.attributes['oninputmouseover'].value}"
+
oninputmouseup="#{richCalendarBean.attributes['oninputmouseup'].value}"
+
oninputselect="#{richCalendarBean.attributes['oninputselect'].value}"
+
onshow="#{richCalendarBean.attributes['onshow'].value}"
+
ontimeselect="#{richCalendarBean.attributes['ontimeselect'].value}"
+
popup="#{richCalendarBean.attributes['popup'].value}"
+
preloadDateRangeBegin="#{richCalendarBean.attributes['preloadDateRangeBegin'].value}"
+
preloadDateRangeEnd="#{richCalendarBean.attributes['preloadDateRangeEnd'].value}"
+
rendered="#{richCalendarBean.attributes['rendered'].value}"
+
required="#{richCalendarBean.attributes['required'].value}"
+
requiredMessage="#{richCalendarBean.attributes['requiredMessage'].value}"
+
resetTimeOnDateSelect="#{richCalendarBean.attributes['resetTimeOnDateSelect'].value}"
+
showApplyButton="#{richCalendarBean.attributes['showApplyButton'].value}"
+
showFooter="#{richCalendarBean.attributes['showFooter'].value}"
+
showHeader="#{richCalendarBean.attributes['showHeader'].value}"
+
showInput="#{richCalendarBean.attributes['showInput'].value}"
+
showWeekDaysBar="#{richCalendarBean.attributes['showWeekDaysBar'].value}"
+
showWeeksBar="#{richCalendarBean.attributes['showWeeksBar'].value}"
+
style="#{richCalendarBean.attributes['style'].value}"
+
tabindex="#{richCalendarBean.attributes['tabindex'].value}"
+ timeZone="#{richCalendarBean.timeZone}"
+
todayControlMode="#{richCalendarBean.attributes['todayControlMode'].value}"
+
validatorMessage="#{richCalendarBean.attributes['validatorMessage'].value}"
+
value="#{richCalendarBean.attributes['value'].value}"
+
valueChangeListener="#{richCalendarBean.valueChangeListener}"
+
verticalOffset="#{richCalendarBean.attributes['verticalOffset'].value}"
+
zindex="#{richCalendarBean.attributes['zindex'].value}"
+ >
+ <f:ajax event="change" render="output
:phasesPanel" />
+ </rich:calendar>
+ </div>
+
+ <br/><br/>
+
+ output:
+ <h:outputText id="output"
value="#{richCalendarBean.attributes['value'].value}">
+ <f:convertDateTime
pattern="#{richCalendarBean.attributes['datePattern'].value}"
+
timeZone="#{richCalendarBean.timeZone}"/>
+ </h:outputText>
+
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <metamer:attributes value="#{richCalendarBean.attributes}"
id="attributes" />
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCalendar/TestRichCalendarFAjax.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCalendar/TestRichCalendarFAjax.java
(rev 0)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCalendar/TestRichCalendarFAjax.java 2011-02-16
12:59:51 UTC (rev 21692)
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.richCalendar;
+
+import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+
+import java.net.URL;
+
+import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
+import org.testng.annotations.Test;
+
+/**
+ * Test case for basic functionality of calendar on page
faces/components/richCalendar/fAjax.xhtml.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+public class TestRichCalendarFAjax extends AbstractCalendarTest {
+
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath,
"faces/components/richCalendar/fAjax.xhtml");
+ }
+
+ @Test
+ @Override
+ public void testOpenPopupClickOnInput() {
+ super.testOpenPopupClickOnInput();
+ }
+
+ @Test
+ @Override
+ public void testOpenPopupClickOnImage() {
+ super.testOpenPopupClickOnImage();
+ }
+
+ @Test
+ @Override
+ public void testHeaderButtons() {
+ super.testHeaderButtons();
+ }
+
+ @Test
+ @Override
+ public void testFooterButtons() {
+ super.testFooterButtons();
+ }
+
+ @Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-10536")
+ @Override
+ public void testApplyButton() {
+ super.testApplyButton();
+ }
+}