refactor: move test modules set up code to common function

0.6.3-post-fixes
Justin Clarke Casey 2009-01-23 17:55:29 +00:00
parent ee3c61247e
commit f8aea3724d
2 changed files with 20 additions and 9 deletions

View File

@ -61,18 +61,12 @@ namespace OpenSim.Region.Environment.Scenes.Tests
// shared module
IRegionModule interregionComms = new RESTInterregionComms();
// TODO: Clean this up
Scene sceneA = SceneSetupHelpers.SetupScene("sceneA", sceneAId, 1000, 1000, cm);
interregionComms.Initialise(sceneA, new IniConfigSource());
sceneA.AddModule(interregionComms.Name, interregionComms);
sceneA.SetModuleInterfaces();
SceneSetupHelpers.SetupSceneModules(sceneA, new IniConfigSource(), interregionComms);
sceneA.RegisterRegionWithGrid();
// TODO: Clean this up
Scene sceneB = SceneSetupHelpers.SetupScene("sceneB", sceneBId, 1010, 1010, cm);
interregionComms.Initialise(sceneB, new IniConfigSource());
sceneB.AddModule(interregionComms.Name, interregionComms);
sceneB.SetModuleInterfaces();
SceneSetupHelpers.SetupSceneModules(sceneB, new IniConfigSource(), interregionComms);
sceneB.RegisterRegionWithGrid();
UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000041");

View File

@ -98,6 +98,23 @@ namespace OpenSim.Tests.Common.Setup
return testScene;
}
/// <summary>
/// Setup the given modules for a given scene.
/// </summary>
/// <param name="scene"></param>
/// <param name="config"></param>
/// <param name="modules"></param>
public static void SetupSceneModules(Scene scene, IConfigSource config, params IRegionModule[] modules)
{
foreach (IRegionModule module in modules)
{
module.Initialise(scene, config);
scene.AddModule(module.Name, module);
}
scene.SetModuleInterfaces();
}
/// <summary>
/// Generate some standard agent connection data.
/// </summary>