public void spawnProcess() throws Exception {
if (TestConfiguration.isDefaultBasePort()) {
String[] cmd = {
"junit.textui.TestRunner", spawnedTestClass.getName()
};
SpawnedProcess proc = new SpawnedProcess
(execJavaCmd(cmd), spawnedTestClass.getName());
if (proc.complete() != 0) {
fail(proc.getFailMessage("Test process failed"));
}
}
else
{
// if we're not using the default port of 1527, ensure we're
// passing on the baseport value to the spawned process.
String[] cmd = {
"-Dderby.tests.basePort=" + TestConfiguration.getBasePort(),
"junit.textui.TestRunner", spawnedTestClass.getName()
};
SpawnedProcess proc = new SpawnedProcess
(execJavaCmd(cmd), spawnedTestClass.getName());
if (proc.complete() != 0) {
fail(proc.getFailMessage("Test process failed"));
}
}
}