From 289c21099cf3ce0a2e3392436541b67d0961d8e8 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 24 Aug 2010 16:50:31 +0100 Subject: Add automated test at the opensim 'api' level to check that a given item goes to the correct directory Also removes some mono compiler warnings --- .../Tests/Common/Mock/TestInventoryDataPlugin.cs | 31 ++++++++++++++++++---- 1 file changed, 26 insertions(+), 5 deletions(-) (limited to 'OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs') diff --git a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs index 7c4f689..ed0b1a6 100644 --- a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs @@ -42,7 +42,7 @@ namespace OpenSim.Tests.Common.Mock /// public class TestInventoryDataPlugin : IInventoryDataPlugin { -// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); /// /// Inventory folders @@ -84,14 +84,19 @@ namespace OpenSim.Tests.Common.Mock public List getInventoryInFolder(UUID folderID) { -// m_log.DebugFormat("[MOCK INV DB]: Getting items in folder {0}", folderID); + InventoryFolderBase folder = m_folders[folderID]; + + m_log.DebugFormat("[MOCK INV DB]: Getting items in folder {0} {1}", folder.Name, folder.ID); List items = new List(); foreach (InventoryItemBase item in m_items.Values) { if (item.Folder == folderID) + { + m_log.DebugFormat("[MOCK INV DB]: getInventoryInFolder() adding item {0}", item.Name); items.Add(item); + } } return items; @@ -101,7 +106,7 @@ namespace OpenSim.Tests.Common.Mock public InventoryFolderBase getUserRootFolder(UUID user) { -// m_log.DebugFormat("[MOCK INV DB]: Looking for root folder for {0}", user); + m_log.DebugFormat("[MOCK INV DB]: Looking for root folder for {0}", user); InventoryFolderBase folder = null; m_rootFolders.TryGetValue(user, out folder); @@ -111,12 +116,22 @@ namespace OpenSim.Tests.Common.Mock public List getInventoryFolders(UUID parentID) { + InventoryFolderBase parentFolder = m_folders[parentID]; + + m_log.DebugFormat("[MOCK INV DB]: Getting folders in folder {0} {1}", parentFolder.Name, parentFolder.ID); + List folders = new List(); foreach (InventoryFolderBase folder in m_folders.Values) { if (folder.ParentID == parentID) + { + m_log.DebugFormat( + "[MOCK INV DB]: Found folder {0} {1} in {2} {3}", + folder.Name, folder.ID, parentFolder.Name, parentFolder.ID); + folders.Add(folder); + } } return folders; @@ -137,6 +152,10 @@ namespace OpenSim.Tests.Common.Mock public void addInventoryFolder(InventoryFolderBase folder) { + m_log.DebugFormat( + "[MOCK INV DB]: Adding inventory folder {0} {1} type {2}", + folder.Name, folder.ID, (AssetType)folder.Type); + m_folders[folder.ID] = folder; if (folder.ParentID == UUID.Zero) @@ -166,8 +185,10 @@ namespace OpenSim.Tests.Common.Mock public void addInventoryItem(InventoryItemBase item) { -// m_log.DebugFormat( -// "[MOCK INV DB]: Adding inventory item {0} {1} in {2}", item.Name, item.ID, item.Folder); + InventoryFolderBase folder = m_folders[item.Folder]; + + m_log.DebugFormat( + "[MOCK INV DB]: Adding inventory item {0} {1} in {2} {3}", item.Name, item.ID, folder.Name, folder.ID); m_items[item.ID] = item; } -- cgit v1.1 From 86937d0a0f5572b002cdb6efc499c234b2a9bd1b Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 27 Aug 2010 23:22:49 +0100 Subject: allow inventory path specified in "load iar" to start with a / (e.g. /Objects is now valid where it wasn't before) --- .../Tests/Common/Mock/TestInventoryDataPlugin.cs | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs') diff --git a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs index ed0b1a6..b70b47d 100644 --- a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs @@ -86,7 +86,7 @@ namespace OpenSim.Tests.Common.Mock { InventoryFolderBase folder = m_folders[folderID]; - m_log.DebugFormat("[MOCK INV DB]: Getting items in folder {0} {1}", folder.Name, folder.ID); +// m_log.DebugFormat("[MOCK INV DB]: Getting items in folder {0} {1}", folder.Name, folder.ID); List items = new List(); @@ -94,7 +94,7 @@ namespace OpenSim.Tests.Common.Mock { if (item.Folder == folderID) { - m_log.DebugFormat("[MOCK INV DB]: getInventoryInFolder() adding item {0}", item.Name); +// m_log.DebugFormat("[MOCK INV DB]: getInventoryInFolder() adding item {0}", item.Name); items.Add(item); } } @@ -106,7 +106,7 @@ namespace OpenSim.Tests.Common.Mock public InventoryFolderBase getUserRootFolder(UUID user) { - m_log.DebugFormat("[MOCK INV DB]: Looking for root folder for {0}", user); +// m_log.DebugFormat("[MOCK INV DB]: Looking for root folder for {0}", user); InventoryFolderBase folder = null; m_rootFolders.TryGetValue(user, out folder); @@ -118,7 +118,7 @@ namespace OpenSim.Tests.Common.Mock { InventoryFolderBase parentFolder = m_folders[parentID]; - m_log.DebugFormat("[MOCK INV DB]: Getting folders in folder {0} {1}", parentFolder.Name, parentFolder.ID); +// m_log.DebugFormat("[MOCK INV DB]: Getting folders in folder {0} {1}", parentFolder.Name, parentFolder.ID); List folders = new List(); @@ -126,9 +126,9 @@ namespace OpenSim.Tests.Common.Mock { if (folder.ParentID == parentID) { - m_log.DebugFormat( - "[MOCK INV DB]: Found folder {0} {1} in {2} {3}", - folder.Name, folder.ID, parentFolder.Name, parentFolder.ID); +// m_log.DebugFormat( +// "[MOCK INV DB]: Found folder {0} {1} in {2} {3}", +// folder.Name, folder.ID, parentFolder.Name, parentFolder.ID); folders.Add(folder); } @@ -152,9 +152,9 @@ namespace OpenSim.Tests.Common.Mock public void addInventoryFolder(InventoryFolderBase folder) { - m_log.DebugFormat( - "[MOCK INV DB]: Adding inventory folder {0} {1} type {2}", - folder.Name, folder.ID, (AssetType)folder.Type); +// m_log.DebugFormat( +// "[MOCK INV DB]: Adding inventory folder {0} {1} type {2}", +// folder.Name, folder.ID, (AssetType)folder.Type); m_folders[folder.ID] = folder; @@ -187,8 +187,8 @@ namespace OpenSim.Tests.Common.Mock { InventoryFolderBase folder = m_folders[item.Folder]; - m_log.DebugFormat( - "[MOCK INV DB]: Adding inventory item {0} {1} in {2} {3}", item.Name, item.ID, folder.Name, folder.ID); +// m_log.DebugFormat( +// "[MOCK INV DB]: Adding inventory item {0} {1} in {2} {3}", item.Name, item.ID, folder.Name, folder.ID); m_items[item.ID] = item; } -- cgit v1.1