aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-06-04 00:51:49 +0100
committerJustin Clark-Casey (justincc)2011-06-04 00:51:49 +0100
commit896f039513398a46458b18ef49f52a9a3ac43659 (patch)
treefeabf11001d4ec6499718ca6bad9183e6eb347e0 /OpenSim/Region
parentextend TestGiveInventoryFolder() to check for the receipt by user 2 (diff)
downloadopensim-SC_OLD-896f039513398a46458b18ef49f52a9a3ac43659.zip
opensim-SC_OLD-896f039513398a46458b18ef49f52a9a3ac43659.tar.gz
opensim-SC_OLD-896f039513398a46458b18ef49f52a9a3ac43659.tar.bz2
opensim-SC_OLD-896f039513398a46458b18ef49f52a9a3ac43659.tar.xz
create TestGetInventoryItem()
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs20
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs19
2 files changed, 26 insertions, 13 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs
index 47e34dc..dc665c1 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs
@@ -181,25 +181,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
181 181
182 /// <summary> 182 /// <summary>
183 /// Find an item given a PATH_DELIMITOR delimited path starting from this folder. 183 /// Find an item given a PATH_DELIMITOR delimited path starting from this folder.
184 /// 184 /// </summary>
185 /// This method does not handle paths that contain multiple delimitors 185 /// <remarks>
186 /// This method does not handle paths that contain multiple delimiters
186 /// 187 ///
187 /// FIXME: We do not yet handle situations where folders or items have the same name. We could handle this by some 188 /// FIXME: We do not yet handle situations where folders or items have the same name. We could handle this by some
188 /// XPath like expression 189 /// XPath like expression
189 /// 190 ///
190 /// FIXME: Delimitors which occur in names themselves are not currently escapable. 191 /// FIXME: Delimitors which occur in names themselves are not currently escapable.
191 /// </summary> 192 /// </remarks>
192 /// 193 ///
193 /// <param name="inventoryService"> 194 /// <param name="inventoryService">Inventory service to query</param>
194 /// Inventory service to query 195 /// <param name="startFolder">The folder from which the path starts</param>
195 /// </param> 196 /// <param name="path">The path to the required item.</param>
196 /// <param name="startFolder">
197 /// The folder from which the path starts
198 /// </param>
199 /// <param name="path">
200 /// <param name="path">
201 /// The path to the required item.
202 /// </param>
203 /// <returns>null if the item is not found</returns> 197 /// <returns>null if the item is not found</returns>
204 public static InventoryItemBase FindItemByPath( 198 public static InventoryItemBase FindItemByPath(
205 IInventoryService inventoryService, InventoryFolderBase startFolder, string path) 199 IInventoryService inventoryService, InventoryFolderBase startFolder, string path)
diff --git a/OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs
index c6bd296..bacf7c1 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs
@@ -53,6 +53,25 @@ namespace OpenSim.Region.Framework.Tests
53 public class UserInventoryTests 53 public class UserInventoryTests
54 { 54 {
55 [Test] 55 [Test]
56 public void TestGiveInventoryItem()
57 {
58 TestHelper.InMethod();
59// log4net.Config.XmlConfigurator.Configure();
60
61 Scene scene = SceneSetupHelpers.SetupScene();
62 UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene);
63 UserAccount user2 = UserAccountHelpers.CreateUserWithInventory(scene);
64 InventoryItemBase item1 = UserInventoryHelpers.CreateInventoryItem(scene, "item1", user1.PrincipalID);
65
66 scene.GiveInventoryItem(user2.PrincipalID, user1.PrincipalID, item1.ID);
67
68 InventoryItemBase retrievedItem1
69 = UserInventoryHelpers.GetInventoryItem(scene.InventoryService, user2.PrincipalID, "Objects/item1");
70
71 Assert.That(retrievedItem1, Is.Not.Null);
72 }
73
74 [Test]
56 public void TestGiveInventoryFolder() 75 public void TestGiveInventoryFolder()
57 { 76 {
58 TestHelper.InMethod(); 77 TestHelper.InMethod();