aboutsummaryrefslogtreecommitdiffstats
path: root/service/src/test/java
Commit message (Collapse)AuthorAgeFilesLines
* tests: cover the ex-2 loader, order book trading and desktop stateHEAD2.0masterKostya10 days4-11/+800
| | | | | | | | | | | | | | | | | | | | | | | | | Add tests for the behaviour introduced in the last few commits, so later changes to matching, settlement or the UI state can't quietly break it. On the service side, Ex2LoaderTest loads the ex-2 fixtures and checks that every invalid file is rejected for its own reason, including events with no market maker or two of them, and v1 files. The order book tests cover buys and sells that match or rest in the ladder, self-trade prevention, cash and shares reserved by resting orders, price bounds, risk rejections, and resolution cancelling resting orders and paying the holders. A simulation checks that LMSR settlement conserves money. LedgerMapperTest used to pin the unmapped seq and at fields to their defaults. Now that the mapper fills them from the entry id and time, assert the real values and add a case for a null time. On the desktop side, AppStateTest drives the real ServiceEngine through loading, event creation, LMSR and order book trading, and checks that the observable state updates. Smaller tests check chart timestamps, money and probability formatting, and that every animation settles on its final frame, which is what the UI shows when animations are off.
* model: relocate market DTOs out of the flat api packageKostya2026-08-231-13/+23
| | | | | | | | | | | | | | | | | | Move AccountDTO/MarketDTO/MarketStateDTO/PurchaseReceiptDTO/TradeRowDTO out of the catch-all api package into model.market (and LedgerDTO into model.ledger), matching the existing model.event convention so DTOs live next to the domain they describe rather than in the interface package. Relocate LedgerMapper from mapper.v2 to infrastructure.adapter to match the module's established package layout, and update all call sites and imports accordingly. Also register the ui-desktop module in the build tooling: add it to MODULES, add openjfx to the shipped runtime libs, and generalize package.sh so each executable module (ui-console, ui-desktop) gets its own Main-Class/Class-Path manifest and run script instead of special-casing ui-console. Fold long Class-Path manifest lines at 72 bytes per the JAR spec, since adding ui-desktop's dependencies pushed the line past the limit.
* Add MapStruct LedgerMapper and wire annotation processing into build.shKostya2026-08-201-0/+103
| | | | | build.sh now passes -processorpath/-s so MapStruct's generated impl compiles alongside hand-written sources.
* Move CommissionTiming and MechanismType into model.event packageKostya2026-08-201-3/+1
| | | | | Groups them with the other event-domain enums instead of the general api package, and updates all call sites accordingly.
* Break down purchase receipts by cost/commission, harden XML validation and ↵Kostya2026-08-181-0/+343
| | | | | | | | | state I/O Adds a full pre-load validation pass for GM XML seeds (ids, names, options, commission, LMSR liquidity), replaces IO.print with System.out, and surfaces detailed error messages across load/save commands instead of generic failures.
* Split DTOs into api/model, extract order matching into service/matchingKostya2026-08-162-88/+0
| | | | | | | Moves Event/Ledger DTOs out of the flat api package into api/model/{event,ledger}, and moves LocalCatalogContext and order matching logic into dedicated service/catalog and service/matching packages, replacing TradingOperation/TradingOperationImpl.
* Implement LMSR and order-book trading logic, wire MarketContext facade and ↵Kostya2026-08-152-0/+88
| | | | | | | | | | | new menu commands Fill in the previously stubbed cost/pricing math for both trading mechanisms, and give OrderBookTradingMechanism an actual matching engine with resting bid/ask books. Fold EventRepository/UserRepository access into a single MarketContext used by LocalGuessMarketContext, and move the repository package under infrastructure. Add Buy/EventDetails/LoadState/ SaveState/SettleEvent console commands and wire them into App/Menu.
* Wire EventRepository into LocalGuessMarketContext, add mapper/provider infra ↵Kostya2026-08-141-0/+12
and tests Removes the placeholder Mapper interface in favor of concrete mapper/provider implementations, fixes Menu.stop() to no-op instead of throwing.