Author: akushunin
Date: 2007-07-24 08:51:40 -0400 (Tue, 24 Jul 2007)
New Revision: 1820
Added:
trunk/sandbox/ui/calendar/src/test/java/org/richfaces/component/CurrentDateEventTest.java
Modified:
trunk/sandbox/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java
Log:
Added JUnit test for CurrentDateChangeEvent
Modified: trunk/sandbox/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java
===================================================================
---
trunk/sandbox/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java 2007-07-24
11:28:26 UTC (rev 1819)
+++
trunk/sandbox/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java 2007-07-24
12:51:40 UTC (rev 1820)
@@ -239,7 +239,6 @@
updateCurrentDate(facesContext, currentDate1);
ValueChangeEvent changeEvent = new
ValueChangeEvent(this,currentDate2,currentDate1);
changeEvent.queue();
- //TODO Add ValueChange Events for currentDate
}
Added:
trunk/sandbox/ui/calendar/src/test/java/org/richfaces/component/CurrentDateEventTest.java
===================================================================
---
trunk/sandbox/ui/calendar/src/test/java/org/richfaces/component/CurrentDateEventTest.java
(rev 0)
+++
trunk/sandbox/ui/calendar/src/test/java/org/richfaces/component/CurrentDateEventTest.java 2007-07-24
12:51:40 UTC (rev 1820)
@@ -0,0 +1,76 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - Ajax4jsf Component Library
+ *
+ * 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.Calendar;
+
+import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
+
+/**
+ * Unit test for CurrentDateChangeEvent.
+ */
+public class CurrentDateEventTest extends AbstractAjax4JsfTestCase {
+
+ private CurrentDateChangeEvent event1;
+ private CurrentDateChangeEvent event2;
+ private UICalendar calendar;
+ private Calendar cal;
+
+ /**
+ * Create the test case
+ *
+ * @param testName name of the test case
+ */
+ public CurrentDateEventTest(String testName) {
+ super(testName);
+ }
+
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.tests.AbstractAjax4JsfTestCase#setUp()
+ */
+ public void setUp() throws Exception {
+ super.setUp();
+
+ calendar = (UICalendar) application.createComponent(UICalendar.COMPONENT_TYPE);;
+ event1 = new CurrentDateChangeEvent (calendar, "09/11/2001");
+ cal = Calendar.getInstance();
+ cal.set(2001, 8, 11);
+ event2 = new CurrentDateChangeEvent (calendar, cal.getTime());
+ }
+
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.tests.AbstractAjax4JsfTestCase#tearDown()
+ */
+ public void tearDown() throws Exception {
+ super.tearDown();
+ event1 = null;
+ event2 = null;
+ calendar = null;
+ }
+
+ public void testEvent() throws Exception {
+ assertEquals(cal.getTime(), event2.getCurrentDate());
+ assertEquals("09/11/2001", event1.getCurrentDateString());
+ }
+
+
+}
Property changes on:
trunk/sandbox/ui/calendar/src/test/java/org/richfaces/component/CurrentDateEventTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Show replies by date