Generalizing the reflection shim for the runTest method to allow subclassing.