summaryrefslogtreecommitdiffstats
path: root/test-data/ex-2/invalid/ex2-event-without-mm.xml
diff options
context:
space:
mode:
authorKostya <mail@sartin.in>2026-09-06 10:36:54 +0300
committerKostya <mail@sartin.in>2026-09-06 10:36:54 +0300
commit508898f52c16cc737bc7d08b8ee4c29fab8d1146 (patch)
treeea2516796c7dc959a0009e70569e0d2d2b718c1f /test-data/ex-2/invalid/ex2-event-without-mm.xml
parentda82f3b492c3cd36f2e8723632a63a6cc1f4e39b (diff)
downloadguess-market-508898f52c16cc737bc7d08b8ee4c29fab8d1146.tar.gz
guess-market-508898f52c16cc737bc7d08b8ee4c29fab8d1146.tar.xz
guess-market-508898f52c16cc737bc7d08b8ee4c29fab8d1146.zip
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.
Diffstat (limited to 'test-data/ex-2/invalid/ex2-event-without-mm.xml')
-rw-r--r--test-data/ex-2/invalid/ex2-event-without-mm.xml46
1 files changed, 46 insertions, 0 deletions
diff --git a/test-data/ex-2/invalid/ex2-event-without-mm.xml b/test-data/ex-2/invalid/ex2-event-without-mm.xml
new file mode 100644
index 0000000..26d1da6
--- /dev/null
+++ b/test-data/ex-2/invalid/ex2-event-without-mm.xml
@@ -0,0 +1,46 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<!-- Ex2 check 4: every event has exactly one MM. Event 1 has none (Tikva is no longer its MM). -->
3<Guess-Market xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="GM-EX2-Schema.xsd">
4 <GM-events>
5 <GM-event name="Mujtaba is Dead">
6 <id>1</id>
7 <description>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</description>
8 <commission type="on-purchase">5</commission>
9 <GM-options>
10 <GM-option>Hell Yea !</GM-option>
11 <GM-option>No way !</GM-option>
12 </GM-options>
13 <GM-method>
14 <GM-LMSR>
15 <b>100</b>
16 </GM-LMSR>
17 </GM-method>
18 </GM-event>
19 <GM-event name="World Cap Winner">
20 <id>2</id>
21 <description>Who do you think will win the world cap ?</description>
22 <commission type="on-close">15</commission>
23 <GM-options>
24 <GM-option>Argentina</GM-option>
25 <GM-option>Spain</GM-option>
26 </GM-options>
27 <GM-method>
28 <GM-order-book allow-mint="true" initial="100" d="1"/>
29 </GM-method>
30 </GM-event>
31 </GM-events>
32 <GM-users>
33 <GM-user name="Avrum">
34 <initial-cash>1000</initial-cash>
35 <GM-market-maker>
36 <event id="2"/>
37 </GM-market-maker>
38 </GM-user>
39 <GM-user name="Tikva">
40 <initial-cash>10000</initial-cash>
41 </GM-user>
42 <GM-user name="Menash">
43 <initial-cash>100</initial-cash>
44 </GM-user>
45 </GM-users>
46</Guess-Market>