Indeed a lot of things have changed in the FitNesse code. A
lot of fields have been made final, so it’s easier to reason about the code.
To create a context configuration we can use the
fitnesse.ContextConfigurator class. It can be used to build a FitNesseContext
to your liking, while the FitNesseContext fields remain final.
public void start() throws Exception {
try {
try {
if (fitnesse == null) {
FitNesseContext context = loadContext();
fitnesse = new FitNesse(context);
}
} catch (Exception e) {
throw e;
}
if (fitnesse != null) {
fitnesse.start();
}
} catch (RuntimeException e1) {
throw e1;
}
}
public void stop() throws Exception {
if (fitnesse != null) {
fitnesse.stop();
fitnesse = null;
}
}
protected FitNesseContext loadContext() throws Exception {
ContextConfigurator configurator = ContextConfigurator.empty();
configurator.withParameter(ConfigurationParameter.ROOT_PATH,C:\\FitNesseRootPath);
configurator.withParameter(ConfigurationParameter.PORT,8080);
configurator.withParameter(ConfigurationParameter.CONTEXT_ROOT, "/");
FitNesseContext context = configurator.makeFitNesseContext();
return context;
}
No comments:
Post a Comment