aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2016-12-15 09:45:29 +0500
committerAbyss777 <abyss@fox5.ru>2016-12-15 09:45:29 +0500
commitef9148eea8dd404aba5707898f244a4b7bc26feb (patch)
tree6c6af03e3ea06609e15fbfbbe651209a33b620a8 /test
parentfff8f0c792606daff151624479d9ae9dc54187d5 (diff)
downloadtraccar-server-ef9148eea8dd404aba5707898f244a4b7bc26feb.tar.gz
traccar-server-ef9148eea8dd404aba5707898f244a4b7bc26feb.tar.bz2
traccar-server-ef9148eea8dd404aba5707898f244a4b7bc26feb.zip
- Set period duration to 0
- Remove setter - Added test cases - Style fix
Diffstat (limited to 'test')
-rw-r--r--test/org/traccar/calendar/CalendarTest.java14
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));
}
}