aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-03-09 01:37:31 +0000
committerJustin Clark-Casey (justincc)2011-03-09 01:37:31 +0000
commit2fa8fc505223cbd2b6e327fe946748c717dda3b5 (patch)
treee2b79246d3fecd05afecead42823053c321f2c03
parentSimplify SceneSetupHelpers class by removing all code which was originally pr... (diff)
downloadopensim-SC_OLD-2fa8fc505223cbd2b6e327fe946748c717dda3b5.zip
opensim-SC_OLD-2fa8fc505223cbd2b6e327fe946748c717dda3b5.tar.gz
opensim-SC_OLD-2fa8fc505223cbd2b6e327fe946748c717dda3b5.tar.bz2
opensim-SC_OLD-2fa8fc505223cbd2b6e327fe946748c717dda3b5.tar.xz
remove inventory service preserving code from SceneSetupHelpers too
-rw-r--r--OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs47
1 files changed, 10 insertions, 37 deletions
diff --git a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs
index 2aeafc8..aa4b285 100644
--- a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs
+++ b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs
@@ -57,10 +57,6 @@ namespace OpenSim.Tests.Common.Setup
57 /// </summary> 57 /// </summary>
58 public class SceneSetupHelpers 58 public class SceneSetupHelpers
59 { 59 {
60 // These static variables in order to allow regions to be linked by shared modules and same
61 // CommunicationsManager.
62 private static ISharedRegionModule m_inventoryService = null;
63
64 /// <summary> 60 /// <summary>
65 /// Set up a test scene 61 /// Set up a test scene
66 /// </summary> 62 /// </summary>
@@ -81,24 +77,9 @@ namespace OpenSim.Tests.Common.Setup
81 /// <returns></returns> 77 /// <returns></returns>
82 public static TestScene SetupScene(String realServices) 78 public static TestScene SetupScene(String realServices)
83 { 79 {
84 return SetupScene( 80 return SetupScene("Unit test region", UUID.Random(), 1000, 1000, realServices);
85 "Unit test region", UUID.Random(), 1000, 1000, realServices);
86 } 81 }
87 82
88 // REFACTORING PROBLEM. No idea what the difference is with the previous one
89 ///// <summary>
90 ///// Set up a test scene
91 ///// </summary>
92 /////
93 ///// <param name="realServices">Starts real inventory and asset services, as opposed to mock ones, if true</param>
94 ///// <param name="cm">This should be the same if simulating two scenes within a standalone</param>
95 ///// <returns></returns>
96 //public static TestScene SetupScene(String realServices)
97 //{
98 // return SetupScene(
99 // "Unit test region", UUID.Random(), 1000, 1000, "");
100 //}
101
102 /// <summary> 83 /// <summary>
103 /// Set up a test scene 84 /// Set up a test scene
104 /// </summary> 85 /// </summary>
@@ -110,7 +91,7 @@ namespace OpenSim.Tests.Common.Setup
110 /// <returns></returns> 91 /// <returns></returns>
111 public static TestScene SetupScene(string name, UUID id, uint x, uint y) 92 public static TestScene SetupScene(string name, UUID id, uint x, uint y)
112 { 93 {
113 return SetupScene(name, id, x, y,""); 94 return SetupScene(name, id, x, y, "");
114 } 95 }
115 96
116 /// <summary> 97 /// <summary>
@@ -156,16 +137,12 @@ namespace OpenSim.Tests.Common.Setup
156 // For now, always started a 'real' authentication service 137 // For now, always started a 'real' authentication service
157 StartAuthenticationService(testScene, true); 138 StartAuthenticationService(testScene, true);
158 139
159 if (realServices.Contains("inventory")) 140 LocalInventoryServicesConnector inventoryService = StartInventoryService(testScene, realServices.Contains("inventory"));
160 StartInventoryService(testScene, true);
161 else
162 StartInventoryService(testScene, false);
163
164 StartGridService(testScene, true); 141 StartGridService(testScene, true);
165 LocalUserAccountServicesConnector userAccountService = StartUserAccountService(testScene); 142 LocalUserAccountServicesConnector userAccountService = StartUserAccountService(testScene);
166 LocalPresenceServicesConnector presenceService = StartPresenceService(testScene); 143 LocalPresenceServicesConnector presenceService = StartPresenceService(testScene);
167 144
168 m_inventoryService.PostInitialise(); 145 inventoryService.PostInitialise();
169 assetService.PostInitialise(); 146 assetService.PostInitialise();
170 userAccountService.PostInitialise(); 147 userAccountService.PostInitialise();
171 presenceService.PostInitialise(); 148 presenceService.PostInitialise();
@@ -181,11 +158,6 @@ namespace OpenSim.Tests.Common.Setup
181 testScene.PhysicsScene 158 testScene.PhysicsScene
182 = physicsPluginManager.GetPhysicsScene("basicphysics", "ZeroMesher", new IniConfigSource(), "test"); 159 = physicsPluginManager.GetPhysicsScene("basicphysics", "ZeroMesher", new IniConfigSource(), "test");
183 160
184 // It's really not a good idea to use static variables as they carry over between tests, leading to
185 // problems that are extremely hard to debug. Really, these static fields need to be eliminated -
186 // tests using multiple regions that need to share modules need to find another solution.
187 m_inventoryService = null;
188
189 testScene.RegionInfo.EstateSettings = new EstateSettings(); 161 testScene.RegionInfo.EstateSettings = new EstateSettings();
190 testScene.LoginsDisabled = false; 162 testScene.LoginsDisabled = false;
191 163
@@ -233,9 +205,9 @@ namespace OpenSim.Tests.Common.Setup
233 //m_authenticationService = service; 205 //m_authenticationService = service;
234 } 206 }
235 207
236 private static void StartInventoryService(Scene testScene, bool real) 208 private static LocalInventoryServicesConnector StartInventoryService(Scene testScene, bool real)
237 { 209 {
238 ISharedRegionModule inventoryService = new LocalInventoryServicesConnector(); 210 LocalInventoryServicesConnector inventoryService = new LocalInventoryServicesConnector();
239 IConfigSource config = new IniConfigSource(); 211 IConfigSource config = new IniConfigSource();
240 config.AddConfig("Modules"); 212 config.AddConfig("Modules");
241 config.AddConfig("InventoryService"); 213 config.AddConfig("InventoryService");
@@ -255,7 +227,8 @@ namespace OpenSim.Tests.Common.Setup
255 inventoryService.AddRegion(testScene); 227 inventoryService.AddRegion(testScene);
256 inventoryService.RegionLoaded(testScene); 228 inventoryService.RegionLoaded(testScene);
257 testScene.AddRegionModule(inventoryService.Name, inventoryService); 229 testScene.AddRegionModule(inventoryService.Name, inventoryService);
258 m_inventoryService = inventoryService; 230
231 return inventoryService;
259 } 232 }
260 233
261 private static LocalGridServicesConnector StartGridService(Scene testScene, bool real) 234 private static LocalGridServicesConnector StartGridService(Scene testScene, bool real)
@@ -423,7 +396,7 @@ namespace OpenSim.Tests.Common.Setup
423 /// <summary> 396 /// <summary>
424 /// Add a root agent. 397 /// Add a root agent.
425 /// </summary> 398 /// </summary>
426 /// 399 /// <remarks>
427 /// This function 400 /// This function
428 /// 401 ///
429 /// 1) Tells the scene that an agent is coming. Normally, the login service (local if standalone, from the 402 /// 1) Tells the scene that an agent is coming. Normally, the login service (local if standalone, from the
@@ -434,7 +407,7 @@ namespace OpenSim.Tests.Common.Setup
434 /// 407 ///
435 /// This function performs actions equivalent with notifying the scene that an agent is 408 /// This function performs actions equivalent with notifying the scene that an agent is
436 /// coming and then actually connecting the agent to the scene. The one step missed out is the very first 409 /// coming and then actually connecting the agent to the scene. The one step missed out is the very first
437 /// 410 /// </remarks>
438 /// <param name="scene"></param> 411 /// <param name="scene"></param>
439 /// <param name="agentData"></param> 412 /// <param name="agentData"></param>
440 /// <returns></returns> 413 /// <returns></returns>