aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clarke Casey2009-01-23 17:55:29 +0000
committerJustin Clarke Casey2009-01-23 17:55:29 +0000
commitf8aea3724da138107fc4121254e5eeea5f178aa0 (patch)
treedf1514e281ed270ac5f0872eb341b10dfde910f1
parent* refactor: move scene setup code into common test code assembly (diff)
downloadopensim-SC_OLD-f8aea3724da138107fc4121254e5eeea5f178aa0.zip
opensim-SC_OLD-f8aea3724da138107fc4121254e5eeea5f178aa0.tar.gz
opensim-SC_OLD-f8aea3724da138107fc4121254e5eeea5f178aa0.tar.bz2
opensim-SC_OLD-f8aea3724da138107fc4121254e5eeea5f178aa0.tar.xz
refactor: move test modules set up code to common function
-rw-r--r--OpenSim/Region/Environment/Scenes/Tests/StandaloneTeleportTests.cs12
-rw-r--r--OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs17
2 files changed, 20 insertions, 9 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Tests/StandaloneTeleportTests.cs b/OpenSim/Region/Environment/Scenes/Tests/StandaloneTeleportTests.cs
index f1ad508..0c7de74 100644
--- a/OpenSim/Region/Environment/Scenes/Tests/StandaloneTeleportTests.cs
+++ b/OpenSim/Region/Environment/Scenes/Tests/StandaloneTeleportTests.cs
@@ -61,18 +61,12 @@ namespace OpenSim.Region.Environment.Scenes.Tests
61 // shared module 61 // shared module
62 IRegionModule interregionComms = new RESTInterregionComms(); 62 IRegionModule interregionComms = new RESTInterregionComms();
63 63
64 // TODO: Clean this up 64 Scene sceneA = SceneSetupHelpers.SetupScene("sceneA", sceneAId, 1000, 1000, cm);
65 Scene sceneA = SceneSetupHelpers.SetupScene("sceneA", sceneAId, 1000, 1000, cm); 65 SceneSetupHelpers.SetupSceneModules(sceneA, new IniConfigSource(), interregionComms);
66 interregionComms.Initialise(sceneA, new IniConfigSource());
67 sceneA.AddModule(interregionComms.Name, interregionComms);
68 sceneA.SetModuleInterfaces();
69 sceneA.RegisterRegionWithGrid(); 66 sceneA.RegisterRegionWithGrid();
70 67
71 // TODO: Clean this up
72 Scene sceneB = SceneSetupHelpers.SetupScene("sceneB", sceneBId, 1010, 1010, cm); 68 Scene sceneB = SceneSetupHelpers.SetupScene("sceneB", sceneBId, 1010, 1010, cm);
73 interregionComms.Initialise(sceneB, new IniConfigSource()); 69 SceneSetupHelpers.SetupSceneModules(sceneB, new IniConfigSource(), interregionComms);
74 sceneB.AddModule(interregionComms.Name, interregionComms);
75 sceneB.SetModuleInterfaces();
76 sceneB.RegisterRegionWithGrid(); 70 sceneB.RegisterRegionWithGrid();
77 71
78 UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000041"); 72 UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000041");
diff --git a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs
index 11ebc86..74f177a 100644
--- a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs
+++ b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs
@@ -99,6 +99,23 @@ namespace OpenSim.Tests.Common.Setup
99 } 99 }
100 100
101 /// <summary> 101 /// <summary>
102 /// Setup the given modules for a given scene.
103 /// </summary>
104 /// <param name="scene"></param>
105 /// <param name="config"></param>
106 /// <param name="modules"></param>
107 public static void SetupSceneModules(Scene scene, IConfigSource config, params IRegionModule[] modules)
108 {
109 foreach (IRegionModule module in modules)
110 {
111 module.Initialise(scene, config);
112 scene.AddModule(module.Name, module);
113 }
114
115 scene.SetModuleInterfaces();
116 }
117
118 /// <summary>
102 /// Generate some standard agent connection data. 119 /// Generate some standard agent connection data.
103 /// </summary> 120 /// </summary>
104 /// <param name="agentId"></param> 121 /// <param name="agentId"></param>