aboutsummaryrefslogtreecommitdiffstats
path: root/ui-desktop
Commit message (Collapse)AuthorAgeFilesLines
* tests: cover the ex-2 loader, order book trading and desktop stateHEAD2.0masterKostya10 days4-0/+630
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* ui-desktop: build the JavaFX market UI on top of the serviceKostya11 days65-13/+6426
| | | | | | | | | | | | | | | | | | | | Replace the placeholder hello-world window with a working desktop client for the guess market. ServiceEngine wires the in-memory repositories, XML loader, risk, matching, fulfillment and settlement contexts together, and AppState exposes their results as observable JavaFX state for the views to bind to. The FXML views have an events tab and a users tab. The events tab lists events with mechanism and commission filters, and shows each event's price chart, order book ladder, trade history and participants. The users tab shows each user's ledger and positions, and lets them place buy and sell orders. Dialogs cover loading an XML file (in a background task), creating an event and resolving one. Bundle a CSS theme and Nerd Font faces so the UI looks the same on every machine. Teach build.sh to copy each module's src/main/resources into its class output, since FXML, CSS and fonts are loaded from the classpath at runtime.
* ex-2: add invalid-input fixtures and wire ui-desktop to the serviceKostya2026-09-061-1/+2
| | | | | | | | | | | | | | | | | | | | | 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.
* flatten modules to repo root, vendor deps, repair Eclipse build pathsKostya2026-08-095-0/+93
Move api, engine, ui-console and ui-desktop out of modules/ up to the repo root and drop the empty exception project (GuessMarketException now lives in api). Vendor gson, jaxb, okhttp, openjfx and tomcat under lib/, and group the JUnit standalone jar into lib/junit/ alongside them. Rewrite every .classpath: drop the copy-pasted optional="true" that was masking real build path errors, point the library entries at ../lib/, and put the JUnit jar on the test source folders so the placeholder AppTest classes compile. ui-desktop: take the JavaFX jars off the modulepath (there is no module-info.java, so module="true" left the packages unresolvable) and add a Launcher that calls Application.launch, avoiding the "JavaFX runtime components are missing" check without VM arguments. engine: add LocalGuessMarketService and the GuessMarketContext provider interface, and give GuessMarketException the no-arg and cause constructors they need.