aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs21
1 files changed, 19 insertions, 2 deletions
diff --git a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs
index fbe0e46..b1b32cc 100644
--- a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs
+++ b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs
@@ -54,6 +54,8 @@ namespace OpenSim.Tests.Common.Setup
54 /// </summary> 54 /// </summary>
55 public class SceneSetupHelpers 55 public class SceneSetupHelpers
56 { 56 {
57 // These static variables in order to allow regions to be linked by shared modules and same
58 // CommunicationsManager.
57 private static ISharedRegionModule m_assetService = null; 59 private static ISharedRegionModule m_assetService = null;
58 private static ISharedRegionModule m_inventoryService = null; 60 private static ISharedRegionModule m_inventoryService = null;
59 private static TestCommunicationsManager commsManager = null; 61 private static TestCommunicationsManager commsManager = null;
@@ -74,7 +76,7 @@ namespace OpenSim.Tests.Common.Setup
74 /// Set up a test scene 76 /// Set up a test scene
75 /// </summary> 77 /// </summary>
76 /// 78 ///
77 /// <param name="startServices">Start associated service threads for the scene</param> 79 /// <param name="realServices">Starts real inventory and asset services, as opposed to mock ones, if true</param>
78 /// <returns></returns> 80 /// <returns></returns>
79 public static TestScene SetupScene(String realServices) 81 public static TestScene SetupScene(String realServices)
80 { 82 {
@@ -82,6 +84,13 @@ namespace OpenSim.Tests.Common.Setup
82 "Unit test region", UUID.Random(), 1000, 1000, new TestCommunicationsManager(), realServices); 84 "Unit test region", UUID.Random(), 1000, 1000, new TestCommunicationsManager(), realServices);
83 } 85 }
84 86
87 /// <summary>
88 /// Set up a test scene
89 /// </summary>
90 ///
91 /// <param name="realServices">Starts real inventory and asset services, as opposed to mock ones, if true</param>
92 /// <param name="cm">This should be the same if simulating two scenes within a standalone</param>
93 /// <returns></returns>
85 public static TestScene SetupScene(TestCommunicationsManager cm, String realServices) 94 public static TestScene SetupScene(TestCommunicationsManager cm, String realServices)
86 { 95 {
87 return SetupScene( 96 return SetupScene(
@@ -102,7 +111,8 @@ namespace OpenSim.Tests.Common.Setup
102 } 111 }
103 112
104 /// <summary> 113 /// <summary>
105 /// Set up a scene. 114 /// Set up a scene. If it's more then one scene, use the same CommunicationsManager to link regions
115 /// or a different, to get a brand new scene with new shared region modules.
106 /// </summary> 116 /// </summary>
107 /// <param name="name">Name of the region</param> 117 /// <param name="name">Name of the region</param>
108 /// <param name="id">ID of the region</param> 118 /// <param name="id">ID of the region</param>
@@ -117,6 +127,10 @@ namespace OpenSim.Tests.Common.Setup
117 bool newScene= false; 127 bool newScene= false;
118 128
119 Console.WriteLine("Setting up test scene {0}", name); 129 Console.WriteLine("Setting up test scene {0}", name);
130
131 // If cm is the same as our last commsManager used, this means the tester wants to link
132 // regions. In this case, don't use the sameshared region modules and dont initialize them again.
133 // Also, no need to start another MainServer and MainConsole instance.
120 if (cm == null || cm != commsManager) 134 if (cm == null || cm != commsManager)
121 { 135 {
122 System.Console.WriteLine("Starting a brand new scene"); 136 System.Console.WriteLine("Starting a brand new scene");
@@ -150,6 +164,8 @@ namespace OpenSim.Tests.Common.Setup
150 testScene.AddModule(godsModule.Name, godsModule); 164 testScene.AddModule(godsModule.Name, godsModule);
151 realServices = realServices.ToLower(); 165 realServices = realServices.ToLower();
152 IniConfigSource config = new IniConfigSource(); 166 IniConfigSource config = new IniConfigSource();
167
168 // If we have a brand new scene, need to initialize shared region modules
153 if ((m_assetService == null && m_inventoryService == null) || newScene) 169 if ((m_assetService == null && m_inventoryService == null) || newScene)
154 { 170 {
155 if (realServices.Contains("asset")) 171 if (realServices.Contains("asset"))
@@ -161,6 +177,7 @@ namespace OpenSim.Tests.Common.Setup
161 else 177 else
162 StartInventoryService(testScene, false); 178 StartInventoryService(testScene, false);
163 } 179 }
180 // If not, make sure the shared module gets references to this new scene
164 else 181 else
165 { 182 {
166 m_assetService.AddRegion(testScene); 183 m_assetService.AddRegion(testScene);