From 508898f52c16cc737bc7d08b8ee4c29fab8d1146 Mon Sep 17 00:00:00 2001 From: Kostya Date: Sun, 6 Sep 2026 10:36:54 +0300 Subject: ex-2: add invalid-input fixtures and wire ui-desktop to the service The ex-2 loader has to reject documents that are schema-valid but logically broken, and so far only error-2.xml and error-3.xml exercised that path. Add one fixture per validation rule under test-data/ex-2/invalid, each a copy of small.xml with a single defect described in a leading comment: a non-.xml extension, a duplicate event id, commission outside 0..90 on either side, a duplicate user name, zero or negative initial cash, a market maker referencing an unknown event, and an event with no market maker or with two. Teach LedgerMapper to map individual LedgerEntry records to LedgerEntryDTO, renaming id to seq and time to at and rendering the timestamp through InstantOptions.humanize, so callers can show a ledger history rather than only the account summary. Make ui-desktop depend on api and service in the build tooling and in its Eclipse classpath, since the desktop UI now talks to the service layer directly, and put lib/openjfx on java.library.path for the test run so tests touching JavaFX can load its native libraries. --- test-data/ex-2/invalid/ex1-not-xml.txt | 49 ++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 test-data/ex-2/invalid/ex1-not-xml.txt (limited to 'test-data/ex-2/invalid/ex1-not-xml.txt') diff --git a/test-data/ex-2/invalid/ex1-not-xml.txt b/test-data/ex-2/invalid/ex1-not-xml.txt new file mode 100644 index 0000000..488b486 --- /dev/null +++ b/test-data/ex-2/invalid/ex1-not-xml.txt @@ -0,0 +1,49 @@ + + + + + + 1 + This event gambles if Mujtaba is a live or not. it will be determined if he will be shown in public until 31.8.26 + 5 + + Hell Yea ! + No way ! + + + + 100 + + + + + 2 + Who do you think will win the world cap ? + 15 + + Argentina + Spain + + + + + + + + + 1000 + + + + + + 10000 + + + + + + 100 + + + -- cgit v1.2.3