Stage 2 console classes and the shared LoanPolicy, then a Spring Boot 4.1.2 + JPA API (H2, @Version optimistic locking, problem+json errors). Tests write output/ transcripts while asserting the same numbers; scripts regenerate everything. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b4DPL6dtpFg4U4LHc2
31 lines
1.0 KiB
Bash
Executable File
31 lines
1.0 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Regenerates every file in output/. Needs JDK 25 and Maven; the first run must be online.
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")/.."
|
|
rm -f output/*.txt
|
|
|
|
# 01: the single-file console version (the copy attached to the article lives in the WordPress media library)
|
|
mkdir -p /tmp/lm && cp scripts/demo-input.txt /tmp/lm/
|
|
echo "01 console (structured) ..."
|
|
mvn -B -q -DskipTests compile
|
|
java -cp target/classes com.ankurm.library.console.ConsoleApp < scripts/demo-input.txt 2>/dev/null > output/01-console-structured.txt
|
|
|
|
# 02-06: written by the tests themselves, so each file is also an assertion
|
|
echo "02-06 tests ..."
|
|
mvn -B -q test
|
|
|
|
# 07: the real server, driven with curl
|
|
echo "07 curl demo ..."
|
|
scripts/run.sh --detach
|
|
scripts/api-demo.sh > output/07-curl-demo.txt
|
|
scripts/stop.sh
|
|
|
|
# 08: the Boot default we override
|
|
echo "08 open-in-view warning ..."
|
|
scripts/open-in-view-warning.sh > output/08-open-in-view-warning.txt
|
|
|
|
# 09: the SQL one borrow produces
|
|
echo "09 borrow SQL ..."
|
|
scripts/sql-trace.sh > output/09-borrow-sql.txt
|
|
ls output
|