public void registerInProcessTestSystemFactory(String name, TestSystemFactory testSystemFactory) {
inProcessTestSystemFactories.put(name, testSystemFactory);
}
public TestSystem create(Descriptor descriptor) throws IOException {
TestSystemFactory factory = null;
if (descriptor.runInProcess()) {
factory = inProcessTestSystemFactories.get(descriptor.getTestSystemType().toLowerCase());
}
if (factory == null) {
factory = testSystemFactories.get(descriptor.getTestSystemType().toLowerCase());
}
if (factory == null) {
throw new RuntimeException(String.format("Unknown test system: '%s'", descriptor.getTestSystemType()));
}
return factory.create(descriptor);
}