From 1f7466e5c3136d0580a21b5f2f4d8f18fa9fc72f Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 5 Aug 2009 20:04:27 +0100 Subject: test item data storage impementation (unused as of yet) --- .../Tests/Common/Mock/TestInventoryDataPlugin.cs | 45 +++++++++++++++------- 1 file changed, 31 insertions(+), 14 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs index 442ff06..1b14abb 100644 --- a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs @@ -39,12 +39,17 @@ namespace OpenSim.Tests.Common.Mock /// tests are single threaded. /// public class TestInventoryDataPlugin : IInventoryDataPlugin - { + { /// - /// Known inventory folders + /// Inventory folders /// private Dictionary m_folders = new Dictionary(); + //// + /// Inventory items + /// + private Dictionary m_items = new Dictionary(); + /// /// User root folders /// @@ -99,9 +104,7 @@ namespace OpenSim.Tests.Common.Mock } return folders; - } - - public InventoryItemBase getInventoryItem(UUID item) { return null; } + } public InventoryFolderBase getInventoryFolder(UUID folderId) { @@ -111,15 +114,6 @@ namespace OpenSim.Tests.Common.Mock return folder; } - public void addInventoryItem(InventoryItemBase item) {} - public void updateInventoryItem(InventoryItemBase item) {} - public void deleteInventoryItem(UUID item) {} - - public InventoryItemBase queryInventoryItem(UUID item) - { - return null; - } - public InventoryFolderBase queryInventoryFolder(UUID folderID) { return getInventoryFolder(folderID); @@ -150,6 +144,29 @@ namespace OpenSim.Tests.Common.Mock m_folders.Remove(folderId); } + public void addInventoryItem(InventoryItemBase item) { m_items[item.ID] = item; } + + public void updateInventoryItem(InventoryItemBase item) { addInventoryItem(item); } + + public void deleteInventoryItem(UUID itemId) + { + if (m_items.ContainsKey(itemId)) + m_items.Remove(itemId); + } + + public InventoryItemBase getInventoryItem(UUID itemId) + { + if (m_items.ContainsKey(itemId)) + return m_items[itemId]; + else + return null; + } + + public InventoryItemBase queryInventoryItem(UUID item) + { + return null; + } + public List fetchActiveGestures(UUID avatarID) { return null; } } } -- cgit v1.1