LilyRuntimeSettings settings = new LilyRuntimeSettings();
settings.setModel(model);
settings.setRepository(dummyRepository);
settings.setConfManager(new ConfManagerImpl());
LilyRuntime runtime = new LilyRuntime(settings);
runtime.start();
runtime.stop();
// Test we can start the runtime a second time
runtime = new LilyRuntime(settings);
runtime.start();
runtime.stop();
// Same with connectors configured
runtime = new LilyRuntime(settings);
runtime.start();
runtime.stop();
// Test that we can't start the same runtime twice
try {
runtime.start();
Assert.fail("Starting the same runtime instance twice should fail.");
} catch (Exception e) {}
// Test that we can't start if we don't set a repository in the config
settings.setRepository(null);
runtime = new LilyRuntime(settings);
try {
runtime.start();
Assert.fail("Starting runtime should fail if there is no artifact repository configured.");
} catch (Exception e) {}
}