Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
e5e5477
changes after vscode
Aug 11, 2025
37d5c49
Added TLVFeed
Aug 26, 2025
7bf5a9a
Merge branch 'portfolio-performance:master' into master
arnonm Aug 26, 2025
482d848
Merge branch 'portfolio-performance:master' into master
arnonm Aug 26, 2025
32b928a
removed old MAYA files
Aug 26, 2025
b15ad2c
more tests
Aug 26, 2025
213d325
Aded basic checks against the live api
Aug 26, 2025
a77adbf
Update main.yml - removed sonar
arnonm Aug 27, 2025
d5e15bf
Refactored TLV
Aug 31, 2025
0d8c403
Changed WebAccess to accept POST with data back
Aug 31, 2025
c13fb86
Changed to zulu 21 on macos
Aug 31, 2025
60530aa
Changes to tests
Sep 1, 2025
1c22ff2
Changes to tests
Sep 1, 2025
089531e
Added getnames to Security
Sep 1, 2025
03f506e
Finished history tests
Sep 2, 2025
4bb2137
Midway through refactoring
Sep 8, 2025
00e4968
Update main.yml - add SONAR_TOKEN
arnonm Sep 9, 2025
d3b9956
Update pom.xml - Changed Sonar Project locally for testing
arnonm Sep 9, 2025
6d2a7ae
Update main.yml - typo
arnonm Sep 9, 2025
e91092f
More work on refactoring
Sep 9, 2025
788936e
Changed sonar Project
Sep 9, 2025
3e4da63
Continue refactoring of tests
Sep 9, 2025
4d438f8
Update main.yml
arnonm Sep 9, 2025
0073f91
Added TLVFund tests
Sep 9, 2025
9f790f4
Initial commit for TLV Calendar
Sep 10, 2025
fbd3f86
Completed implementation of TLV Holidays
Sep 10, 2025
f063aa5
Passover added to TLV Calendar
Sep 11, 2025
16987ba
Added all standard Jewish Holidays
Sep 11, 2025
6f555f1
Completed Jewish Holidays
Sep 11, 2025
0bf6d8d
removed accidental change to workflows
Sep 11, 2025
14043b0
removed accidental changes
Sep 11, 2025
9103428
removed accidental changes
Sep 11, 2025
c462e25
removed filec changed by error
Sep 11, 2025
b5054b7
removed filec changed by error
Sep 11, 2025
71932ba
removed files change in error
Sep 11, 2025
c87ffbe
removed files change in error
Sep 11, 2025
cf26432
removed files change in error
Sep 11, 2025
c2ed11d
Corrected warnings
Sep 11, 2025
c064613
Merge branch 'master' into JewishCalendar
arnonm Sep 11, 2025
d9da12a
StyleCheck correction
arnonm Sep 11, 2025
5d4e350
Fixed Style issues
Sep 11, 2025
4f7c67b
Merge branch 'JewishCalendar' of https://github.com/arnonm/portfolio …
arnonm Sep 14, 2025
ef593a5
Fixed Independence/Memorial Day + various cleanup
arnonm Sep 15, 2025
de0372d
Add some improvements and fixes
Nirus2000 Sep 16, 2025
bd868a0
Remove obsolet source
Nirus2000 Sep 17, 2025
66bca9c
Fixed Passover II bug and removed Holaust Memorial
arnonm Sep 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
package name.abuchen.portfolio.util;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertFalse;

import java.time.LocalDate;

import org.junit.Test;

