Kirk Rader  1.0-SNAPSHOT
Integration Tests

Console application for demo / integration tests

Overview

This do-nothing console application exists only as an integration test / demonstration of functionality provided by various other example modules. In particular, this application is built using Status Codes Maven Plugin and demonstrates logging defined using Status Codes when invoked using run-without-tracing.sh or invoked directly using java -jar ....

In addition, it demonstrates detailed execution tracing injected at load time when invoked using run-with-tracing.sh. This relies on functionality supplied by the module described by Tracing With AspectJ and configuration supplied at load time by META-INF/aop.xml, which is generated by Status Codes Maven Plugin

Note that both run-with-tracing.sh and run-without-tracing.sh specify the use of the following java.util.logging properties at run time:

java.util.logging.ConsoleHandler.level = ALL
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
.handlers = java.util.logging.ConsoleHandler
us.rader.level = ALL

In fact, the only difference between the two wrapper scripts is that run-with-tracing.sh specifies the use of the ApectJ load-time weaving agent:

#!/bin/bash
java -javaagent:/usr/share/java/aspectjweaver.jar \
-Djava.util.logging.config.file=logging.properties \
-jar target/logging-demo-1.0-SNAPSHOT.jar

while run-without-tracing.sh does not:

#!/bin/bash
java -Djava.util.logging.config.file=logging.properties \
-jar target/logging-demo-1.0-SNAPSHOT.jar

This demonstrates how AspectJ can be used to inject code at load time via external configuration options without recompiling, repackaging or redeploying the target application.