diff options
author | Abyss777 <abyss@fox5.ru> | 2016-12-15 09:45:29 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2016-12-15 09:45:29 +0500 |
commit | ef9148eea8dd404aba5707898f244a4b7bc26feb (patch) | |
tree | 6c6af03e3ea06609e15fbfbbe651209a33b620a8 /test/org/traccar | |
parent | fff8f0c792606daff151624479d9ae9dc54187d5 (diff) | |
download | trackermap-server-ef9148eea8dd404aba5707898f244a4b7bc26feb.tar.gz trackermap-server-ef9148eea8dd404aba5707898f244a4b7bc26feb.tar.bz2 trackermap-server-ef9148eea8dd404aba5707898f244a4b7bc26feb.zip |
- Set period duration to 0
- Remove setter
- Added test cases
- Style fix
Diffstat (limited to 'test/org/traccar')
-rw-r--r-- | test/org/traccar/calendar/CalendarTest.java | 14 |
1 files changed, 9 insertions, 5 deletions
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)); } } |