aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2010-03-12 19:31:14 +0000
committerJustin Clark-Casey (justincc)2010-03-12 19:31:14 +0000
commitf2de50bb14bd8215ea98c79c79aabe1e6b4f2780 (patch)
treea234ef918308290b8d9db829f392ce646b7f2c06 /OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs
parentMerge branch 'master' of ssh://justincc@opensimulator.org/var/git/opensim (diff)
downloadopensim-SC_OLD-f2de50bb14bd8215ea98c79c79aabe1e6b4f2780.zip
opensim-SC_OLD-f2de50bb14bd8215ea98c79c79aabe1e6b4f2780.tar.gz
opensim-SC_OLD-f2de50bb14bd8215ea98c79c79aabe1e6b4f2780.tar.bz2
opensim-SC_OLD-f2de50bb14bd8215ea98c79c79aabe1e6b4f2780.tar.xz
Fix tests broken in 88771aeed3d45e60a18aa9a810eeb37b8e5def12
Adds MockUserAccountService and connects it up Stops services being carried over between tests since this leads to hard to find bugs Improves information and error reporting when loading plugins
Diffstat (limited to 'OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs')
-rw-r--r--OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs34
1 files changed, 27 insertions, 7 deletions
diff --git a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs
index 9e718f6..ab3e7cb 100644
--- a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs
+++ b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs
@@ -128,7 +128,7 @@ namespace OpenSim.Tests.Common.Setup
128 /// <param name="realServices">Starts real inventory and asset services, as opposed to mock ones, if true</param> 128 /// <param name="realServices">Starts real inventory and asset services, as opposed to mock ones, if true</param>
129 /// <returns></returns> 129 /// <returns></returns>
130 public static TestScene SetupScene( 130 public static TestScene SetupScene(
131 string name, UUID id, uint x, uint y, String realServices) 131 string name, UUID id, uint x, uint y, String realServices)
132 { 132 {
133 bool newScene = false; 133 bool newScene = false;
134 134
@@ -179,15 +179,16 @@ namespace OpenSim.Tests.Common.Setup
179 StartAssetService(testScene, true); 179 StartAssetService(testScene, true);
180 else 180 else
181 StartAssetService(testScene, false); 181 StartAssetService(testScene, false);
182
182 if (realServices.Contains("inventory")) 183 if (realServices.Contains("inventory"))
183 StartInventoryService(testScene, true); 184 StartInventoryService(testScene, true);
184 else 185 else
185 StartInventoryService(testScene, false); 186 StartInventoryService(testScene, false);
187
186 if (realServices.Contains("grid")) 188 if (realServices.Contains("grid"))
187 StartGridService(testScene, true); 189 StartGridService(testScene, true);
188 if (realServices.Contains("useraccounts")) 190
189 StartUserAccountService(testScene, true); 191 StartUserAccountService(testScene, realServices.Contains("useraccounts"));
190
191 } 192 }
192 // If not, make sure the shared module gets references to this new scene 193 // If not, make sure the shared module gets references to this new scene
193 else 194 else
@@ -196,9 +197,13 @@ namespace OpenSim.Tests.Common.Setup
196 m_assetService.RegionLoaded(testScene); 197 m_assetService.RegionLoaded(testScene);
197 m_inventoryService.AddRegion(testScene); 198 m_inventoryService.AddRegion(testScene);
198 m_inventoryService.RegionLoaded(testScene); 199 m_inventoryService.RegionLoaded(testScene);
200 m_userAccountService.AddRegion(testScene);
201 m_userAccountService.RegionLoaded(testScene);
199 } 202 }
203
200 m_inventoryService.PostInitialise(); 204 m_inventoryService.PostInitialise();
201 m_assetService.PostInitialise(); 205 m_assetService.PostInitialise();
206 m_userAccountService.PostInitialise();
202 207
203 testScene.SetModuleInterfaces(); 208 testScene.SetModuleInterfaces();
204 209
@@ -209,6 +214,11 @@ namespace OpenSim.Tests.Common.Setup
209 physicsPluginManager.LoadPluginsFromAssembly("Physics/OpenSim.Region.Physics.BasicPhysicsPlugin.dll"); 214 physicsPluginManager.LoadPluginsFromAssembly("Physics/OpenSim.Region.Physics.BasicPhysicsPlugin.dll");
210 testScene.PhysicsScene 215 testScene.PhysicsScene
211 = physicsPluginManager.GetPhysicsScene("basicphysics", "ZeroMesher", new IniConfigSource(), "test"); 216 = physicsPluginManager.GetPhysicsScene("basicphysics", "ZeroMesher", new IniConfigSource(), "test");
217
218 m_assetService = null;
219 m_inventoryService = null;
220 m_gridService = null;
221 m_userAccountService = null;
212 222
213 return testScene; 223 return testScene;
214 } 224 }
@@ -273,6 +283,11 @@ namespace OpenSim.Tests.Common.Setup
273 //testScene.AddRegionModule(m_gridService.Name, m_gridService); 283 //testScene.AddRegionModule(m_gridService.Name, m_gridService);
274 } 284 }
275 285
286 /// <summary>
287 /// Start a user account service, whether real or mock
288 /// </summary>
289 /// <param name="testScene"></param>
290 /// <param name="real">Starts a real service if true, a mock service if not</param>
276 private static void StartUserAccountService(Scene testScene, bool real) 291 private static void StartUserAccountService(Scene testScene, bool real)
277 { 292 {
278 IConfigSource config = new IniConfigSource(); 293 IConfigSource config = new IniConfigSource();
@@ -280,8 +295,14 @@ namespace OpenSim.Tests.Common.Setup
280 config.AddConfig("UserAccountService"); 295 config.AddConfig("UserAccountService");
281 config.Configs["Modules"].Set("UserAccountServices", "LocalUserAccountServicesConnector"); 296 config.Configs["Modules"].Set("UserAccountServices", "LocalUserAccountServicesConnector");
282 config.Configs["UserAccountService"].Set("StorageProvider", "OpenSim.Data.Null.dll"); 297 config.Configs["UserAccountService"].Set("StorageProvider", "OpenSim.Data.Null.dll");
298
283 if (real) 299 if (real)
284 config.Configs["UserAccountService"].Set("LocalServiceModule", "OpenSim.Services.UserAccountService.dll:UserAccountService"); 300 config.Configs["UserAccountService"].Set(
301 "LocalServiceModule", "OpenSim.Services.UserAccountService.dll:UserAccountService");
302 else
303 config.Configs["UserAccountService"].Set(
304 "LocalServiceModule", "OpenSim.Tests.Common.dll:MockUserAccountService");
305
285 if (m_userAccountService == null) 306 if (m_userAccountService == null)
286 { 307 {
287 ISharedRegionModule userAccountService = new LocalUserAccountServicesConnector(); 308 ISharedRegionModule userAccountService = new LocalUserAccountServicesConnector();
@@ -292,10 +313,9 @@ namespace OpenSim.Tests.Common.Setup
292 // config.Configs["GridService"].Set("LocalServiceModule", "OpenSim.Tests.Common.dll:TestGridService"); 313 // config.Configs["GridService"].Set("LocalServiceModule", "OpenSim.Tests.Common.dll:TestGridService");
293 m_userAccountService.AddRegion(testScene); 314 m_userAccountService.AddRegion(testScene);
294 m_userAccountService.RegionLoaded(testScene); 315 m_userAccountService.RegionLoaded(testScene);
295 //testScene.AddRegionModule(m_gridService.Name, m_gridService); 316 testScene.AddRegionModule(m_userAccountService.Name, m_userAccountService);
296 } 317 }
297 318
298
299 /// <summary> 319 /// <summary>
300 /// Setup modules for a scene using their default settings. 320 /// Setup modules for a scene using their default settings.
301 /// </summary> 321 /// </summary>