diff options
Diffstat (limited to 'OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs')
-rw-r--r-- | OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs index 0d8baad..eab5422 100644 --- a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs +++ b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs | |||
@@ -44,6 +44,7 @@ using OpenSim.Region.CoreModules.Agent.Capabilities; | |||
44 | using OpenSim.Region.CoreModules.Avatar.Gods; | 44 | using OpenSim.Region.CoreModules.Avatar.Gods; |
45 | using OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset; | 45 | using OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset; |
46 | using OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory; | 46 | using OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory; |
47 | using OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid; | ||
47 | using OpenSim.Services.Interfaces; | 48 | using OpenSim.Services.Interfaces; |
48 | using OpenSim.Tests.Common.Mock; | 49 | using OpenSim.Tests.Common.Mock; |
49 | 50 | ||
@@ -58,6 +59,7 @@ namespace OpenSim.Tests.Common.Setup | |||
58 | // CommunicationsManager. | 59 | // CommunicationsManager. |
59 | private static ISharedRegionModule m_assetService = null; | 60 | private static ISharedRegionModule m_assetService = null; |
60 | private static ISharedRegionModule m_inventoryService = null; | 61 | private static ISharedRegionModule m_inventoryService = null; |
62 | private static ISharedRegionModule m_gridService = null; | ||
61 | private static TestCommunicationsManager commsManager = null; | 63 | private static TestCommunicationsManager commsManager = null; |
62 | 64 | ||
63 | /// <summary> | 65 | /// <summary> |
@@ -110,6 +112,7 @@ namespace OpenSim.Tests.Common.Setup | |||
110 | return SetupScene(name, id, x, y, cm, ""); | 112 | return SetupScene(name, id, x, y, cm, ""); |
111 | } | 113 | } |
112 | 114 | ||
115 | |||
113 | /// <summary> | 116 | /// <summary> |
114 | /// Set up a scene. If it's more then one scene, use the same CommunicationsManager to link regions | 117 | /// 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. | 118 | /// or a different, to get a brand new scene with new shared region modules. |
@@ -124,7 +127,7 @@ namespace OpenSim.Tests.Common.Setup | |||
124 | public static TestScene SetupScene( | 127 | public static TestScene SetupScene( |
125 | string name, UUID id, uint x, uint y, TestCommunicationsManager cm, String realServices) | 128 | string name, UUID id, uint x, uint y, TestCommunicationsManager cm, String realServices) |
126 | { | 129 | { |
127 | bool newScene= false; | 130 | bool newScene = false; |
128 | 131 | ||
129 | Console.WriteLine("Setting up test scene {0}", name); | 132 | Console.WriteLine("Setting up test scene {0}", name); |
130 | 133 | ||
@@ -176,6 +179,9 @@ namespace OpenSim.Tests.Common.Setup | |||
176 | StartInventoryService(testScene, true); | 179 | StartInventoryService(testScene, true); |
177 | else | 180 | else |
178 | StartInventoryService(testScene, false); | 181 | StartInventoryService(testScene, false); |
182 | if (realServices.Contains("grid")) | ||
183 | StartGridService(testScene, true); | ||
184 | |||
179 | } | 185 | } |
180 | // If not, make sure the shared module gets references to this new scene | 186 | // If not, make sure the shared module gets references to this new scene |
181 | else | 187 | else |
@@ -192,7 +198,7 @@ namespace OpenSim.Tests.Common.Setup | |||
192 | 198 | ||
193 | testScene.SetModuleInterfaces(); | 199 | testScene.SetModuleInterfaces(); |
194 | 200 | ||
195 | testScene.LandChannel = new TestLandChannel(); | 201 | testScene.LandChannel = new TestLandChannel(testScene); |
196 | testScene.LoadWorldMap(); | 202 | testScene.LoadWorldMap(); |
197 | 203 | ||
198 | PhysicsPluginManager physicsPluginManager = new PhysicsPluginManager(); | 204 | PhysicsPluginManager physicsPluginManager = new PhysicsPluginManager(); |
@@ -241,6 +247,29 @@ namespace OpenSim.Tests.Common.Setup | |||
241 | m_inventoryService = inventoryService; | 247 | m_inventoryService = inventoryService; |
242 | } | 248 | } |
243 | 249 | ||
250 | private static void StartGridService(Scene testScene, bool real) | ||
251 | { | ||
252 | IConfigSource config = new IniConfigSource(); | ||
253 | config.AddConfig("Modules"); | ||
254 | config.AddConfig("GridService"); | ||
255 | config.Configs["Modules"].Set("GridServices", "LocalGridServicesConnector"); | ||
256 | config.Configs["GridService"].Set("StorageProvider", "OpenSim.Data.Null.dll:NullRegionData"); | ||
257 | if (real) | ||
258 | config.Configs["GridService"].Set("LocalServiceModule", "OpenSim.Services.GridService.dll:GridService"); | ||
259 | if (m_gridService == null) | ||
260 | { | ||
261 | ISharedRegionModule gridService = new LocalGridServicesConnector(); | ||
262 | gridService.Initialise(config); | ||
263 | m_gridService = gridService; | ||
264 | } | ||
265 | //else | ||
266 | // config.Configs["GridService"].Set("LocalServiceModule", "OpenSim.Tests.Common.dll:TestGridService"); | ||
267 | m_gridService.AddRegion(testScene); | ||
268 | m_gridService.RegionLoaded(testScene); | ||
269 | //testScene.AddRegionModule(m_gridService.Name, m_gridService); | ||
270 | } | ||
271 | |||
272 | |||
244 | /// <summary> | 273 | /// <summary> |
245 | /// Setup modules for a scene using their default settings. | 274 | /// Setup modules for a scene using their default settings. |
246 | /// </summary> | 275 | /// </summary> |