Skip to content

Commit

Permalink
Consolidate calendar init test logic
Browse files Browse the repository at this point in the history
  • Loading branch information
devinrsmith committed Jan 16, 2024
1 parent 4ac96ef commit 56c5b05
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 55 deletions.
1 change: 1 addition & 0 deletions Integrations/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ dependencies {
implementation project(':log-factory')

testImplementation project(':engine-test-utils')
testImplementation TestTools.projectDependency(project, 'engine-time')

testRuntimeOnly project(':log-to-slf4j')
// add configs, and some runtime dependencies to test classpaths
Expand Down

This file was deleted.

1 change: 1 addition & 0 deletions Plot/Plot.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ dependencies {

testImplementation TestTools.projectDependency(project, 'Util')
testImplementation TestTools.projectDependency(project, 'engine-table')
testImplementation TestTools.projectDependency(project, 'engine-time')

testRuntimeOnly project(path: ':configs')
testRuntimeOnly project(path: ':test-configs')
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package io.deephaven.plot.axistransformations;

import io.deephaven.time.DateTimeUtils;
import io.deephaven.time.calendar.CalendarInit;
import io.deephaven.time.calendar.Calendars;
import junit.framework.TestCase;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package io.deephaven.plot.axistransformations;

import io.deephaven.time.calendar.BusinessCalendar;
import io.deephaven.time.calendar.CalendarInit;
import io.deephaven.time.calendar.Calendars;
import org.junit.Before;
import org.junit.Test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
*/
package io.deephaven.time.calendar;

final class CalendarInit {
public final class CalendarInit {

private static volatile boolean initialized = false;

/**
* This is a guarded initialization of {@link Calendars#addCalendar(BusinessCalendar)} for all the
* {@link Calendars#calendarsFromConfiguration()}.
*/
static void init() {
public static void init() {
if (!initialized) {
synchronized (CalendarInit.class) {
if (!initialized) {
Expand Down
3 changes: 1 addition & 2 deletions py/server/tests/test_calendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ class CalendarTestCase(BaseTestCase):
@classmethod
def setUpClass(cls) -> None:
super().setUpClass()
jpy.get_type('io.deephaven.integrations.python.CalendarsHelper').addCalendarsFromConfiguration()

jpy.get_type('io.deephaven.time.calendar.CalendarInit').init()

def setUp(self) -> None:
super().setUp()
Expand Down

0 comments on commit 56c5b05

Please sign in to comment.