From 2f092d271e80dbc7af47671fbb946de75b6110a9 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Thu, 12 Nov 2009 18:44:03 +0000 Subject: [PATCH] Rename test services to mock services, since this is a more accurate description remove duplicate mock inventory service --- .../Communications/Tests/LoginServiceTests.cs | 151 +----------------- .../Scenes/Tests/UuidGathererTests.cs | 2 +- ...estAssetService.cs => MockAssetService.cs} | 6 +- ...toryService.cs => MockInventoryService.cs} | 6 +- .../Tests/Common/Setup/SceneSetupHelpers.cs | 4 +- 5 files changed, 13 insertions(+), 156 deletions(-) rename OpenSim/Tests/Common/Mock/{TestAssetService.cs => MockAssetService.cs} (96%) rename OpenSim/Tests/Common/Mock/{TestInventoryService.cs => MockInventoryService.cs} (97%) diff --git a/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs b/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs index e891d9c11d..60f0ba8ef6 100644 --- a/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs +++ b/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs @@ -75,7 +75,7 @@ namespace OpenSim.Framework.Communications.Tests m_regionConnector.AddRegion(new RegionInfo(42, 43, m_capsEndPoint, m_regionExternalName)); - //IInventoryService m_inventoryService = new TestInventoryService(); + //IInventoryService m_inventoryService = new MockInventoryService(); m_localUserServices = (LocalUserServices) m_commsManager.UserService; m_localUserServices.AddUser(m_firstName,m_lastName,"boingboing","abc@ftw.com",42,43); @@ -95,7 +95,8 @@ namespace OpenSim.Framework.Communications.Tests TestHelper.InMethod(); // We want to use our own LoginService for this test, one that // doesn't require authentication. - new LLStandaloneLoginService((UserManagerBase)m_commsManager.UserService, "Hello folks", new TestInventoryService(), + new LLStandaloneLoginService( + (UserManagerBase)m_commsManager.UserService, "Hello folks", new MockInventoryService(), m_commsManager.NetworkServersInfo, false, new LibraryRootFolder(String.Empty), m_regionConnector); Hashtable loginParams = new Hashtable(); @@ -457,148 +458,4 @@ namespace OpenSim.Framework.Communications.Tests #endregion } } - - class TestInventoryService : IInventoryService - { - public TestInventoryService() - { - } - - /// - /// - /// - /// - /// - public bool CreateUserInventory(UUID userId) - { - return false; - } - - /// - /// - /// - /// - /// - public List GetInventorySkeleton(UUID userId) - { - List folders = new List(); - InventoryFolderBase folder = new InventoryFolderBase(); - folder.ID = UUID.Random(); - folder.Owner = userId; - folders.Add(folder); - return folders; - } - - /// - /// Returns a list of all the active gestures in a user's inventory. - /// - /// - /// The of the user - /// - /// - /// A flat list of the gesture items. - /// - public List GetActiveGestures(UUID userId) - { - return null; - } - - public InventoryCollection GetUserInventory(UUID userID) - { - return null; - } - - public void GetUserInventory(UUID userID, OpenSim.Services.Interfaces.InventoryReceiptCallback callback) - { - } - - public InventoryFolderBase GetFolderForType(UUID userID, AssetType type) - { - return null; - } - - public InventoryCollection GetFolderContent(UUID userID, UUID folderID) - { - return null; - } - - public List GetFolderItems(UUID userID, UUID folderID) - { - return null; - } - - public bool AddFolder(InventoryFolderBase folder) - { - return false; - } - - public bool UpdateFolder(InventoryFolderBase folder) - { - return false; - } - - public bool MoveFolder(InventoryFolderBase folder) - { - return false; - } - - public bool DeleteFolders(UUID ownerID, List ids) - { - return false; - } - - public bool PurgeFolder(InventoryFolderBase folder) - { - return false; - } - - public bool AddItem(InventoryItemBase item) - { - return false; - } - - public bool UpdateItem(InventoryItemBase item) - { - return false; - } - - public bool MoveItems(UUID owner, List items) - { - return false; - } - - public bool DeleteItems(UUID owner, List items) - { - return false; - } - - public InventoryItemBase GetItem(InventoryItemBase item) - { - return null; - } - - public InventoryFolderBase GetFolder(InventoryFolderBase folder) - { - return null; - } - - public bool HasInventoryForUser(UUID userID) - { - return false; - } - - public InventoryFolderBase GetRootFolder(UUID userID) - { - InventoryFolderBase root = new InventoryFolderBase(); - root.ID = UUID.Random(); - root.Owner = userID; - root.ParentID = UUID.Zero; - return root; - } - - public int GetAssetPermissions(UUID userID, UUID assetID) - { - return 1; - } - } -} +} \ No newline at end of file diff --git a/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs b/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs index 52891f4286..dc98550dc2 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs @@ -47,7 +47,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests [SetUp] public void Init() { - m_assetService = new TestAssetService(); + m_assetService = new MockAssetService(); m_uuidGatherer = new UuidGatherer(m_assetService); } diff --git a/OpenSim/Tests/Common/Mock/TestAssetService.cs b/OpenSim/Tests/Common/Mock/MockAssetService.cs similarity index 96% rename from OpenSim/Tests/Common/Mock/TestAssetService.cs rename to OpenSim/Tests/Common/Mock/MockAssetService.cs index a537b976eb..cb380431d4 100644 --- a/OpenSim/Tests/Common/Mock/TestAssetService.cs +++ b/OpenSim/Tests/Common/Mock/MockAssetService.cs @@ -37,20 +37,20 @@ using Nini.Config; namespace OpenSim.Tests.Common.Mock { - public class TestAssetService : IAssetService + public class MockAssetService : IAssetService { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private readonly Dictionary Assets = new Dictionary(); - public TestAssetService() {} + public MockAssetService() {} /// /// This constructor is required if the asset service is being created reflectively (which is the case in some /// tests). /// /// - public TestAssetService(IConfigSource config) {} + public MockAssetService(IConfigSource config) {} public AssetBase Get(string id) { diff --git a/OpenSim/Tests/Common/Mock/TestInventoryService.cs b/OpenSim/Tests/Common/Mock/MockInventoryService.cs similarity index 97% rename from OpenSim/Tests/Common/Mock/TestInventoryService.cs rename to OpenSim/Tests/Common/Mock/MockInventoryService.cs index 5a0ee7ca65..1ea4bc1059 100644 --- a/OpenSim/Tests/Common/Mock/TestInventoryService.cs +++ b/OpenSim/Tests/Common/Mock/MockInventoryService.cs @@ -35,13 +35,13 @@ using Nini.Config; namespace OpenSim.Tests.Common.Mock { - public class TestInventoryService : IInventoryService + public class MockInventoryService : IInventoryService { - public TestInventoryService() + public MockInventoryService() { } - public TestInventoryService(IConfigSource config) + public MockInventoryService(IConfigSource config) { } diff --git a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs index eab5422015..8b18d07fb8 100644 --- a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs +++ b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs @@ -219,7 +219,7 @@ namespace OpenSim.Tests.Common.Setup if (real) config.Configs["AssetService"].Set("LocalServiceModule", "OpenSim.Services.AssetService.dll:AssetService"); else - config.Configs["AssetService"].Set("LocalServiceModule", "OpenSim.Tests.Common.dll:TestAssetService"); + config.Configs["AssetService"].Set("LocalServiceModule", "OpenSim.Tests.Common.dll:MockAssetService"); config.Configs["AssetService"].Set("StorageProvider", "OpenSim.Tests.Common.dll"); assetService.Initialise(config); assetService.AddRegion(testScene); @@ -238,7 +238,7 @@ namespace OpenSim.Tests.Common.Setup if (real) config.Configs["InventoryService"].Set("LocalServiceModule", "OpenSim.Services.InventoryService.dll:InventoryService"); else - config.Configs["InventoryService"].Set("LocalServiceModule", "OpenSim.Tests.Common.dll:TestInventoryService"); + config.Configs["InventoryService"].Set("LocalServiceModule", "OpenSim.Tests.Common.dll:MockInventoryService"); config.Configs["InventoryService"].Set("StorageProvider", "OpenSim.Tests.Common.dll"); inventoryService.Initialise(config); inventoryService.AddRegion(testScene);