From ef9148eea8dd404aba5707898f244a4b7bc26feb Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Thu, 15 Dec 2016 09:45:29 +0500 Subject: - Set period duration to 0 - Remove setter - Added test cases - Style fix --- test/org/traccar/calendar/CalendarTest.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'test/org/traccar') diff --git a/test/org/traccar/calendar/CalendarTest.java b/test/org/traccar/calendar/CalendarTest.java index 44fc9539b..7f5bd7d29 100644 --- a/test/org/traccar/calendar/CalendarTest.java +++ b/test/org/traccar/calendar/CalendarTest.java @@ -42,13 +42,17 @@ public class CalendarTest { "END:VEVENT\n" + "END:VCALENDAR"; Calendar calendar = new Calendar(); - calendar.setCalendar(calendarString.getBytes()); + calendar.setCalendarData(calendarString.getBytes()); DateFormat format = new SimpleDateFormat("yyyy-MM-dd hh:mm:ssX"); - - Date date = format.parse("2016-12-13 23:01:00+05"); + + Date date = format.parse("2016-12-13 22:59:59+05"); + Assert.assertTrue(!calendar.checkMoment(date)); + date = format.parse("2016-12-13 23:00:01+05"); + Assert.assertTrue(calendar.checkMoment(date)); + + date = format.parse("2016-12-13 06:59:59+05"); Assert.assertTrue(calendar.checkMoment(date)); - - date = format.parse("2016-12-13 07:01:00+05"); + date = format.parse("2016-12-13 07:00:01+05"); Assert.assertTrue(!calendar.checkMoment(date)); } } -- cgit v1.2.3