Skip to content

Commit

Permalink
RESOLVED - 336275: SWTBotDateTime fails to set date completely when d…
Browse files Browse the repository at this point in the history
…ay-of-month to set is not available in current month

https://bugs.eclipse.org/bugs/show_bug.cgi?id=336275
  • Loading branch information
ketan committed Feb 3, 2011
1 parent 2247fb3 commit f86c968
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Expand Up @@ -50,6 +50,22 @@ public void setsAndGetsDateOnDateTime() throws Exception {
assertEquals(expected, actual);
}

@Test
public void shouldHandleInvalidDates() throws Exception {
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(0);
calendar.set(2011, 1, 3, 0, 0, 0);
Date expected = calendar.getTime();
assertFalse(expected.equals(dateTime.getDate()));
dateTime.setDate(expected);

calendar = Calendar.getInstance();
calendar.setTimeInMillis(0);
calendar.set(2010, 11, 31, 0, 0, 0);
dateTime.setDate(calendar.getTime());
assertEquals(calendar.getTime(), dateTime.getDate());
}

@Test
public void sendsNotification() throws Exception {
bot.checkBox("Listen").click();
Expand Down
Expand Up @@ -62,8 +62,8 @@ public Date getDate() {
return syncExec(new Result<Date>() {
public Date run() {
int year = widget.getYear();
int month = widget.getMonth();
int day = widget.getDay();
int month = widget.getMonth();

int hours = widget.getHours();
int minutes = widget.getMinutes();
Expand Down

0 comments on commit f86c968

Please sign in to comment.