}
}
}
private TestSystem startTestSystem(final WikiPageIdentity identity, final List<TestPage> testPages) throws IOException {
Descriptor descriptor = new Descriptor() {
private ClassPath classPath;
@Override
public String getTestSystem() {
String testSystemName = getVariable(WikiPageIdentity.TEST_SYSTEM);
if (testSystemName == null)
return "fit";
return testSystemName;
}
@Override
public String getTestSystemType() {
return getTestSystem().split(":")[0];
}
@Override
public ClassPath getClassPath() {
if (classPath == null) {
ArrayList<ClassPath> paths = new ArrayList<ClassPath>();
for (TestPage testPage: testPages) {
paths.add(testPage.getClassPath());
}
classPath = new ClassPath(paths);
}
return classPath;
}
@Override
public boolean runInProcess() {
return runInProcess;
}
@Override
public boolean isDebug() {
return enableRemoteDebug;
}
@Override
public String getVariable(String name) {
return identity.getVariable(name);
}
@Override
public ExecutionLogListener getExecutionLogListener() {
return executionLogListener;
}
};
InternalTestSystemListener internalTestSystemListener = new InternalTestSystemListener();
try {
testSystem = testSystemFactory.create(descriptor);
testSystem.addTestSystemListener(internalTestSystemListener);
testSystem.start();
} catch (Exception e) {
formatters.unableToStartTestSystem(descriptor.getTestSystem(), e);
return null;
}
return testSystem;
}