diff --git a/engine/time/src/test/java/io/deephaven/time/calendar/TestBusinessCalendarParser.java b/engine/time/src/test/java/io/deephaven/time/calendar/TestBusinessCalendarParser.java index c6d81794706..285916d4bb8 100644 --- a/engine/time/src/test/java/io/deephaven/time/calendar/TestBusinessCalendarParser.java +++ b/engine/time/src/test/java/io/deephaven/time/calendar/TestBusinessCalendarParser.java @@ -13,13 +13,7 @@ public class TestBusinessCalendarParser extends BaseArrayTestCase { - public void testLoad() throws URISyntaxException { - final String path = Paths - .get(Objects.requireNonNull(TestBusinessCalendarParser.class.getResource("/PARSER-TEST.calendar")).toURI()) - .toString(); - final File f = new File(path); - final BusinessCalendar cal = BusinessCalendarParser.loadBusinessCalendar(f); - + public static void assertParserTestCal(final BusinessCalendar cal) { assertEquals("PARSER-TEST-CAL", cal.name()); assertEquals("Test Calendar", cal.description()); assertEquals(DateTimeUtils.timeZone("Asia/Tokyo"), cal.timeZone()); @@ -37,4 +31,13 @@ public void testLoad() throws URISyntaxException { assertEquals(DateTimeUtils.parseInstant("2015-04-06T14:15 Asia/Tokyo"), cal.businessSchedule("2015-04-06").businessStart()); assertEquals(DateTimeUtils.parseInstant("2015-04-06T16:46 Asia/Tokyo"), cal.businessSchedule("2015-04-06").businessEnd()); } + + public void testLoad() throws URISyntaxException { + final String path = Paths + .get(Objects.requireNonNull(TestBusinessCalendarParser.class.getResource("/PARSER-TEST.calendar")).toURI()) + .toString(); + final File f = new File(path); + final BusinessCalendar cal = BusinessCalendarParser.loadBusinessCalendar(f); + assertParserTestCal(cal); + } } diff --git a/engine/time/src/test/java/io/deephaven/time/calendar/TestCalendars.java b/engine/time/src/test/java/io/deephaven/time/calendar/TestCalendars.java index 25a96b11ac3..28a39ec7314 100644 --- a/engine/time/src/test/java/io/deephaven/time/calendar/TestCalendars.java +++ b/engine/time/src/test/java/io/deephaven/time/calendar/TestCalendars.java @@ -6,6 +6,10 @@ import io.deephaven.base.testing.BaseArrayTestCase; import io.deephaven.configuration.Configuration; +import java.net.URISyntaxException; +import java.nio.file.Paths; +import java.util.Objects; + public class TestCalendars extends BaseArrayTestCase { public void testDefault() { @@ -39,4 +43,19 @@ public void testCalendar() { // pass } } + + public void testAdd() throws URISyntaxException { + + try{ + final String path = Paths + .get(Objects.requireNonNull(TestBusinessCalendarParser.class.getResource("/PARSER-TEST.calendar")).toURI()) + .toString(); + Calendars.addCalendarFromFile(path); + + final BusinessCalendar cal = Calendars.calendar("PARSER-TEST-CAL"); + TestBusinessCalendarParser.assertParserTestCal(cal); + }finally { + Calendars.setDefaultCalendar(Configuration.getInstance().getProperty("Calendar.default")); + } + } }