diff --git a/jollyday-core/src/main/java/module-info.java b/jollyday-core/src/main/java/module-info.java new file mode 100644 index 000000000..8fc1123df --- /dev/null +++ b/jollyday-core/src/main/java/module-info.java @@ -0,0 +1,12 @@ +module jollyday.core { + requires org.slf4j; + requires org.threeten.extra; + requires java.xml; + + exports de.focus_shift; + exports de.focus_shift.spi; + exports de.focus_shift.util; + exports de.focus_shift.parser.impl; + exports de.focus_shift.parameter; + exports de.focus_shift.datasource; +} diff --git a/jollyday-jaxb/src/main/java/module-info.java b/jollyday-jaxb/src/main/java/module-info.java new file mode 100644 index 000000000..b25c2970d --- /dev/null +++ b/jollyday-jaxb/src/main/java/module-info.java @@ -0,0 +1,10 @@ +module jollyday.jaxb { + requires java.xml; + requires jakarta.xml.bind; + requires org.slf4j; + requires org.threeten.extra; + requires jollyday.core; + + exports de.focus_shift.jaxb; + exports de.focus_shift.jaxb.mapping; +} diff --git a/jollyday-tests/src/test/java/de/focus_shift/HolidayTest.java b/jollyday-tests/src/test/java/de/focus_shift/HolidayTest.java deleted file mode 100644 index 724f6b0f2..000000000 --- a/jollyday-tests/src/test/java/de/focus_shift/HolidayTest.java +++ /dev/null @@ -1,38 +0,0 @@ -package de.focus_shift; - -import org.junit.jupiter.api.Test; - -import java.time.LocalDate; - -import static de.focus_shift.HolidayType.OFFICIAL_HOLIDAY; -import static org.assertj.core.api.Assertions.assertThat; - -class HolidayTest { - - @Test - void testComparable() { - final Holiday holiday = new Holiday(LocalDate.of(2015, 1, 1), null, OFFICIAL_HOLIDAY); - assertThat(holiday).isInstanceOf(Comparable.class); - } - - @Test - void testCompareToLess() { - final Holiday newYear = new Holiday(LocalDate.of(2015, 1, 1), null, OFFICIAL_HOLIDAY); - final Holiday christmas = new Holiday(LocalDate.of(2015, 12, 25), null, OFFICIAL_HOLIDAY); - assertThat(newYear).isLessThan(christmas); - } - - @Test - void testCompareToGreater() { - final Holiday christmas = new Holiday(LocalDate.of(2015, 12, 25), null, OFFICIAL_HOLIDAY); - final Holiday newYear = new Holiday(LocalDate.of(2015, 1, 1), null, OFFICIAL_HOLIDAY); - assertThat(christmas).isGreaterThan(newYear); - } - - @Test - void testCompareToEqual() { - final Holiday firstDayOfYear = new Holiday(LocalDate.of(2015, 1, 1), null, OFFICIAL_HOLIDAY); - final Holiday newYear = new Holiday(LocalDate.of(2015, 1, 1), null, OFFICIAL_HOLIDAY); - assertThat(firstDayOfYear).isEqualByComparingTo(newYear); - } -} diff --git a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayTest.java b/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayTest.java index 600cd5f1b..d3974d110 100644 --- a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayTest.java +++ b/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayTest.java @@ -1,257 +1,39 @@ package de.focus_shift.tests; -import de.focus_shift.CalendarHierarchy; import de.focus_shift.Holiday; -import de.focus_shift.HolidayCalendar; -import de.focus_shift.HolidayManager; -import de.focus_shift.ManagerParameter; -import de.focus_shift.ManagerParameters; -import de.focus_shift.util.CalendarUtil; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import java.time.LocalDate; -import java.util.Calendar; -import java.util.HashSet; -import java.util.Locale; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicLong; import static de.focus_shift.HolidayType.OFFICIAL_HOLIDAY; -import static de.focus_shift.HolidayType.UNOFFICIAL_HOLIDAY; -import static java.time.Month.APRIL; -import static java.time.Month.AUGUST; -import static java.time.Month.DECEMBER; -import static java.time.Month.FEBRUARY; -import static java.time.Month.JANUARY; -import static java.time.Month.JULY; -import static java.time.Month.NOVEMBER; -import static java.time.Month.SEPTEMBER; -import static java.util.Locale.ENGLISH; -import static java.util.Locale.GERMAN; import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatThrownBy; -import static org.junit.jupiter.api.Assertions.fail; - class HolidayTest { - private static final Logger LOG = LoggerFactory.getLogger(HolidayTest.class); - - private static final Set test_days = new HashSet<>(); - private static final Set test_days_l1 = new HashSet<>(); - private static final Set test_days_l2 = new HashSet<>(); - private static final Set test_days_l11 = new HashSet<>(); - - private final static CalendarUtil calendarUtil = new CalendarUtil(); - - static { - test_days.add(LocalDate.of(2010, FEBRUARY, 17)); - test_days.add(LocalDate.of(2010, AUGUST, 30)); - test_days.add(LocalDate.of(2010, APRIL, 2)); - test_days.add(LocalDate.of(2010, APRIL, 5)); - test_days.add(LocalDate.of(2010, NOVEMBER, 17)); - test_days.add(LocalDate.of(2010, NOVEMBER, 28)); - test_days.add(LocalDate.of(2010, JANUARY, 1)); - test_days.add(LocalDate.of(2010, JANUARY, 18)); - test_days.add(LocalDate.of(2010, NOVEMBER, 26)); - test_days_l1.addAll(test_days); - test_days_l1.add(LocalDate.of(2010, JANUARY, 2)); - test_days_l2.addAll(test_days_l1); - test_days_l2.add(LocalDate.of(2010, JANUARY, 3)); - - test_days_l11.addAll(test_days); - test_days_l11.add(LocalDate.of(2010, JULY, 27)); - test_days_l11.add(LocalDate.of(2010, JULY, 9)); - test_days_l11.add(LocalDate.of(2010, FEBRUARY, 26)); - test_days_l11.add(LocalDate.of(2010, AUGUST, 11)); - test_days_l11.add(LocalDate.of(2010, SEPTEMBER, 6)); - test_days_l11.add(LocalDate.of(2010, SEPTEMBER, 10)); - test_days_l11.add(LocalDate.of(2010, NOVEMBER, 17)); - test_days_l11.add(LocalDate.of(2010, DECEMBER, 7)); - test_days_l11.add(LocalDate.of(2010, DECEMBER, 16)); - } - - private Locale defaultLocale; - - @BeforeEach - void init() { - System.setProperty(" de.focus_shift.jaxb.mapping.urls", "file:./src/test/resources/test.app.properties"); - defaultLocale = Locale.getDefault(); - Locale.setDefault(GERMAN); - } - - @AfterEach - void destroy() { - Locale.setDefault(defaultLocale); - System.clearProperty(" de.focus_shift.jaxb.mapping.urls"); - } - @Test - void testMissingCountry() { - final ManagerParameter parameter = ManagerParameters.create("XXX"); - assertThatThrownBy(() -> HolidayManager.getInstance(parameter)) - .isInstanceOf(IllegalStateException.class); + void testComparable() { + final Holiday holiday = new Holiday(LocalDate.of(2015, 1, 1), null, OFFICIAL_HOLIDAY); + assertThat(holiday).isInstanceOf(Comparable.class); } @Test - void testBaseStructure() { - final HolidayManager holidayManager = HolidayManager.getInstance(ManagerParameters.create("test")); - final CalendarHierarchy calendarHierarchy = holidayManager.getCalendarHierarchy(); - assertThat(calendarHierarchy.getId()).isEqualTo("test"); - assertThat(calendarHierarchy.getChildren()).hasSize(2); - for (CalendarHierarchy hi : calendarHierarchy.getChildren().values()) { - if (hi.getId().equalsIgnoreCase("level1")) { - assertThat(hi.getChildren()).hasSize(1); - } else if (hi.getId().equalsIgnoreCase("level11")) { - assertThat(hi.getChildren()).isEmpty(); - } - } + void testCompareToLess() { + final Holiday newYear = new Holiday(LocalDate.of(2015, 1, 1), null, OFFICIAL_HOLIDAY); + final Holiday christmas = new Holiday(LocalDate.of(2015, 12, 25), null, OFFICIAL_HOLIDAY); + assertThat(newYear).isLessThan(christmas); } @Test - void testHierarchyDescriptionsDefined() { - for (HolidayCalendar holidayCalendar : HolidayCalendar.values()) { - final HolidayManager holidayManager = HolidayManager.getInstance(ManagerParameters.create(holidayCalendar)); - assertNotUndefined(holidayCalendar, holidayManager.getCalendarHierarchy()); - } - } - - private void assertNotUndefined(HolidayCalendar calendar, CalendarHierarchy c) { - assertThat(c.getDescription()).isNotEqualTo("undefined"); - for (Map.Entry element : c.getChildren().entrySet()) { - assertNotUndefined(calendar, element.getValue()); - } - } - - @Test - void testIsHolidayPerformanceMultithreaded() throws InterruptedException { - LocalDate date = LocalDate.of(2010, 1, 1); - final AtomicLong count = new AtomicLong(0); - final AtomicLong sumDuration = new AtomicLong(0); - ExecutorService executorService = Executors.newCachedThreadPool(); - while (date.getYear() < 2013) { - final LocalDate localDate = date; - executorService.submit(() -> { - long start = System.currentTimeMillis(); - HolidayManager m = HolidayManager.getInstance(ManagerParameters.create("test")); - m.isHoliday(localDate); - long duration = System.currentTimeMillis() - start; - count.incrementAndGet(); - sumDuration.addAndGet(duration); - }); - date = date.plusDays(1); - } - executorService.shutdown(); - executorService.awaitTermination(5, TimeUnit.SECONDS); - LOG.info("isHoliday took {} millis average tested with {} calls.", sumDuration.doubleValue() / count.doubleValue(), count.longValue()); - } - - @Test - void testCalendarChronology() { - final HolidayManager holidayManager = HolidayManager.getInstance(ManagerParameters.create("test")); - final Calendar calendar = Calendar.getInstance(); - calendar.set(Calendar.YEAR, 2010); - calendar.set(Calendar.MONTH, Calendar.FEBRUARY); - calendar.set(Calendar.DAY_OF_MONTH, 16); - assertThat(holidayManager.isHoliday(calendar)).isFalse(); - - calendar.add(Calendar.DAY_OF_YEAR, 1); - assertThat(holidayManager.isHoliday(calendar)).isTrue(); + void testCompareToGreater() { + final Holiday christmas = new Holiday(LocalDate.of(2015, 12, 25), null, OFFICIAL_HOLIDAY); + final Holiday newYear = new Holiday(LocalDate.of(2015, 1, 1), null, OFFICIAL_HOLIDAY); + assertThat(christmas).isGreaterThan(newYear); } @Test - void testBaseDates() { - final HolidayManager holidayManager = HolidayManager.getInstance(ManagerParameters.create("test")); - final Set holidays = holidayManager.getHolidays(2010); - assertThat(holidays).isNotNull(); - assertDates(test_days, holidays); - } - - private void assertDates(Set expected, Set holidays) { - for (LocalDate localDate : expected) { - if (!calendarUtil.contains(holidays, localDate)) { - fail("Missing " + localDate + " in " + holidays); - } - } - assertThat(holidays).hasSameSizeAs(expected); - } - - @Test - void testLevel1() { - final HolidayManager holidayManager = HolidayManager.getInstance(ManagerParameters.create("test")); - final Set holidays = holidayManager.getHolidays(2010, "level1"); - assertThat(holidays).isNotNull(); - assertDates(test_days_l1, holidays); - } - - @Test - void testLevel2() { - final HolidayManager holidayManager = HolidayManager.getInstance(ManagerParameters.create("test")); - final Set holidays = holidayManager.getHolidays(2010, "level1", "level2"); - assertThat(holidays).isNotNull(); - assertDates(test_days_l2, holidays); - } - - @Test - void testLevel11() { - final HolidayManager holidayManager = HolidayManager.getInstance(ManagerParameters.create("test")); - final Set holidays = holidayManager.getHolidays(2010, "level11"); - assertThat(holidays).isNotNull(); - assertDates(test_days_l11, holidays); - } - - @Test - void ensureThatExceptionIsThrownOnSubConfigurationWithSameId() { - final ManagerParameter parameter = ManagerParameters.create("test_fail"); - assertThatThrownBy(() -> HolidayManager.getInstance(parameter)) - .isInstanceOf(IllegalArgumentException.class); - } - - @Test - void testAllAvailableManagers() { - final Set supportedCalendarCodes = HolidayManager.getSupportedCalendarCodes(); - assertThat(supportedCalendarCodes) - .isNotNull() - .isNotEmpty(); - for (String calendar : supportedCalendarCodes) { - final HolidayManager manager = HolidayManager.getInstance(ManagerParameters.create(calendar)); - assertThat(manager).isNotNull(); - } - } - - @Test - void testHolidayDescription() { - Locale.setDefault(ENGLISH); - - final Holiday holiday = new Holiday(LocalDate.of(2011, 2, 2), "CHRISTMAS", OFFICIAL_HOLIDAY); - assertThat(holiday.getDescription()).isEqualTo("Christmas"); - assertThat(holiday.getDescription(GERMAN)).isEqualTo("Weihnachten"); - assertThat(holiday.getDescription(new Locale("nl"))).isEqualTo("Kerstmis"); - } - - @Test - void testHolidayEquals() { - final Holiday h1 = new Holiday(LocalDate.of(2011, 2, 2), "CHRISTMAS", OFFICIAL_HOLIDAY); - assertThat(h1).isEqualTo(h1); - - final Holiday h2b = new Holiday(LocalDate.of(2011, 2, 2), "CHRISTMAS", OFFICIAL_HOLIDAY); - assertThat(h1).isEqualTo(h2b); - - final Holiday h2 = new Holiday(LocalDate.of(2011, 2, 1), "CHRISTMAS", OFFICIAL_HOLIDAY); - assertThat(h1).isNotEqualTo(h2); - - final Holiday h3 = new Holiday(LocalDate.of(2011, 2, 2), "NEW_YEAR", OFFICIAL_HOLIDAY); - assertThat(h1).isNotEqualTo(h3); - - final Holiday h4 = new Holiday(LocalDate.of(2011, 2, 2), "CHRISTMAS", UNOFFICIAL_HOLIDAY); - assertThat(h1).isNotEqualTo(h4); + void testCompareToEqual() { + final Holiday firstDayOfYear = new Holiday(LocalDate.of(2015, 1, 1), null, OFFICIAL_HOLIDAY); + final Holiday newYear = new Holiday(LocalDate.of(2015, 1, 1), null, OFFICIAL_HOLIDAY); + assertThat(firstDayOfYear).isEqualByComparingTo(newYear); } } diff --git a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayAETest.java b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayAETest.java similarity index 92% rename from jollyday-tests/src/test/java/de/focus_shift/tests/HolidayAETest.java rename to jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayAETest.java index 2a4c16504..ddc232a6b 100644 --- a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayAETest.java +++ b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayAETest.java @@ -1,9 +1,9 @@ -package de.focus_shift.tests; +package de.focus_shift.tests.country; import de.focus_shift.Holiday; import de.focus_shift.HolidayManager; import de.focus_shift.ManagerParameters; -import de.focus_shift.tests.base.AbstractCountryTestBase; +import de.focus_shift.tests.country.base.AbstractCountryTestBase; import de.focus_shift.util.CalendarUtil; import org.junit.jupiter.api.Test; diff --git a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayALTest.java b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayALTest.java similarity index 72% rename from jollyday-tests/src/test/java/de/focus_shift/tests/HolidayALTest.java rename to jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayALTest.java index bce866173..267402070 100644 --- a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayALTest.java +++ b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayALTest.java @@ -1,6 +1,6 @@ -package de.focus_shift.tests; +package de.focus_shift.tests.country; -import de.focus_shift.tests.base.AbstractCountryTestBase; +import de.focus_shift.tests.country.base.AbstractCountryTestBase; import org.junit.jupiter.api.Test; class HolidayALTest extends AbstractCountryTestBase { diff --git a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayAUTest.java b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayAUTest.java similarity index 92% rename from jollyday-tests/src/test/java/de/focus_shift/tests/HolidayAUTest.java rename to jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayAUTest.java index e937b6f76..660ef1b2e 100644 --- a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayAUTest.java +++ b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayAUTest.java @@ -1,9 +1,9 @@ -package de.focus_shift.tests; +package de.focus_shift.tests.country; import de.focus_shift.CalendarHierarchy; import de.focus_shift.HolidayManager; import de.focus_shift.ManagerParameters; -import de.focus_shift.tests.base.AbstractCountryTestBase; +import de.focus_shift.tests.country.base.AbstractCountryTestBase; import org.junit.jupiter.api.Test; class HolidayAUTest extends AbstractCountryTestBase { diff --git a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayBGTest.java b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayBGTest.java similarity index 72% rename from jollyday-tests/src/test/java/de/focus_shift/tests/HolidayBGTest.java rename to jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayBGTest.java index 03c3c28ef..0737d7e68 100644 --- a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayBGTest.java +++ b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayBGTest.java @@ -1,6 +1,6 @@ -package de.focus_shift.tests; +package de.focus_shift.tests.country; -import de.focus_shift.tests.base.AbstractCountryTestBase; +import de.focus_shift.tests.country.base.AbstractCountryTestBase; import org.junit.jupiter.api.Test; class HolidayBGTest extends AbstractCountryTestBase { diff --git a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayBMTest.java b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayBMTest.java similarity index 95% rename from jollyday-tests/src/test/java/de/focus_shift/tests/HolidayBMTest.java rename to jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayBMTest.java index fa18954e7..1321b90ad 100644 --- a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayBMTest.java +++ b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayBMTest.java @@ -1,10 +1,10 @@ -package de.focus_shift.tests; +package de.focus_shift.tests.country; import de.focus_shift.Holiday; import de.focus_shift.HolidayCalendar; import de.focus_shift.HolidayManager; import de.focus_shift.ManagerParameters; -import de.focus_shift.tests.base.AbstractCountryTestBase; +import de.focus_shift.tests.country.base.AbstractCountryTestBase; import de.focus_shift.util.CalendarUtil; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; diff --git a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayCHTest.java b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayCHTest.java similarity index 69% rename from jollyday-tests/src/test/java/de/focus_shift/tests/HolidayCHTest.java rename to jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayCHTest.java index b80d52b94..cd5cec318 100644 --- a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayCHTest.java +++ b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayCHTest.java @@ -1,6 +1,6 @@ -package de.focus_shift.tests; +package de.focus_shift.tests.country; -import de.focus_shift.tests.base.AbstractCountryTestBase; +import de.focus_shift.tests.country.base.AbstractCountryTestBase; import org.junit.jupiter.api.Test; class HolidayCHTest extends AbstractCountryTestBase { diff --git a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayCZTest.java b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayCZTest.java similarity index 98% rename from jollyday-tests/src/test/java/de/focus_shift/tests/HolidayCZTest.java rename to jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayCZTest.java index 7fcac100e..3dd27ba7a 100644 --- a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayCZTest.java +++ b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayCZTest.java @@ -1,8 +1,8 @@ -package de.focus_shift.tests; +package de.focus_shift.tests.country; import de.focus_shift.Holiday; import de.focus_shift.HolidayManager; -import de.focus_shift.tests.base.AbstractCountryTestBase; +import de.focus_shift.tests.country.base.AbstractCountryTestBase; import net.jqwik.api.ForAll; import net.jqwik.api.Property; import net.jqwik.time.api.constraints.YearRange; diff --git a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayDETest.java b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayDETest.java similarity index 97% rename from jollyday-tests/src/test/java/de/focus_shift/tests/HolidayDETest.java rename to jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayDETest.java index f115558dc..3f0a8fc57 100644 --- a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayDETest.java +++ b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayDETest.java @@ -1,11 +1,11 @@ -package de.focus_shift.tests; +package de.focus_shift.tests.country; import de.focus_shift.Holiday; import de.focus_shift.HolidayCalendar; import de.focus_shift.HolidayManager; import de.focus_shift.ManagerParameter; import de.focus_shift.ManagerParameters; -import de.focus_shift.tests.base.AbstractCountryTestBase; +import de.focus_shift.tests.country.base.AbstractCountryTestBase; import de.focus_shift.util.CalendarUtil; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; diff --git a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayDKTest.java b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayDKTest.java similarity index 95% rename from jollyday-tests/src/test/java/de/focus_shift/tests/HolidayDKTest.java rename to jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayDKTest.java index 2a97e44d7..fe7ec470a 100644 --- a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayDKTest.java +++ b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayDKTest.java @@ -1,8 +1,8 @@ -package de.focus_shift.tests; +package de.focus_shift.tests.country; import de.focus_shift.Holiday; import de.focus_shift.HolidayManager; -import de.focus_shift.tests.base.AbstractCountryTestBase; +import de.focus_shift.tests.country.base.AbstractCountryTestBase; import net.jqwik.api.ForAll; import net.jqwik.api.Property; import net.jqwik.time.api.constraints.YearRange; diff --git a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayEGTest.java b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayEGTest.java similarity index 95% rename from jollyday-tests/src/test/java/de/focus_shift/tests/HolidayEGTest.java rename to jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayEGTest.java index a1ac60868..62470eb0e 100644 --- a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayEGTest.java +++ b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayEGTest.java @@ -1,9 +1,9 @@ -package de.focus_shift.tests; +package de.focus_shift.tests.country; import de.focus_shift.Holiday; import de.focus_shift.HolidayManager; import de.focus_shift.ManagerParameters; -import de.focus_shift.tests.base.AbstractCountryTestBase; +import de.focus_shift.tests.country.base.AbstractCountryTestBase; import de.focus_shift.util.CalendarUtil; import org.junit.jupiter.api.Test; diff --git a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayESTest.java b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayESTest.java similarity index 72% rename from jollyday-tests/src/test/java/de/focus_shift/tests/HolidayESTest.java rename to jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayESTest.java index d0316ed91..654fa1d0d 100644 --- a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayESTest.java +++ b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayESTest.java @@ -1,6 +1,6 @@ -package de.focus_shift.tests; +package de.focus_shift.tests.country; -import de.focus_shift.tests.base.AbstractCountryTestBase; +import de.focus_shift.tests.country.base.AbstractCountryTestBase; import org.junit.jupiter.api.Test; class HolidayESTest extends AbstractCountryTestBase { diff --git a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayFITest.java b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayFITest.java similarity index 72% rename from jollyday-tests/src/test/java/de/focus_shift/tests/HolidayFITest.java rename to jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayFITest.java index ae44be5bd..8c29fa676 100644 --- a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayFITest.java +++ b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayFITest.java @@ -1,6 +1,6 @@ -package de.focus_shift.tests; +package de.focus_shift.tests.country; -import de.focus_shift.tests.base.AbstractCountryTestBase; +import de.focus_shift.tests.country.base.AbstractCountryTestBase; import org.junit.jupiter.api.Test; class HolidayFITest extends AbstractCountryTestBase { diff --git a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayFRTest.java b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayFRTest.java similarity index 84% rename from jollyday-tests/src/test/java/de/focus_shift/tests/HolidayFRTest.java rename to jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayFRTest.java index 645d41977..51bfd50a0 100644 --- a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayFRTest.java +++ b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayFRTest.java @@ -1,7 +1,7 @@ -package de.focus_shift.tests; +package de.focus_shift.tests.country; import de.focus_shift.HolidayCalendar; -import de.focus_shift.tests.base.AbstractCountryTestBase; +import de.focus_shift.tests.country.base.AbstractCountryTestBase; import org.junit.jupiter.api.Test; import java.util.Locale; diff --git a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayGBTest.java b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayGBTest.java similarity index 96% rename from jollyday-tests/src/test/java/de/focus_shift/tests/HolidayGBTest.java rename to jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayGBTest.java index 322e460a3..18883a0fa 100644 --- a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayGBTest.java +++ b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayGBTest.java @@ -1,9 +1,9 @@ -package de.focus_shift.tests; +package de.focus_shift.tests.country; import de.focus_shift.Holiday; import de.focus_shift.HolidayManager; import de.focus_shift.ManagerParameters; -import de.focus_shift.tests.base.AbstractCountryTestBase; +import de.focus_shift.tests.country.base.AbstractCountryTestBase; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; diff --git a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayISTest.java b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayISTest.java similarity index 72% rename from jollyday-tests/src/test/java/de/focus_shift/tests/HolidayISTest.java rename to jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayISTest.java index ffb3a33ec..bf7ed9838 100644 --- a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayISTest.java +++ b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayISTest.java @@ -1,6 +1,6 @@ -package de.focus_shift.tests; +package de.focus_shift.tests.country; -import de.focus_shift.tests.base.AbstractCountryTestBase; +import de.focus_shift.tests.country.base.AbstractCountryTestBase; import org.junit.jupiter.api.Test; class HolidayISTest extends AbstractCountryTestBase { diff --git a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayITTest.java b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayITTest.java similarity index 98% rename from jollyday-tests/src/test/java/de/focus_shift/tests/HolidayITTest.java rename to jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayITTest.java index 64106f83b..dc2d9295a 100644 --- a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayITTest.java +++ b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayITTest.java @@ -1,8 +1,8 @@ -package de.focus_shift.tests; +package de.focus_shift.tests.country; import de.focus_shift.Holiday; import de.focus_shift.HolidayManager; -import de.focus_shift.tests.base.AbstractCountryTestBase; +import de.focus_shift.tests.country.base.AbstractCountryTestBase; import net.jqwik.api.ForAll; import net.jqwik.api.Property; import net.jqwik.time.api.constraints.YearRange; diff --git a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayKYTest.java b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayKYTest.java similarity index 96% rename from jollyday-tests/src/test/java/de/focus_shift/tests/HolidayKYTest.java rename to jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayKYTest.java index 7ac16db36..7f4bc32ab 100644 --- a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayKYTest.java +++ b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayKYTest.java @@ -1,10 +1,10 @@ -package de.focus_shift.tests; +package de.focus_shift.tests.country; import de.focus_shift.Holiday; import de.focus_shift.HolidayCalendar; import de.focus_shift.HolidayManager; import de.focus_shift.ManagerParameters; -import de.focus_shift.tests.base.AbstractCountryTestBase; +import de.focus_shift.tests.country.base.AbstractCountryTestBase; import de.focus_shift.util.CalendarUtil; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; diff --git a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayLUTest.java b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayLUTest.java similarity index 98% rename from jollyday-tests/src/test/java/de/focus_shift/tests/HolidayLUTest.java rename to jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayLUTest.java index 1320ba5de..3b98ac34b 100644 --- a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayLUTest.java +++ b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayLUTest.java @@ -1,8 +1,8 @@ -package de.focus_shift.tests; +package de.focus_shift.tests.country; import de.focus_shift.Holiday; import de.focus_shift.HolidayManager; -import de.focus_shift.tests.base.AbstractCountryTestBase; +import de.focus_shift.tests.country.base.AbstractCountryTestBase; import net.jqwik.api.ForAll; import net.jqwik.api.Property; import net.jqwik.time.api.constraints.YearRange; diff --git a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayMDTest.java b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayMDTest.java similarity index 98% rename from jollyday-tests/src/test/java/de/focus_shift/tests/HolidayMDTest.java rename to jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayMDTest.java index 5dae57f8b..3ee618d0b 100644 --- a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayMDTest.java +++ b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayMDTest.java @@ -1,8 +1,8 @@ -package de.focus_shift.tests; +package de.focus_shift.tests.country; import de.focus_shift.Holiday; import de.focus_shift.HolidayManager; -import de.focus_shift.tests.base.AbstractCountryTestBase; +import de.focus_shift.tests.country.base.AbstractCountryTestBase; import net.jqwik.api.ForAll; import net.jqwik.api.Property; import net.jqwik.time.api.constraints.YearRange; diff --git a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayMTTest.java b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayMTTest.java similarity index 70% rename from jollyday-tests/src/test/java/de/focus_shift/tests/HolidayMTTest.java rename to jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayMTTest.java index c9b245502..0110b8d27 100644 --- a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayMTTest.java +++ b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayMTTest.java @@ -1,6 +1,6 @@ -package de.focus_shift.tests; +package de.focus_shift.tests.country; -import de.focus_shift.tests.base.AbstractCountryTestBase; +import de.focus_shift.tests.country.base.AbstractCountryTestBase; import org.junit.jupiter.api.Test; class HolidayMTTest extends AbstractCountryTestBase { diff --git a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayNLTest.java b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayNLTest.java similarity index 98% rename from jollyday-tests/src/test/java/de/focus_shift/tests/HolidayNLTest.java rename to jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayNLTest.java index bda675c48..e3a7531cd 100644 --- a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayNLTest.java +++ b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayNLTest.java @@ -1,8 +1,8 @@ -package de.focus_shift.tests; +package de.focus_shift.tests.country; import de.focus_shift.Holiday; import de.focus_shift.HolidayManager; -import de.focus_shift.tests.base.AbstractCountryTestBase; +import de.focus_shift.tests.country.base.AbstractCountryTestBase; import net.jqwik.api.ForAll; import net.jqwik.api.Property; import net.jqwik.time.api.constraints.YearRange; diff --git a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayNZTest.java b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayNZTest.java similarity index 93% rename from jollyday-tests/src/test/java/de/focus_shift/tests/HolidayNZTest.java rename to jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayNZTest.java index 2e8bb31ac..83ff41a8f 100644 --- a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayNZTest.java +++ b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayNZTest.java @@ -1,10 +1,10 @@ -package de.focus_shift.tests; +package de.focus_shift.tests.country; import de.focus_shift.Holiday; import de.focus_shift.HolidayCalendar; import de.focus_shift.HolidayManager; import de.focus_shift.ManagerParameters; -import de.focus_shift.tests.base.AbstractCountryTestBase; +import de.focus_shift.tests.country.base.AbstractCountryTestBase; import de.focus_shift.util.CalendarUtil; import org.junit.jupiter.api.Test; diff --git a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayROTest.java b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayROTest.java similarity index 98% rename from jollyday-tests/src/test/java/de/focus_shift/tests/HolidayROTest.java rename to jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayROTest.java index a78acd975..2efd7285d 100644 --- a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayROTest.java +++ b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayROTest.java @@ -1,8 +1,8 @@ -package de.focus_shift.tests; +package de.focus_shift.tests.country; import de.focus_shift.Holiday; import de.focus_shift.HolidayManager; -import de.focus_shift.tests.base.AbstractCountryTestBase; +import de.focus_shift.tests.country.base.AbstractCountryTestBase; import net.jqwik.api.ForAll; import net.jqwik.api.Property; import net.jqwik.time.api.constraints.YearRange; diff --git a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayRSTest.java b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayRSTest.java similarity index 98% rename from jollyday-tests/src/test/java/de/focus_shift/tests/HolidayRSTest.java rename to jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayRSTest.java index 2c7f3e340..34821d9d5 100644 --- a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayRSTest.java +++ b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayRSTest.java @@ -1,9 +1,9 @@ -package de.focus_shift.tests; +package de.focus_shift.tests.country; import de.focus_shift.Holiday; import de.focus_shift.HolidayManager; import de.focus_shift.HolidayType; -import de.focus_shift.tests.base.AbstractCountryTestBase; +import de.focus_shift.tests.country.base.AbstractCountryTestBase; import net.jqwik.api.ForAll; import net.jqwik.api.Property; import net.jqwik.time.api.constraints.YearRange; diff --git a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidaySETest.java b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidaySETest.java similarity index 72% rename from jollyday-tests/src/test/java/de/focus_shift/tests/HolidaySETest.java rename to jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidaySETest.java index ce5aa8c7e..36f2cf206 100644 --- a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidaySETest.java +++ b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidaySETest.java @@ -1,6 +1,6 @@ -package de.focus_shift.tests; +package de.focus_shift.tests.country; -import de.focus_shift.tests.base.AbstractCountryTestBase; +import de.focus_shift.tests.country.base.AbstractCountryTestBase; import org.junit.jupiter.api.Test; class HolidaySETest extends AbstractCountryTestBase { diff --git a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidaySITest.java b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidaySITest.java similarity index 99% rename from jollyday-tests/src/test/java/de/focus_shift/tests/HolidaySITest.java rename to jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidaySITest.java index 6adbb65f6..7da2b0b7e 100644 --- a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidaySITest.java +++ b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidaySITest.java @@ -1,8 +1,8 @@ -package de.focus_shift.tests; +package de.focus_shift.tests.country; import de.focus_shift.Holiday; import de.focus_shift.HolidayManager; -import de.focus_shift.tests.base.AbstractCountryTestBase; +import de.focus_shift.tests.country.base.AbstractCountryTestBase; import net.jqwik.api.ForAll; import net.jqwik.api.Property; import net.jqwik.time.api.constraints.YearRange; diff --git a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayTRTest.java b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayTRTest.java similarity index 95% rename from jollyday-tests/src/test/java/de/focus_shift/tests/HolidayTRTest.java rename to jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayTRTest.java index a5feec109..8aeb7a543 100644 --- a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayTRTest.java +++ b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayTRTest.java @@ -1,10 +1,10 @@ -package de.focus_shift.tests; +package de.focus_shift.tests.country; import de.focus_shift.Holiday; import de.focus_shift.HolidayCalendar; import de.focus_shift.HolidayManager; import de.focus_shift.ManagerParameters; -import de.focus_shift.tests.base.AbstractCountryTestBase; +import de.focus_shift.tests.country.base.AbstractCountryTestBase; import de.focus_shift.util.CalendarUtil; import org.junit.jupiter.api.Test; diff --git a/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayTest.java b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayTest.java new file mode 100644 index 000000000..f144487f1 --- /dev/null +++ b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayTest.java @@ -0,0 +1,257 @@ +package de.focus_shift.tests.country; + +import de.focus_shift.CalendarHierarchy; +import de.focus_shift.Holiday; +import de.focus_shift.HolidayCalendar; +import de.focus_shift.HolidayManager; +import de.focus_shift.ManagerParameter; +import de.focus_shift.ManagerParameters; +import de.focus_shift.util.CalendarUtil; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.time.LocalDate; +import java.util.Calendar; +import java.util.HashSet; +import java.util.Locale; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicLong; + +import static de.focus_shift.HolidayType.OFFICIAL_HOLIDAY; +import static de.focus_shift.HolidayType.UNOFFICIAL_HOLIDAY; +import static java.time.Month.APRIL; +import static java.time.Month.AUGUST; +import static java.time.Month.DECEMBER; +import static java.time.Month.FEBRUARY; +import static java.time.Month.JANUARY; +import static java.time.Month.JULY; +import static java.time.Month.NOVEMBER; +import static java.time.Month.SEPTEMBER; +import static java.util.Locale.ENGLISH; +import static java.util.Locale.GERMAN; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.junit.jupiter.api.Assertions.fail; + + +class HolidayTest { + + private static final Logger LOG = LoggerFactory.getLogger(HolidayTest.class); + + private static final Set test_days = new HashSet<>(); + private static final Set test_days_l1 = new HashSet<>(); + private static final Set test_days_l2 = new HashSet<>(); + private static final Set test_days_l11 = new HashSet<>(); + + private final static CalendarUtil calendarUtil = new CalendarUtil(); + + static { + test_days.add(LocalDate.of(2010, FEBRUARY, 17)); + test_days.add(LocalDate.of(2010, AUGUST, 30)); + test_days.add(LocalDate.of(2010, APRIL, 2)); + test_days.add(LocalDate.of(2010, APRIL, 5)); + test_days.add(LocalDate.of(2010, NOVEMBER, 17)); + test_days.add(LocalDate.of(2010, NOVEMBER, 28)); + test_days.add(LocalDate.of(2010, JANUARY, 1)); + test_days.add(LocalDate.of(2010, JANUARY, 18)); + test_days.add(LocalDate.of(2010, NOVEMBER, 26)); + test_days_l1.addAll(test_days); + test_days_l1.add(LocalDate.of(2010, JANUARY, 2)); + test_days_l2.addAll(test_days_l1); + test_days_l2.add(LocalDate.of(2010, JANUARY, 3)); + + test_days_l11.addAll(test_days); + test_days_l11.add(LocalDate.of(2010, JULY, 27)); + test_days_l11.add(LocalDate.of(2010, JULY, 9)); + test_days_l11.add(LocalDate.of(2010, FEBRUARY, 26)); + test_days_l11.add(LocalDate.of(2010, AUGUST, 11)); + test_days_l11.add(LocalDate.of(2010, SEPTEMBER, 6)); + test_days_l11.add(LocalDate.of(2010, SEPTEMBER, 10)); + test_days_l11.add(LocalDate.of(2010, NOVEMBER, 17)); + test_days_l11.add(LocalDate.of(2010, DECEMBER, 7)); + test_days_l11.add(LocalDate.of(2010, DECEMBER, 16)); + } + + private Locale defaultLocale; + + @BeforeEach + void init() { + System.setProperty(" de.focus_shift.jaxb.mapping.urls", "file:./src/test/resources/test.app.properties"); + defaultLocale = Locale.getDefault(); + Locale.setDefault(GERMAN); + } + + @AfterEach + void destroy() { + Locale.setDefault(defaultLocale); + System.clearProperty(" de.focus_shift.jaxb.mapping.urls"); + } + + @Test + void testMissingCountry() { + final ManagerParameter parameter = ManagerParameters.create("XXX"); + assertThatThrownBy(() -> HolidayManager.getInstance(parameter)) + .isInstanceOf(IllegalStateException.class); + } + + @Test + void testBaseStructure() { + final HolidayManager holidayManager = HolidayManager.getInstance(ManagerParameters.create("test")); + final CalendarHierarchy calendarHierarchy = holidayManager.getCalendarHierarchy(); + assertThat(calendarHierarchy.getId()).isEqualTo("test"); + assertThat(calendarHierarchy.getChildren()).hasSize(2); + for (CalendarHierarchy hi : calendarHierarchy.getChildren().values()) { + if (hi.getId().equalsIgnoreCase("level1")) { + assertThat(hi.getChildren()).hasSize(1); + } else if (hi.getId().equalsIgnoreCase("level11")) { + assertThat(hi.getChildren()).isEmpty(); + } + } + } + + @Test + void testHierarchyDescriptionsDefined() { + for (HolidayCalendar holidayCalendar : HolidayCalendar.values()) { + final HolidayManager holidayManager = HolidayManager.getInstance(ManagerParameters.create(holidayCalendar)); + assertNotUndefined(holidayCalendar, holidayManager.getCalendarHierarchy()); + } + } + + private void assertNotUndefined(HolidayCalendar calendar, CalendarHierarchy c) { + assertThat(c.getDescription()).isNotEqualTo("undefined"); + for (Map.Entry element : c.getChildren().entrySet()) { + assertNotUndefined(calendar, element.getValue()); + } + } + + @Test + void testIsHolidayPerformanceMultithreaded() throws InterruptedException { + LocalDate date = LocalDate.of(2010, 1, 1); + final AtomicLong count = new AtomicLong(0); + final AtomicLong sumDuration = new AtomicLong(0); + ExecutorService executorService = Executors.newCachedThreadPool(); + while (date.getYear() < 2013) { + final LocalDate localDate = date; + executorService.submit(() -> { + long start = System.currentTimeMillis(); + HolidayManager m = HolidayManager.getInstance(ManagerParameters.create("test")); + m.isHoliday(localDate); + long duration = System.currentTimeMillis() - start; + count.incrementAndGet(); + sumDuration.addAndGet(duration); + }); + date = date.plusDays(1); + } + executorService.shutdown(); + executorService.awaitTermination(5, TimeUnit.SECONDS); + LOG.info("isHoliday took {} millis average tested with {} calls.", sumDuration.doubleValue() / count.doubleValue(), count.longValue()); + } + + @Test + void testCalendarChronology() { + final HolidayManager holidayManager = HolidayManager.getInstance(ManagerParameters.create("test")); + final Calendar calendar = Calendar.getInstance(); + calendar.set(Calendar.YEAR, 2010); + calendar.set(Calendar.MONTH, Calendar.FEBRUARY); + calendar.set(Calendar.DAY_OF_MONTH, 16); + assertThat(holidayManager.isHoliday(calendar)).isFalse(); + + calendar.add(Calendar.DAY_OF_YEAR, 1); + assertThat(holidayManager.isHoliday(calendar)).isTrue(); + } + + @Test + void testBaseDates() { + final HolidayManager holidayManager = HolidayManager.getInstance(ManagerParameters.create("test")); + final Set holidays = holidayManager.getHolidays(2010); + assertThat(holidays).isNotNull(); + assertDates(test_days, holidays); + } + + private void assertDates(Set expected, Set holidays) { + for (LocalDate localDate : expected) { + if (!calendarUtil.contains(holidays, localDate)) { + fail("Missing " + localDate + " in " + holidays); + } + } + assertThat(holidays).hasSameSizeAs(expected); + } + + @Test + void testLevel1() { + final HolidayManager holidayManager = HolidayManager.getInstance(ManagerParameters.create("test")); + final Set holidays = holidayManager.getHolidays(2010, "level1"); + assertThat(holidays).isNotNull(); + assertDates(test_days_l1, holidays); + } + + @Test + void testLevel2() { + final HolidayManager holidayManager = HolidayManager.getInstance(ManagerParameters.create("test")); + final Set holidays = holidayManager.getHolidays(2010, "level1", "level2"); + assertThat(holidays).isNotNull(); + assertDates(test_days_l2, holidays); + } + + @Test + void testLevel11() { + final HolidayManager holidayManager = HolidayManager.getInstance(ManagerParameters.create("test")); + final Set holidays = holidayManager.getHolidays(2010, "level11"); + assertThat(holidays).isNotNull(); + assertDates(test_days_l11, holidays); + } + + @Test + void ensureThatExceptionIsThrownOnSubConfigurationWithSameId() { + final ManagerParameter parameter = ManagerParameters.create("test_fail"); + assertThatThrownBy(() -> HolidayManager.getInstance(parameter)) + .isInstanceOf(IllegalArgumentException.class); + } + + @Test + void testAllAvailableManagers() { + final Set supportedCalendarCodes = HolidayManager.getSupportedCalendarCodes(); + assertThat(supportedCalendarCodes) + .isNotNull() + .isNotEmpty(); + for (String calendar : supportedCalendarCodes) { + final HolidayManager manager = HolidayManager.getInstance(ManagerParameters.create(calendar)); + assertThat(manager).isNotNull(); + } + } + + @Test + void testHolidayDescription() { + Locale.setDefault(ENGLISH); + + final Holiday holiday = new Holiday(LocalDate.of(2011, 2, 2), "CHRISTMAS", OFFICIAL_HOLIDAY); + assertThat(holiday.getDescription()).isEqualTo("Christmas"); + assertThat(holiday.getDescription(GERMAN)).isEqualTo("Weihnachten"); + assertThat(holiday.getDescription(new Locale("nl"))).isEqualTo("Kerstmis"); + } + + @Test + void testHolidayEquals() { + final Holiday h1 = new Holiday(LocalDate.of(2011, 2, 2), "CHRISTMAS", OFFICIAL_HOLIDAY); + assertThat(h1).isEqualTo(h1); + + final Holiday h2b = new Holiday(LocalDate.of(2011, 2, 2), "CHRISTMAS", OFFICIAL_HOLIDAY); + assertThat(h1).isEqualTo(h2b); + + final Holiday h2 = new Holiday(LocalDate.of(2011, 2, 1), "CHRISTMAS", OFFICIAL_HOLIDAY); + assertThat(h1).isNotEqualTo(h2); + + final Holiday h3 = new Holiday(LocalDate.of(2011, 2, 2), "NEW_YEAR", OFFICIAL_HOLIDAY); + assertThat(h1).isNotEqualTo(h3); + + final Holiday h4 = new Holiday(LocalDate.of(2011, 2, 2), "CHRISTMAS", UNOFFICIAL_HOLIDAY); + assertThat(h1).isNotEqualTo(h4); + } +} diff --git a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayUATest.java b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayUATest.java similarity index 89% rename from jollyday-tests/src/test/java/de/focus_shift/tests/HolidayUATest.java rename to jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayUATest.java index 87b221950..f5a9b08d0 100644 --- a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayUATest.java +++ b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayUATest.java @@ -1,6 +1,6 @@ -package de.focus_shift.tests; +package de.focus_shift.tests.country; -import de.focus_shift.tests.base.AbstractCountryTestBase; +import de.focus_shift.tests.country.base.AbstractCountryTestBase; import org.junit.jupiter.api.Test; class HolidayUATest extends AbstractCountryTestBase { diff --git a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayUSTest.java b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayUSTest.java similarity index 77% rename from jollyday-tests/src/test/java/de/focus_shift/tests/HolidayUSTest.java rename to jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayUSTest.java index b7f09e07a..c0268a35e 100644 --- a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayUSTest.java +++ b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayUSTest.java @@ -1,6 +1,6 @@ -package de.focus_shift.tests; +package de.focus_shift.tests.country; -import de.focus_shift.tests.base.AbstractCountryTestBase; +import de.focus_shift.tests.country.base.AbstractCountryTestBase; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; diff --git a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayUYTest.java b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayUYTest.java similarity index 96% rename from jollyday-tests/src/test/java/de/focus_shift/tests/HolidayUYTest.java rename to jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayUYTest.java index ee62136eb..f3f834836 100644 --- a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayUYTest.java +++ b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayUYTest.java @@ -1,9 +1,9 @@ -package de.focus_shift.tests; +package de.focus_shift.tests.country; import de.focus_shift.Holiday; import de.focus_shift.HolidayManager; import de.focus_shift.ManagerParameters; -import de.focus_shift.tests.base.AbstractCountryTestBase; +import de.focus_shift.tests.country.base.AbstractCountryTestBase; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayVGTest.java b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayVGTest.java similarity index 95% rename from jollyday-tests/src/test/java/de/focus_shift/tests/HolidayVGTest.java rename to jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayVGTest.java index 28384edec..cdb0b0d83 100644 --- a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayVGTest.java +++ b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayVGTest.java @@ -1,10 +1,10 @@ -package de.focus_shift.tests; +package de.focus_shift.tests.country; import de.focus_shift.Holiday; import de.focus_shift.HolidayCalendar; import de.focus_shift.HolidayManager; import de.focus_shift.ManagerParameters; -import de.focus_shift.tests.base.AbstractCountryTestBase; +import de.focus_shift.tests.country.base.AbstractCountryTestBase; import de.focus_shift.util.CalendarUtil; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; diff --git a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayXKTest.java b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayXKTest.java similarity index 96% rename from jollyday-tests/src/test/java/de/focus_shift/tests/HolidayXKTest.java rename to jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayXKTest.java index f20367113..5a3770559 100644 --- a/jollyday-tests/src/test/java/de/focus_shift/tests/HolidayXKTest.java +++ b/jollyday-tests/src/test/java/de/focus_shift/tests/country/HolidayXKTest.java @@ -1,9 +1,9 @@ -package de.focus_shift.tests; +package de.focus_shift.tests.country; import de.focus_shift.Holiday; import de.focus_shift.HolidayManager; import de.focus_shift.ManagerParameters; -import de.focus_shift.tests.base.AbstractCountryTestBase; +import de.focus_shift.tests.country.base.AbstractCountryTestBase; import de.focus_shift.util.CalendarUtil; import org.junit.jupiter.api.Test; diff --git a/jollyday-tests/src/test/java/de/focus_shift/tests/ISOCodesTest.java b/jollyday-tests/src/test/java/de/focus_shift/tests/country/ISOCodesTest.java similarity index 98% rename from jollyday-tests/src/test/java/de/focus_shift/tests/ISOCodesTest.java rename to jollyday-tests/src/test/java/de/focus_shift/tests/country/ISOCodesTest.java index 7e6432bbd..ab74ef7b4 100644 --- a/jollyday-tests/src/test/java/de/focus_shift/tests/ISOCodesTest.java +++ b/jollyday-tests/src/test/java/de/focus_shift/tests/country/ISOCodesTest.java @@ -1,4 +1,4 @@ -package de.focus_shift.tests; +package de.focus_shift.tests.country; import de.focus_shift.util.ResourceUtil; import org.junit.jupiter.api.AfterEach; diff --git a/jollyday-tests/src/test/java/de/focus_shift/tests/UtilTest.java b/jollyday-tests/src/test/java/de/focus_shift/tests/country/UtilTest.java similarity index 99% rename from jollyday-tests/src/test/java/de/focus_shift/tests/UtilTest.java rename to jollyday-tests/src/test/java/de/focus_shift/tests/country/UtilTest.java index ea4b72a97..4493a159a 100644 --- a/jollyday-tests/src/test/java/de/focus_shift/tests/UtilTest.java +++ b/jollyday-tests/src/test/java/de/focus_shift/tests/country/UtilTest.java @@ -1,4 +1,4 @@ -package de.focus_shift.tests; +package de.focus_shift.tests.country; import de.focus_shift.Holiday; import de.focus_shift.HolidayCalendar; diff --git a/jollyday-tests/src/test/java/de/focus_shift/tests/base/AbstractCountryTestBase.java b/jollyday-tests/src/test/java/de/focus_shift/tests/country/base/AbstractCountryTestBase.java similarity index 99% rename from jollyday-tests/src/test/java/de/focus_shift/tests/base/AbstractCountryTestBase.java rename to jollyday-tests/src/test/java/de/focus_shift/tests/country/base/AbstractCountryTestBase.java index 74efccf57..d0b464a1f 100644 --- a/jollyday-tests/src/test/java/de/focus_shift/tests/base/AbstractCountryTestBase.java +++ b/jollyday-tests/src/test/java/de/focus_shift/tests/country/base/AbstractCountryTestBase.java @@ -1,4 +1,4 @@ -package de.focus_shift.tests.base; +package de.focus_shift.tests.country.base; import de.focus_shift.CalendarHierarchy; import de.focus_shift.Holiday; diff --git a/jollyday-tests/src/test/java/de/focus_shift/datasource/ConfigurationServiceManagerTest.java b/jollyday-tests/src/test/java/de/focus_shift/tests/datasource/datasource/ConfigurationServiceManagerTest.java similarity index 94% rename from jollyday-tests/src/test/java/de/focus_shift/datasource/ConfigurationServiceManagerTest.java rename to jollyday-tests/src/test/java/de/focus_shift/tests/datasource/datasource/ConfigurationServiceManagerTest.java index d47b45c93..98d844ad5 100644 --- a/jollyday-tests/src/test/java/de/focus_shift/datasource/ConfigurationServiceManagerTest.java +++ b/jollyday-tests/src/test/java/de/focus_shift/tests/datasource/datasource/ConfigurationServiceManagerTest.java @@ -1,7 +1,8 @@ -package de.focus_shift.datasource; +package de.focus_shift.tests.datasource.datasource; import de.focus_shift.ManagerParameter; import de.focus_shift.ManagerParameters; +import de.focus_shift.datasource.ConfigurationServiceManager; import de.focus_shift.jaxb.JaxbConfigurationService; import de.focus_shift.spi.ConfigurationService; import org.junit.jupiter.api.Test; diff --git a/jollyday-tests/src/test/java/de/focus_shift/impl/ChristianHolidayParserTest.java b/jollyday-tests/src/test/java/de/focus_shift/tests/impl/ChristianHolidayParserTest.java similarity index 99% rename from jollyday-tests/src/test/java/de/focus_shift/impl/ChristianHolidayParserTest.java rename to jollyday-tests/src/test/java/de/focus_shift/tests/impl/ChristianHolidayParserTest.java index fb0f84d28..960426175 100644 --- a/jollyday-tests/src/test/java/de/focus_shift/impl/ChristianHolidayParserTest.java +++ b/jollyday-tests/src/test/java/de/focus_shift/tests/impl/ChristianHolidayParserTest.java @@ -1,4 +1,4 @@ -package de.focus_shift.impl; +package de.focus_shift.tests.impl; import de.focus_shift.Holiday; import de.focus_shift.jaxb.JaxbHolidays; diff --git a/jollyday-tests/src/test/java/de/focus_shift/impl/EthiopianOrthodoxHolidayParserTest.java b/jollyday-tests/src/test/java/de/focus_shift/tests/impl/EthiopianOrthodoxHolidayParserTest.java similarity index 98% rename from jollyday-tests/src/test/java/de/focus_shift/impl/EthiopianOrthodoxHolidayParserTest.java rename to jollyday-tests/src/test/java/de/focus_shift/tests/impl/EthiopianOrthodoxHolidayParserTest.java index 7b264c070..707fdad4a 100644 --- a/jollyday-tests/src/test/java/de/focus_shift/impl/EthiopianOrthodoxHolidayParserTest.java +++ b/jollyday-tests/src/test/java/de/focus_shift/tests/impl/EthiopianOrthodoxHolidayParserTest.java @@ -1,4 +1,4 @@ -package de.focus_shift.impl; +package de.focus_shift.tests.impl; import de.focus_shift.Holiday; import de.focus_shift.jaxb.JaxbHolidays; diff --git a/jollyday-tests/src/test/java/de/focus_shift/impl/FixedParserTest.java b/jollyday-tests/src/test/java/de/focus_shift/tests/impl/FixedParserTest.java similarity index 99% rename from jollyday-tests/src/test/java/de/focus_shift/impl/FixedParserTest.java rename to jollyday-tests/src/test/java/de/focus_shift/tests/impl/FixedParserTest.java index 8f9c6d67d..3fdc33477 100644 --- a/jollyday-tests/src/test/java/de/focus_shift/impl/FixedParserTest.java +++ b/jollyday-tests/src/test/java/de/focus_shift/tests/impl/FixedParserTest.java @@ -1,4 +1,4 @@ -package de.focus_shift.impl; +package de.focus_shift.tests.impl; import de.focus_shift.Holiday; import de.focus_shift.jaxb.JaxbHolidays; diff --git a/jollyday-tests/src/test/java/de/focus_shift/impl/FixedWeekdayBetweenFixedParserTest.java b/jollyday-tests/src/test/java/de/focus_shift/tests/impl/FixedWeekdayBetweenFixedParserTest.java similarity index 98% rename from jollyday-tests/src/test/java/de/focus_shift/impl/FixedWeekdayBetweenFixedParserTest.java rename to jollyday-tests/src/test/java/de/focus_shift/tests/impl/FixedWeekdayBetweenFixedParserTest.java index 4bc59f86c..0592894af 100644 --- a/jollyday-tests/src/test/java/de/focus_shift/impl/FixedWeekdayBetweenFixedParserTest.java +++ b/jollyday-tests/src/test/java/de/focus_shift/tests/impl/FixedWeekdayBetweenFixedParserTest.java @@ -1,4 +1,4 @@ -package de.focus_shift.impl; +package de.focus_shift.tests.impl; import de.focus_shift.Holiday; import de.focus_shift.jaxb.JaxbHolidays; diff --git a/jollyday-tests/src/test/java/de/focus_shift/impl/FixedWeekdayInMonthParserTest.java b/jollyday-tests/src/test/java/de/focus_shift/tests/impl/FixedWeekdayInMonthParserTest.java similarity index 96% rename from jollyday-tests/src/test/java/de/focus_shift/impl/FixedWeekdayInMonthParserTest.java rename to jollyday-tests/src/test/java/de/focus_shift/tests/impl/FixedWeekdayInMonthParserTest.java index c7b54583d..15ac61ff5 100644 --- a/jollyday-tests/src/test/java/de/focus_shift/impl/FixedWeekdayInMonthParserTest.java +++ b/jollyday-tests/src/test/java/de/focus_shift/tests/impl/FixedWeekdayInMonthParserTest.java @@ -1,4 +1,4 @@ -package de.focus_shift.impl; +package de.focus_shift.tests.impl; import de.focus_shift.Holiday; import de.focus_shift.jaxb.JaxbHolidays; diff --git a/jollyday-tests/src/test/java/de/focus_shift/impl/FixedWeekdayRelativeToFixedParserTest.java b/jollyday-tests/src/test/java/de/focus_shift/tests/impl/FixedWeekdayRelativeToFixedParserTest.java similarity index 99% rename from jollyday-tests/src/test/java/de/focus_shift/impl/FixedWeekdayRelativeToFixedParserTest.java rename to jollyday-tests/src/test/java/de/focus_shift/tests/impl/FixedWeekdayRelativeToFixedParserTest.java index 02da7dcff..1d5b1d80f 100644 --- a/jollyday-tests/src/test/java/de/focus_shift/impl/FixedWeekdayRelativeToFixedParserTest.java +++ b/jollyday-tests/src/test/java/de/focus_shift/tests/impl/FixedWeekdayRelativeToFixedParserTest.java @@ -1,4 +1,4 @@ -package de.focus_shift.impl; +package de.focus_shift.tests.impl; import de.focus_shift.Holiday; import de.focus_shift.jaxb.JaxbHolidays; diff --git a/jollyday-tests/src/test/java/de/focus_shift/impl/RelativeToEasterSundayParserTest.java b/jollyday-tests/src/test/java/de/focus_shift/tests/impl/RelativeToEasterSundayParserTest.java similarity index 97% rename from jollyday-tests/src/test/java/de/focus_shift/impl/RelativeToEasterSundayParserTest.java rename to jollyday-tests/src/test/java/de/focus_shift/tests/impl/RelativeToEasterSundayParserTest.java index 2a394c147..9c37f16f6 100644 --- a/jollyday-tests/src/test/java/de/focus_shift/impl/RelativeToEasterSundayParserTest.java +++ b/jollyday-tests/src/test/java/de/focus_shift/tests/impl/RelativeToEasterSundayParserTest.java @@ -1,4 +1,4 @@ -package de.focus_shift.impl; +package de.focus_shift.tests.impl; import de.focus_shift.Holiday; import de.focus_shift.jaxb.JaxbHolidays; diff --git a/jollyday-tests/src/test/java/de/focus_shift/impl/RelativeToFixedParserTest.java b/jollyday-tests/src/test/java/de/focus_shift/tests/impl/RelativeToFixedParserTest.java similarity index 98% rename from jollyday-tests/src/test/java/de/focus_shift/impl/RelativeToFixedParserTest.java rename to jollyday-tests/src/test/java/de/focus_shift/tests/impl/RelativeToFixedParserTest.java index 1410ff9ba..39623c1c8 100644 --- a/jollyday-tests/src/test/java/de/focus_shift/impl/RelativeToFixedParserTest.java +++ b/jollyday-tests/src/test/java/de/focus_shift/tests/impl/RelativeToFixedParserTest.java @@ -1,4 +1,4 @@ -package de.focus_shift.impl; +package de.focus_shift.tests.impl; import de.focus_shift.Holiday; import de.focus_shift.jaxb.JaxbHolidays; diff --git a/jollyday-tests/src/test/java/de/focus_shift/impl/RelativeToWeekdayInMonthParserTest.java b/jollyday-tests/src/test/java/de/focus_shift/tests/impl/RelativeToWeekdayInMonthParserTest.java similarity index 98% rename from jollyday-tests/src/test/java/de/focus_shift/impl/RelativeToWeekdayInMonthParserTest.java rename to jollyday-tests/src/test/java/de/focus_shift/tests/impl/RelativeToWeekdayInMonthParserTest.java index 4fe34dc23..a7f4696d9 100644 --- a/jollyday-tests/src/test/java/de/focus_shift/impl/RelativeToWeekdayInMonthParserTest.java +++ b/jollyday-tests/src/test/java/de/focus_shift/tests/impl/RelativeToWeekdayInMonthParserTest.java @@ -1,4 +1,4 @@ -package de.focus_shift.impl; +package de.focus_shift.tests.impl; import de.focus_shift.Holiday; import de.focus_shift.jaxb.JaxbHolidays; diff --git a/jollyday-tests/src/test/java/de/focus_shift/parameter/ManagerParametersTest.java b/jollyday-tests/src/test/java/de/focus_shift/tests/parameter/ManagerParametersTest.java similarity index 95% rename from jollyday-tests/src/test/java/de/focus_shift/parameter/ManagerParametersTest.java rename to jollyday-tests/src/test/java/de/focus_shift/tests/parameter/ManagerParametersTest.java index 0b1c3fc1f..0898b6aee 100644 --- a/jollyday-tests/src/test/java/de/focus_shift/parameter/ManagerParametersTest.java +++ b/jollyday-tests/src/test/java/de/focus_shift/tests/parameter/ManagerParametersTest.java @@ -1,4 +1,4 @@ -package de.focus_shift.parameter; +package de.focus_shift.tests.parameter; import de.focus_shift.HolidayManager; import de.focus_shift.ManagerParameter; diff --git a/jollyday-tests/src/test/java/de/focus_shift/parameter/UrlManagerParameterTest.java b/jollyday-tests/src/test/java/de/focus_shift/tests/parameter/UrlManagerParameterTest.java similarity index 90% rename from jollyday-tests/src/test/java/de/focus_shift/parameter/UrlManagerParameterTest.java rename to jollyday-tests/src/test/java/de/focus_shift/tests/parameter/UrlManagerParameterTest.java index c0ceae20f..60b245a3c 100644 --- a/jollyday-tests/src/test/java/de/focus_shift/parameter/UrlManagerParameterTest.java +++ b/jollyday-tests/src/test/java/de/focus_shift/tests/parameter/UrlManagerParameterTest.java @@ -1,5 +1,6 @@ -package de.focus_shift.parameter; +package de.focus_shift.tests.parameter; +import de.focus_shift.parameter.UrlManagerParameter; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/jollyday-tests/src/test/java/de/focus_shift/util/ClassLoadingUtilTest.java b/jollyday-tests/src/test/java/de/focus_shift/tests/util/ClassLoadingUtilTest.java similarity index 90% rename from jollyday-tests/src/test/java/de/focus_shift/util/ClassLoadingUtilTest.java rename to jollyday-tests/src/test/java/de/focus_shift/tests/util/ClassLoadingUtilTest.java index fb5687631..11fce760c 100644 --- a/jollyday-tests/src/test/java/de/focus_shift/util/ClassLoadingUtilTest.java +++ b/jollyday-tests/src/test/java/de/focus_shift/tests/util/ClassLoadingUtilTest.java @@ -1,5 +1,6 @@ -package de.focus_shift.util; +package de.focus_shift.tests.util; +import de.focus_shift.util.ClassLoadingUtil; import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat;