I think ultimately we are going to want have a fixture that launches a jvm to run another fixture that lives in the same class. So, perhaps the best way to start would be by making a command line test runner that will run a single fixture in embedded mode. It might be run something like:
java org.apache.derbyTesting.functionTests.util.SingleFixtureRunner <test class> <fixture name>
java org.apache.derbyTesting.functionTests.util.SingleFixtureRunner org.apache.derbyTesting.functionTests.tests.lang.SimpleTest testBugFixes
I think this would be a useful tool in and of itself and is something we can use for the recover test. At least for the initial version it will be just straight embedded with no decorators.
The code would have to use reflection to kick off the fixture and on error could just print the error info and stack trace to System.err. It might look something like this (totally untested and printFailInfo left as exercise).
String testClassName = args;
String fixtureName = args;
Class testClass = Class.forName(testClassName);
Constructor classConstr = testClass.getDeclaredConstructor(new Class
Test testToRun = (Test) classConstr.newInstance(new Object
TestResult result = new TestResult();
if (result.failureCount() > 0)
if (result.errorCount() > 0)
If you get that done, then next we can add an assertLaunchJunitFixture() method to BaseTestCase which prints the error output to System.err if the launch fails. Then we should have all the parts we need for the basic recovery test.