summaryrefslogtreecommitdiffstats
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
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.
-rw-r--r--service/src/main/java/market/guess/service/catalog/infrastructure/adapter/LedgerMapper.java13
-rw-r--r--test-data/ex-2/invalid/ex1-commission-above-90.xml49
-rw-r--r--test-data/ex-2/invalid/ex1-commission-below-0.xml49
-rw-r--r--test-data/ex-2/invalid/ex1-duplicate-event-id.xml49
-rw-r--r--test-data/ex-2/invalid/ex1-not-xml.txt49
-rw-r--r--test-data/ex-2/invalid/ex2-duplicate-user.xml49
-rw-r--r--test-data/ex-2/invalid/ex2-event-two-mms.xml52
-rw-r--r--test-data/ex-2/invalid/ex2-event-without-mm.xml46
-rw-r--r--test-data/ex-2/invalid/ex2-mm-unknown-event.xml52
-rw-r--r--test-data/ex-2/invalid/ex2-negative-initial-cash.xml49
-rw-r--r--test-data/ex-2/invalid/ex2-zero-initial-cash.xml49
-rw-r--r--tools/_util.sh2
-rw-r--r--tools/test.sh2
-rw-r--r--ui-desktop/.classpath3
14 files changed, 510 insertions, 3 deletions
diff --git a/service/src/main/java/market/guess/service/catalog/infrastructure/adapter/LedgerMapper.java b/service/src/main/java/market/guess/service/catalog/infrastructure/adapter/LedgerMapper.java
index 5a46540..9744925 100644
--- a/service/src/main/java/market/guess/service/catalog/infrastructure/adapter/LedgerMapper.java
+++ b/service/src/main/java/market/guess/service/catalog/infrastructure/adapter/LedgerMapper.java
@@ -1,10 +1,23 @@
1package market.guess.service.catalog.infrastructure.adapter; 1package market.guess.service.catalog.infrastructure.adapter;
2 2
3import java.time.Instant;
3import market.guess.model.ledger.LedgerDTO; 4import market.guess.model.ledger.LedgerDTO;
5import market.guess.model.ledger.LedgerEntryDTO;
6import market.guess.service.helpers.InstantOptions;
4import market.guess.service.ledger.Ledger; 7import market.guess.service.ledger.Ledger;
8import market.guess.service.ledger.LedgerEntry;
5import org.mapstruct.Mapper; 9import org.mapstruct.Mapper;
10import org.mapstruct.Mapping;
6 11
7@Mapper 12@Mapper
8public interface LedgerMapper { 13public interface LedgerMapper {
9 LedgerDTO ledgerToLedgerDTO(Ledger ledger); 14 LedgerDTO ledgerToLedgerDTO(Ledger ledger);
15
16 @Mapping(target = "seq", source = "id")
17 @Mapping(target = "at", source = "time")
18 LedgerEntryDTO ledgerEntryToLedgerEntryDTO(LedgerEntry entry);
19
20 default String instantToDisplay(Instant time) {
21 return time == null ? null : InstantOptions.humanize(time);
22 }
10} 23}
diff --git a/test-data/ex-2/invalid/ex1-commission-above-90.xml b/test-data/ex-2/invalid/ex1-commission-above-90.xml
new file mode 100644
index 0000000..a94845f
--- /dev/null
+++ b/test-data/ex-2/invalid/ex1-commission-above-90.xml
@@ -0,0 +1,49 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<!-- Ex1 check 3: commission must be 0..90. Event 2 charges 91%. -->
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">91</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-market-maker>
42 <event id="1"/>
43 </GM-market-maker>
44 </GM-user>
45 <GM-user name="Menash">
46 <initial-cash>100</initial-cash>
47 </GM-user>
48 </GM-users>
49</Guess-Market>
diff --git a/test-data/ex-2/invalid/ex1-commission-below-0.xml b/test-data/ex-2/invalid/ex1-commission-below-0.xml
new file mode 100644
index 0000000..a2433cb
--- /dev/null
+++ b/test-data/ex-2/invalid/ex1-commission-below-0.xml
@@ -0,0 +1,49 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<!-- Ex1 check 3: commission must be 0..90. Event 1 charges -1%. -->
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">-1</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-market-maker>
42 <event id="1"/>
43 </GM-market-maker>
44 </GM-user>
45 <GM-user name="Menash">
46 <initial-cash>100</initial-cash>
47 </GM-user>
48 </GM-users>
49</Guess-Market>
diff --git a/test-data/ex-2/invalid/ex1-duplicate-event-id.xml b/test-data/ex-2/invalid/ex1-duplicate-event-id.xml
new file mode 100644
index 0000000..5998bb9
--- /dev/null
+++ b/test-data/ex-2/invalid/ex1-duplicate-event-id.xml
@@ -0,0 +1,49 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<!-- Ex1 check 2: every event has a unique id. Both events use id 1. -->
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>1</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-market-maker>
42 <event id="1"/>
43 </GM-market-maker>
44 </GM-user>
45 <GM-user name="Menash">
46 <initial-cash>100</initial-cash>
47 </GM-user>
48 </GM-users>
49</Guess-Market>
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<?xml version="1.0" encoding="UTF-8"?>
2<!-- Ex1 check 1: the file must end with .xml. Content is a valid small.xml; only the extension is wrong. -->
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-market-maker>
42 <event id="1"/>
43 </GM-market-maker>
44 </GM-user>
45 <GM-user name="Menash">
46 <initial-cash>100</initial-cash>
47 </GM-user>
48 </GM-users>
49</Guess-Market>
diff --git a/test-data/ex-2/invalid/ex2-duplicate-user.xml b/test-data/ex-2/invalid/ex2-duplicate-user.xml
new file mode 100644
index 0000000..38e8040
--- /dev/null
+++ b/test-data/ex-2/invalid/ex2-duplicate-user.xml
@@ -0,0 +1,49 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<!-- Ex2 check 1: every user has a unique name. Two users are named Tikva. -->
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-market-maker>
42 <event id="1"/>
43 </GM-market-maker>
44 </GM-user>
45 <GM-user name="Tikva">
46 <initial-cash>100</initial-cash>
47 </GM-user>
48 </GM-users>
49</Guess-Market>
diff --git a/test-data/ex-2/invalid/ex2-event-two-mms.xml b/test-data/ex-2/invalid/ex2-event-two-mms.xml
new file mode 100644
index 0000000..2a698a2
--- /dev/null
+++ b/test-data/ex-2/invalid/ex2-event-two-mms.xml
@@ -0,0 +1,52 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<!-- Ex2 check 4: every event has exactly one MM. Event 1 has two: Tikva and Menash. -->
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-market-maker>
42 <event id="1"/>
43 </GM-market-maker>
44 </GM-user>
45 <GM-user name="Menash">
46 <initial-cash>100</initial-cash>
47 <GM-market-maker>
48 <event id="1"/>
49 </GM-market-maker>
50 </GM-user>
51 </GM-users>
52</Guess-Market>
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>
diff --git a/test-data/ex-2/invalid/ex2-mm-unknown-event.xml b/test-data/ex-2/invalid/ex2-mm-unknown-event.xml
new file mode 100644
index 0000000..c0c9316
--- /dev/null
+++ b/test-data/ex-2/invalid/ex2-mm-unknown-event.xml
@@ -0,0 +1,52 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<!-- Ex2 check 3: a market maker may only reference existing events. Menash is MM of event 7, which does not exist. -->
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-market-maker>
42 <event id="1"/>
43 </GM-market-maker>
44 </GM-user>
45 <GM-user name="Menash">
46 <initial-cash>100</initial-cash>
47 <GM-market-maker>
48 <event id="7"/>
49 </GM-market-maker>
50 </GM-user>
51 </GM-users>
52</Guess-Market>
diff --git a/test-data/ex-2/invalid/ex2-negative-initial-cash.xml b/test-data/ex-2/invalid/ex2-negative-initial-cash.xml
new file mode 100644
index 0000000..04a4894
--- /dev/null
+++ b/test-data/ex-2/invalid/ex2-negative-initial-cash.xml
@@ -0,0 +1,49 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<!-- Ex2 check 2: initial cash must be > 0. Menash starts with -50. -->
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-market-maker>
42 <event id="1"/>
43 </GM-market-maker>
44 </GM-user>
45 <GM-user name="Menash">
46 <initial-cash>-50</initial-cash>
47 </GM-user>
48 </GM-users>
49</Guess-Market>
diff --git a/test-data/ex-2/invalid/ex2-zero-initial-cash.xml b/test-data/ex-2/invalid/ex2-zero-initial-cash.xml
new file mode 100644
index 0000000..b21593e
--- /dev/null
+++ b/test-data/ex-2/invalid/ex2-zero-initial-cash.xml
@@ -0,0 +1,49 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<!-- Ex2 check 2: initial cash must be > 0. Menash starts with 0 (schema-valid, logically invalid). -->
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-market-maker>
42 <event id="1"/>
43 </GM-market-maker>
44 </GM-user>
45 <GM-user name="Menash">
46 <initial-cash>0</initial-cash>
47 </GM-user>
48 </GM-users>
49</Guess-Market>
diff --git a/tools/_util.sh b/tools/_util.sh
index a041f2d..d6e8db5 100644
--- a/tools/_util.sh
+++ b/tools/_util.sh
@@ -10,7 +10,7 @@ MODULES="api service ui-console ui-desktop"
10DEPS_api="" 10DEPS_api=""
11DEPS_service="api" 11DEPS_service="api"
12DEPS_ui_console="api service" 12DEPS_ui_console="api service"
13DEPS_ui_desktop="" 13DEPS_ui_desktop="api service"
14 14
15RUNTIME_LIB_DIRS="pico jaxb gson openjfx" 15RUNTIME_LIB_DIRS="pico jaxb gson openjfx"
16 16
diff --git a/tools/test.sh b/tools/test.sh
index e867871..41602f4 100644
--- a/tools/test.sh
+++ b/tools/test.sh
@@ -49,7 +49,7 @@ mkdir -p build/coverage
49[ -n "$AGENT_ARG" ] && AGENT_ARG="$AGENT_ARG " 49[ -n "$AGENT_ARG" ] && AGENT_ARG="$AGENT_ARG "
50AGENT_ARG="$AGENT_ARG-javaagent:$JACOCO_AGENT=destfile=build/coverage/jacoco.exec" 50AGENT_ARG="$AGENT_ARG-javaagent:$JACOCO_AGENT=destfile=build/coverage/jacoco.exec"
51 51
52java $AGENT_ARG -jar "$JUNIT_JAR" execute \ 52java -Djava.library.path=lib/openjfx $AGENT_ARG -jar "$JUNIT_JAR" execute \
53 --class-path "$TEST_CP" --scan-class-path --details=summary 53 --class-path "$TEST_CP" --scan-class-path --details=summary
54 54
55echo "=== Generating coverage report ===" 55echo "=== Generating coverage report ==="
diff --git a/ui-desktop/.classpath b/ui-desktop/.classpath
index bac8826..200bca6 100644
--- a/ui-desktop/.classpath
+++ b/ui-desktop/.classpath
@@ -11,7 +11,8 @@
11 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> 11 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
12 <!-- Defines where compiled .class files go --> 12 <!-- Defines where compiled .class files go -->
13 <classpathentry kind="output" path="bin"/> 13 <classpathentry kind="output" path="bin"/>
14 14 <classpathentry kind="src" path="/guess-market-api"/>
15 <classpathentry kind="src" path="/guess-market-service"/>
15 <classpathentry kind="lib" path="../lib/junit/junit-platform-console-standalone-6.1.1.jar"/> 16 <classpathentry kind="lib" path="../lib/junit/junit-platform-console-standalone-6.1.1.jar"/>
16 <!-- Required OpenJFX JARs explicitly placed on the Modulepath --> 17 <!-- Required OpenJFX JARs explicitly placed on the Modulepath -->
17 <classpathentry kind="lib" path="../lib/openjfx/javafx.base.jar"/> 18 <classpathentry kind="lib" path="../lib/openjfx/javafx.base.jar"/>