/**
* Test for Tel Aviv Stock Exchange (TASE) trading calendar. Based on official
* TASE trading vacation schedule starting 2026.
* https://www.tase.co.il/en/content/knowledge_center/trading_vacation_schedule#vacations
*/
public class TLVTradeCalendarTest
{

@Test
public void Regular_Lunar_Calendar_Holidays_should_be_a_holiday()
{
var calendar = TradeCalendarManager.getInstance("tlv");

// Passover I Evening and Day, Passover II Evening and Day
assertThat(calendar.isHoliday(LocalDate.parse("2024-04-22")), is(true));
assertThat(calendar.isHoliday(LocalDate.parse("2024-04-23")), is(true));
assertThat(calendar.isHoliday(LocalDate.parse("2024-04-28")), is(true));
assertThat(calendar.isHoliday(LocalDate.parse("2024-04-29")), is(true));

assertThat(calendar.isHoliday(LocalDate.parse("2025-04-12")), is(true));
assertThat(calendar.isHoliday(LocalDate.parse("2025-04-13")), is(true));
assertThat(calendar.isHoliday(LocalDate.parse("2025-04-18")), is(true));
assertThat(calendar.isHoliday(LocalDate.parse("2025-04-19")), is(true));

assertThat(calendar.isHoliday(LocalDate.parse("2026-04-01")), is(true));
assertThat(calendar.isHoliday(LocalDate.parse("2026-04-02")), is(true));
assertThat(calendar.isHoliday(LocalDate.parse("2026-04-07")), is(true));
assertThat(calendar.isHoliday(LocalDate.parse("2026-04-08")), is(true));

// Jewish New Years Eve
assertThat(calendar.isHoliday(LocalDate.parse("2024-10-02")), is(true));
assertThat(calendar.isHoliday(LocalDate.parse("2025-09-22")), is(true));
assertThat(calendar.isHoliday(LocalDate.parse("2026-09-11")), is(true));

// Jewish New Years Day I
assertThat(calendar.isHoliday(LocalDate.parse("2024-10-03")), is(true));
assertThat(calendar.isHoliday(LocalDate.parse("2025-09-23")), is(true));
assertThat(calendar.isHoliday(LocalDate.parse("2026-09-12")), is(true));

// Jewish New Years Day II
assertThat(calendar.isHoliday(LocalDate.parse("2024-10-04")), is(true));
assertThat(calendar.isHoliday(LocalDate.parse("2025-09-24")), is(true));
assertThat(calendar.isHoliday(LocalDate.parse("2026-09-13")), is(true));

// YOM_KIPUR_EVE, if (hebDay == 9 && hebMonth == 7)
assertThat(calendar.isHoliday(LocalDate.parse("2024-10-11")), is(true));
assertThat(calendar.isHoliday(LocalDate.parse("2025-10-01")), is(true));
assertThat(calendar.isHoliday(LocalDate.parse("2026-09-20")), is(true));

// YOM_KIPUR_DAY
assertThat(calendar.isHoliday(LocalDate.parse("2024-10-12")), is(true));
assertThat(calendar.isHoliday(LocalDate.parse("2025-10-02")), is(true));
assertThat(calendar.isHoliday(LocalDate.parse("2026-09-21")), is(true));

// FAST_DAY Tisha B'Av
assertThat(calendar.isHoliday(LocalDate.parse("2024-08-13")), is(true));
assertThat(calendar.isHoliday(LocalDate.parse("2025-08-03")), is(true));
assertThat(calendar.isHoliday(LocalDate.parse("2026-07-23")), is(true));

// SIMCHAT_TORA_EVE, if (hebDay == 22 && hebMonth == 7)
assertThat(calendar.isHoliday(LocalDate.parse("2024-10-23")), is(true));
assertThat(calendar.isHoliday(LocalDate.parse("2025-10-13")), is(true));
assertThat(calendar.isHoliday(LocalDate.parse("2026-10-02")), is(true));

// SIMCHAT_TORA; if (hebDay == 23 & hebMonth == 7)
assertThat(calendar.isHoliday(LocalDate.parse("2024-10-24")), is(true));
assertThat(calendar.isHoliday(LocalDate.parse("2025-10-14")), is(true));
assertThat(calendar.isHoliday(LocalDate.parse("2026-10-03")), is(true));

// SHAVUOT_EVE and SHAVUOT
assertThat(calendar.isHoliday(LocalDate.parse("2024-06-11")), is(true));
assertThat(calendar.isHoliday(LocalDate.parse("2024-06-12")), is(true));
assertThat(calendar.isHoliday(LocalDate.parse("2025-06-01")), is(true));
assertThat(calendar.isHoliday(LocalDate.parse("2025-06-02")), is(true));
assertThat(calendar.isHoliday(LocalDate.parse("2026-05-21")), is(true));
assertThat(calendar.isHoliday(LocalDate.parse("2026-05-22")), is(true));

// SUKKOTH_EVE, if (hebDay == 14 && hebMonth == 7)
assertThat(calendar.isHoliday(LocalDate.parse("2024-10-16")), is(true));
assertThat(calendar.isHoliday(LocalDate.parse("2025-10-06")), is(true));
assertThat(calendar.isHoliday(LocalDate.parse("2026-09-25")), is(true));

// SUKKOTH, if (hebDay == 15 && hebMonth == 7)
assertThat(calendar.isHoliday(LocalDate.parse("2024-10-17")), is(true));
assertThat(calendar.isHoliday(LocalDate.parse("2025-10-07")), is(true));
assertThat(calendar.isHoliday(LocalDate.parse("2026-09-26")), is(true));
}

@Test
public void Special_Jewish_Calendar_Holidays_should_be_a_holiday()
{
var calendar = TradeCalendarManager.getInstance("tlv");

// PURIM
assertThat(calendar.isHoliday(LocalDate.parse("2024-03-24")), is(true));
assertThat(calendar.isHoliday(LocalDate.parse("2025-03-14")), is(true));
assertThat(calendar.isHoliday(LocalDate.parse("2026-03-03")), is(true));
}

@Test
public void Israeli_Memorial_Day_should_be_a_holiday()
{
var calendar = TradeCalendarManager.getInstance("tlv");

// Memorial Day (Yom HaZikaron)
assertThat(calendar.isHoliday(LocalDate.parse("2024-05-13")), is(true));
assertThat(calendar.isHoliday(LocalDate.parse("2025-04-30")), is(true));
assertThat(calendar.isHoliday(LocalDate.parse("2026-04-21")), is(true));
}

@Test
public void Israeli_Independence_Day_should_be_a_holiday()
{
var calendar = TradeCalendarManager.getInstance("tlv");

// Independence Day (Yom Ha'atzmaut)
assertThat(calendar.isHoliday(LocalDate.parse("2024-05-14")), is(true));
assertThat(calendar.isHoliday(LocalDate.parse("2025-05-01")), is(true));
assertThat(calendar.isHoliday(LocalDate.parse("2026-04-22")), is(true));
}

@Test
public void testWeekendsAfter2016()
{
var calendar = TradeCalendarManager.getInstance("tlv");

assertFalse(calendar == null);
assertThat(calendar.isHoliday(LocalDate.parse("2026-01-10")), is(true));
assertThat(calendar.isHoliday(LocalDate.parse("2026-01-11")), is(true));
}

@Test
public void Regular_working_days_should_not_be_holidays()
{
var calendar = TradeCalendarManager.getInstance("tlv");

// Regular weekdays that are not holidays
assertThat(calendar.isHoliday(LocalDate.parse("2024-01-02")), is(false)); // Tuesday
assertThat(calendar.isHoliday(LocalDate.parse("2024-01-03")), is(false)); // Wednesday
assertThat(calendar.isHoliday(LocalDate.parse("2024-01-04")), is(false)); // Thursday

assertThat(calendar.isHoliday(LocalDate.parse("2025-01-06")), is(false)); // Monday
assertThat(calendar.isHoliday(LocalDate.parse("2025-01-07")), is(false)); // Tuesday

assertThat(calendar.isHoliday(LocalDate.parse("2026-01-06")), is(false)); // Monday
assertThat(calendar.isHoliday(LocalDate.parse("2026-01-07")), is(false)); // Tuesday
assertThat(calendar.isHoliday(LocalDate.parse("2026-01-08")), is(false)); // Wednesday
}

@Test
public void Edge_cases_with_Sabbath_adjustments()
{
var calendar = TradeCalendarManager.getInstance("tlv");

assertThat(calendar.isHoliday(LocalDate.parse("2024-05-13")), is(true)); // Memorial Day adjusted
assertThat(calendar.isHoliday(LocalDate.parse("2024-05-14")), is(true)); // Independence Day adjusted
}

@Test
public void Multi_year_consistency_test()
{
var calendar = TradeCalendarManager.getInstance("tlv");

// Test multiple years to ensure calendar consistency
int[] testYears = { 2024, 2025, 2026 };

for (int year : testYears)
{
// Each year should have Rosh Hashanah (2 days)
var roshHashanahStart = LocalDate.of(year, 9, 1); // approximate
var foundRoshHashanah = false;

// Search for Rosh Hashanah in September/October
for (var day = 1; day <= 60; day++)
{
var testDate = roshHashanahStart.plusDays(day);
if (testDate.getYear() > year)
break;

if (calendar.isHoliday(testDate) && calendar.isHoliday(testDate.plusDays(1)))
{
foundRoshHashanah = true;
break;
}
}

assertThat("Rosh Hashanah not found for year " + year, foundRoshHashanah, is(true));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ public class Messages extends NLS
public static String LabelTradeCalendarSSE;
public static String LabelTradeCalendarSix;
public static String LabelTradeCalendarTARGET2;
public static String LabelTradeCalendarTLV;
public static String LabelTradeCalendarTSX;
public static String LabelTradeCalendarUseDefault;
public static String LabelTradeCalendarVSE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,8 @@ LabelTradeCalendarSix = Swiss Exchange (SIX)

LabelTradeCalendarTARGET2 = TARGET2 (Eurozone banking day)

LabelTradeCalendarTLV = Tel Aviv Stock Exchange Trade

LabelTradeCalendarTSX = Toronto Stock Exchange

LabelTradeCalendarUseDefault = (Use globally configured calendar: {0})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ ILA = Israeli agora

ILA.symbol = agorot

ILS = Israeli new sheqel
ILS = Israeli new shekel

ILS.symbol = \u20AA

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,32 +32,49 @@
FAMILY_DAY,
FIRST_CHRISTMAS_DAY,
GOOD_FRIDAY,
HOLOCAUST_REMEMBERENCE_DAY,
HURRICANE_SANDY,
INDEPENDENCE,
INDEPENDENCE_DAY,
INDIGENOUS_PEOPLE,
INMACULATE_CONCEPTION,
INTERNATION_WOMENS_DAY,
JEWISH_FAST_DAY,
JEWISH_NEW_YEAR_DAY_I,
JEWISH_NEW_YEAR_DAY_II,
JEWISH_NEW_YEAR_EVE,
JUNETEENTH,
KINGS_BIRTHDAY,
LABOUR_DAY,
MARTIN_LUTHER_KING,
MEMORIAL,
MEMORIAL_DAY,
MILLENNIUM,
NATION_DAY,
NEW_YEAR,
NEW_YEARS_EVE,
NEW_YEAR_HOLIDAY,
NEW_YEARS_EVE,
PASSOVER_I_EVE,
PASSOVER_I,
PASSOVER_II_EVE,
PASSOVER_II,
PATRON_DAY,
PURIM,
REFORMATION_DAY,
REPENTANCE_AND_PRAYER,
REPUBLIC_PROCLAMATION_DAY,
ROYAL_JUBILEE,
ROYAL_WEDDING,
SAINT_STEPHEN,
SAINT_PETER_PAUL,
SAINT_STEPHEN,
SAVHUOT_EVE,
SECOND_CHRISTMAS_DAY,
SHAVUOT_DAY,
SIMCHAT_TORA,
SIMCHAT_TORA_EVE,
SPRING_MAY_BANK_HOLIDAY,
STATE_FUNERAL,
STATE_FUNERAL, SUKKOTH_DAY,
SUKKOTH_EVE,
SUMMER_BANK_HOLIDAY,
TERRORIST_ATTACKS,
THANKSGIVING,
Expand All @@ -68,7 +85,9 @@
VICTORY_DAY,
VIRGIN_OF_CARMEN,
WASHINGTONS_BIRTHDAY,
WHIT_MONDAY;
WHIT_MONDAY,
YOM_KIPUR,
YOM_KIPUR_EVE;

private static final ResourceBundle RESOURCES = ResourceBundle
.getBundle("name.abuchen.portfolio.util.holiday-names"); //$NON-NLS-1$
Expand Down
Loading