From 425bd35c736b7e1c0dbe5b3f9162e195b3be6018 Mon Sep 17 00:00:00 2001 From: CGantert345 <57003061+CGantert345@users.noreply.github.com> Date: Thu, 25 Feb 2021 11:02:26 +0100 Subject: - bug fix on TicketType Enum - duplicate function getDocument removed - issuedOnLine null value allowed - maven install added (required renaming of some packages) --- .../barcode/ticket/api/test/DateTimeUtilsTest.java | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 src/org/uic/barcode/ticket/api/test/DateTimeUtilsTest.java (limited to 'src/org/uic/barcode/ticket/api/test/DateTimeUtilsTest.java') diff --git a/src/org/uic/barcode/ticket/api/test/DateTimeUtilsTest.java b/src/org/uic/barcode/ticket/api/test/DateTimeUtilsTest.java new file mode 100644 index 0000000..5435c6b --- /dev/null +++ b/src/org/uic/barcode/ticket/api/test/DateTimeUtilsTest.java @@ -0,0 +1,45 @@ +package org.uic.barcode.ticket.api.test; + +import java.util.Calendar; +import java.util.TimeZone; +import org.junit.Test; +import org.uic.barcode.ticket.api.asn.omv1.DateTimeUtils; + + +public class DateTimeUtilsTest{ + + + + @Test public void testDateDiff1() throws IllegalArgumentException, IllegalAccessException { + + Calendar issuing = Calendar.getInstance(); + issuing.setTimeZone(TimeZone.getTimeZone("UTC")); + issuing.set(Calendar.YEAR,2017); + issuing.set(Calendar.DAY_OF_MONTH, 31); + issuing.set(Calendar.MONTH, 12); + issuing.set(Calendar.HOUR_OF_DAY, 23); + issuing.set(Calendar.MINUTE, 5); + + Calendar local = Calendar.getInstance(); + local.set(Calendar.YEAR,2018); + local.set(Calendar.DAY_OF_MONTH, 1); + local.set(Calendar.MONTH, 1); + issuing.set(Calendar.HOUR_OF_DAY, 0); + issuing.set(Calendar.MINUTE, 5); + + Long diff = DateTimeUtils.getDateDifference(issuing.getTime(), local.getTime()); + + + assert(diff.intValue() == 1); + } + + + + + + + + + + +} -- cgit v1.2.3