aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2010-06-04 20:56:24 +0100
committerJustin Clark-Casey (justincc)2010-06-04 20:56:24 +0100
commitdf2bcf7b6b0f558078cab12e48904b8b61766c58 (patch)
tree84ac1621f753aa8462cc1987a0d3117856f0c7de
parentMerge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff)
downloadopensim-SC-df2bcf7b6b0f558078cab12e48904b8b61766c58.zip
opensim-SC-df2bcf7b6b0f558078cab12e48904b8b61766c58.tar.gz
opensim-SC-df2bcf7b6b0f558078cab12e48904b8b61766c58.tar.bz2
opensim-SC-df2bcf7b6b0f558078cab12e48904b8b61766c58.tar.xz
remove pointless mock user account service since the real one can now be easily configured for test purposes
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs2
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs2
-rw-r--r--OpenSim/Tests/Common/Mock/MockUserAccountService.cs46
-rw-r--r--OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs19
4 files changed, 8 insertions, 61 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
index a3b3e2d..5b91e0d 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
@@ -84,7 +84,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
84 84
85 InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); 85 InventoryArchiverModule archiverModule = new InventoryArchiverModule(true);
86 86
87 Scene scene = SceneSetupHelpers.SetupScene("Inventory, useraccounts"); 87 Scene scene = SceneSetupHelpers.SetupScene("Inventory");
88 SceneSetupHelpers.SetupSceneModules(scene, archiverModule); 88 SceneSetupHelpers.SetupSceneModules(scene, archiverModule);
89 89
90 // Create user 90 // Create user
diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
index 4d04af1..58698ee 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
@@ -69,7 +69,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
69 SerialiserModule serialiserModule = new SerialiserModule(); 69 SerialiserModule serialiserModule = new SerialiserModule();
70 TerrainModule terrainModule = new TerrainModule(); 70 TerrainModule terrainModule = new TerrainModule();
71 71
72 m_scene = SceneSetupHelpers.SetupScene("useraccounts"); 72 m_scene = SceneSetupHelpers.SetupScene();
73 SceneSetupHelpers.SetupSceneModules(m_scene, m_archiverModule, serialiserModule, terrainModule); 73 SceneSetupHelpers.SetupSceneModules(m_scene, m_archiverModule, serialiserModule, terrainModule);
74 } 74 }
75 75
diff --git a/OpenSim/Tests/Common/Mock/MockUserAccountService.cs b/OpenSim/Tests/Common/Mock/MockUserAccountService.cs
deleted file mode 100644
index 0769c7a..0000000
--- a/OpenSim/Tests/Common/Mock/MockUserAccountService.cs
+++ /dev/null
@@ -1,46 +0,0 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System.Collections.Generic;
29using Nini.Config;
30using OpenMetaverse;
31using OpenSim.Services.Interfaces;
32
33namespace OpenSim.Tests.Common.Mock
34{
35 public class MockUserAccountService : IUserAccountService
36 {
37
38 public MockUserAccountService(IConfigSource config) {}
39
40 public UserAccount GetUserAccount(UUID scopeID, UUID userID) { return new UserAccount(); }
41 public UserAccount GetUserAccount(UUID scopeID, string FirstName, string LastName) { return new UserAccount(); }
42 public UserAccount GetUserAccount(UUID scopeID, string Email) { return new UserAccount(); }
43 public List<UserAccount> GetUserAccounts(UUID scopeID, string query) { return new List<UserAccount>(); }
44 public bool StoreUserAccount(UserAccount data) { return true; }
45 }
46} \ No newline at end of file
diff --git a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs
index 27d1a69..4a356e2 100644
--- a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs
+++ b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs
@@ -191,7 +191,7 @@ namespace OpenSim.Tests.Common.Setup
191 if (realServices.Contains("grid")) 191 if (realServices.Contains("grid"))
192 StartGridService(testScene, true); 192 StartGridService(testScene, true);
193 193
194 StartUserAccountService(testScene, realServices.Contains("useraccounts")); 194 StartUserAccountService(testScene);
195 } 195 }
196 // If not, make sure the shared module gets references to this new scene 196 // If not, make sure the shared module gets references to this new scene
197 else 197 else
@@ -311,24 +311,18 @@ namespace OpenSim.Tests.Common.Setup
311 } 311 }
312 312
313 /// <summary> 313 /// <summary>
314 /// Start a user account service, whether real or mock 314 /// Start a user account service
315 /// </summary> 315 /// </summary>
316 /// <param name="testScene"></param> 316 /// <param name="testScene"></param>
317 /// <param name="real">Starts a real service if true, a mock service if not</param> 317 private static void StartUserAccountService(Scene testScene)
318 private static void StartUserAccountService(Scene testScene, bool real)
319 { 318 {
320 IConfigSource config = new IniConfigSource(); 319 IConfigSource config = new IniConfigSource();
321 config.AddConfig("Modules"); 320 config.AddConfig("Modules");
322 config.AddConfig("UserAccountService"); 321 config.AddConfig("UserAccountService");
323 config.Configs["Modules"].Set("UserAccountServices", "LocalUserAccountServicesConnector"); 322 config.Configs["Modules"].Set("UserAccountServices", "LocalUserAccountServicesConnector");
324 config.Configs["UserAccountService"].Set("StorageProvider", "OpenSim.Data.Null.dll"); 323 config.Configs["UserAccountService"].Set("StorageProvider", "OpenSim.Data.Null.dll");
325 324 config.Configs["UserAccountService"].Set(
326 if (real) 325 "LocalServiceModule", "OpenSim.Services.UserAccountService.dll:UserAccountService");
327 config.Configs["UserAccountService"].Set(
328 "LocalServiceModule", "OpenSim.Services.UserAccountService.dll:UserAccountService");
329 else
330 config.Configs["UserAccountService"].Set(
331 "LocalServiceModule", "OpenSim.Tests.Common.dll:MockUserAccountService");
332 326
333 if (m_userAccountService == null) 327 if (m_userAccountService == null)
334 { 328 {
@@ -336,8 +330,7 @@ namespace OpenSim.Tests.Common.Setup
336 userAccountService.Initialise(config); 330 userAccountService.Initialise(config);
337 m_userAccountService = userAccountService; 331 m_userAccountService = userAccountService;
338 } 332 }
339 //else 333
340 // config.Configs["GridService"].Set("LocalServiceModule", "OpenSim.Tests.Common.dll:TestGridService");
341 m_userAccountService.AddRegion(testScene); 334 m_userAccountService.AddRegion(testScene);
342 m_userAccountService.RegionLoaded(testScene); 335 m_userAccountService.RegionLoaded(testScene);
343 testScene.AddRegionModule(m_userAccountService.Name, m_userAccountService); 336 testScene.AddRegionModule(m_userAccountService.Name, m_userAccountService);