An invention is provided for testing in a Java based environment. The
method includes launching a test harness in a first JVM, and starting a
virtual machine (VM) agent in a second JVM. The VM agent is placed in
communication with the test harness. The VM agent then executes a test
application such that both the test application and the VM agent execute
in the second JVM. In this manner, the VM agent is restarted using the
test harness if the second JVM fails.