appmap-java is a Java agent for recording
AppMaps of your code. "AppMap" is a data
format which records code structure (modules, classes, and methods), code
execution events (function calls and returns), and code metadata (repo name,
repo URL, commit SHA, labels, etc). It's more granular than a performance
profile, but it's less granular than a full debug trace. It's designed to be
optimal for understanding the design intent and structure of code and key data
flows.
Visit the AppMap for Java reference page on AppLand.com for a complete reference guide.
The Spring PetClinic
provides a convenient way to develop on appmap-java.
Obtain the spring-petclinic JAR file, and launch it with the AppLand Java
agent:
export PETCLINIC_DIR=<path-to-petclinic>
java -Dappmap.debug \
-javaagent:build/libs/appmap.jar \
-Dappmap.config.file=test/appmap.yml \
-jar $(PETCLINIC_DIR)/target/spring-petclinic-2.2.0.BUILD-SNAPSHOT.jarYou can use Java remote debug settings to attach a debugger:
export PETCLINIC_DIR=<path-to-petclinic>
java -Dappmap.debug \
-javaagent:build/libs/appmap.jar \
-Dappmap.config.file=test/appmap.yml \
-Xdebug \
-Xrunjdwp:server=y,transport=dt_socket,address=5005,suspend=y \
-jar $PETCLINIC_DIR/target/spring-petclinic-2.2.0.BUILD-SNAPSHOT.jarArtifacts will be written to build/libs. Use appmap.jar as your agent.
./gradlew buildUnit tests are run with ./gradlew test.
The integration tests use bats and Docker.
Run the following command:
./bin/testTo get an interactive shell to write/debug the tests, try:
./bin/test /bin/bashOnce in the shell, run:
DEBUG_JSON=true bats --tap /test/*.batsOr:
DEBUG_JSON=true bats --tap /test/*.bats -f 'http'