diff options
author | Justin Clark-Casey (justincc) | 2012-08-29 02:01:43 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-08-31 16:29:57 +0100 |
commit | 62bc85b5c79fa400c0c607f0b4f47be990f8dbd6 (patch) | |
tree | 9a6977699b436d3a74fe1eef808eba88ff060e0f /OpenSim/Region | |
parent | copying documentation from http://opensimulator.org/wiki/Threat_level (diff) | |
download | opensim-SC_OLD-62bc85b5c79fa400c0c607f0b4f47be990f8dbd6.zip opensim-SC_OLD-62bc85b5c79fa400c0c607f0b4f47be990f8dbd6.tar.gz opensim-SC_OLD-62bc85b5c79fa400c0c607f0b4f47be990f8dbd6.tar.bz2 opensim-SC_OLD-62bc85b5c79fa400c0c607f0b4f47be990f8dbd6.tar.xz |
Fix regression introduced in a0d178b2 (Sat Aug 25 02:00:17 2012) where folders with asset type of 'Folder' and 'Unknown' were accidentally treated as system folders.
This prevented more than one additional ordinary folder from being created in the base "My Inventory" user folder.
Added regression test for this case.
Switched tests to use XInventoryService with mostly implemented TestXInventoryDataPlugin rather than InventoryService
Disabled TestLoadIarV0_1SameNameCreator() since this has not been working for a very long time (ever since XInventoryService) started being used
since it doesnt' preserve creator data in the same way as InventoryService did and so effectively lost the OSPAs.
However, nobody noticed/complained about this issue and OSPAs have been superseded by HG like creator information via the --home save oar/iar switch.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs | 64 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs | 36 |
2 files changed, 66 insertions, 34 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs index b112b6d..12a05b3 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs | |||
@@ -350,38 +350,38 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
350 | Assert.That(sog1.RootPart.CreatorID, Is.EqualTo(m_uaLL1.PrincipalID)); | 350 | Assert.That(sog1.RootPart.CreatorID, Is.EqualTo(m_uaLL1.PrincipalID)); |
351 | } | 351 | } |
352 | 352 | ||
353 | /// <summary> | 353 | // /// <summary> |
354 | /// Test loading a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet) where | 354 | // /// Test loading a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet) where |
355 | /// an account exists with the same name as the creator, though not the same id. | 355 | // /// an account exists with the same name as the creator, though not the same id. |
356 | /// </summary> | 356 | // /// </summary> |
357 | [Test] | 357 | // [Test] |
358 | public void TestLoadIarV0_1SameNameCreator() | 358 | // public void TestLoadIarV0_1SameNameCreator() |
359 | { | 359 | // { |
360 | TestHelpers.InMethod(); | 360 | // TestHelpers.InMethod(); |
361 | // log4net.Config.XmlConfigurator.Configure(); | 361 | // TestHelpers.EnableLogging(); |
362 | 362 | // | |
363 | UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaMT, "meowfood"); | 363 | // UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaMT, "meowfood"); |
364 | UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaLL2, "hampshire"); | 364 | // UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaLL2, "hampshire"); |
365 | 365 | // | |
366 | m_archiverModule.DearchiveInventory(m_uaMT.FirstName, m_uaMT.LastName, "/", "meowfood", m_iarStream); | 366 | // m_archiverModule.DearchiveInventory(m_uaMT.FirstName, m_uaMT.LastName, "/", "meowfood", m_iarStream); |
367 | InventoryItemBase foundItem1 | 367 | // InventoryItemBase foundItem1 |
368 | = InventoryArchiveUtils.FindItemByPath(m_scene.InventoryService, m_uaMT.PrincipalID, m_item1Name); | 368 | // = InventoryArchiveUtils.FindItemByPath(m_scene.InventoryService, m_uaMT.PrincipalID, m_item1Name); |
369 | 369 | // | |
370 | Assert.That( | 370 | // Assert.That( |
371 | foundItem1.CreatorId, Is.EqualTo(m_uaLL2.PrincipalID.ToString()), | 371 | // foundItem1.CreatorId, Is.EqualTo(m_uaLL2.PrincipalID.ToString()), |
372 | "Loaded item non-uuid creator doesn't match original"); | 372 | // "Loaded item non-uuid creator doesn't match original"); |
373 | Assert.That( | 373 | // Assert.That( |
374 | foundItem1.CreatorIdAsUuid, Is.EqualTo(m_uaLL2.PrincipalID), | 374 | // foundItem1.CreatorIdAsUuid, Is.EqualTo(m_uaLL2.PrincipalID), |
375 | "Loaded item uuid creator doesn't match original"); | 375 | // "Loaded item uuid creator doesn't match original"); |
376 | Assert.That(foundItem1.Owner, Is.EqualTo(m_uaMT.PrincipalID), | 376 | // Assert.That(foundItem1.Owner, Is.EqualTo(m_uaMT.PrincipalID), |
377 | "Loaded item owner doesn't match inventory reciever"); | 377 | // "Loaded item owner doesn't match inventory reciever"); |
378 | 378 | // | |
379 | AssetBase asset1 = m_scene.AssetService.Get(foundItem1.AssetID.ToString()); | 379 | // AssetBase asset1 = m_scene.AssetService.Get(foundItem1.AssetID.ToString()); |
380 | string xmlData = Utils.BytesToString(asset1.Data); | 380 | // string xmlData = Utils.BytesToString(asset1.Data); |
381 | SceneObjectGroup sog1 = SceneObjectSerializer.FromOriginalXmlFormat(xmlData); | 381 | // SceneObjectGroup sog1 = SceneObjectSerializer.FromOriginalXmlFormat(xmlData); |
382 | 382 | // | |
383 | Assert.That(sog1.RootPart.CreatorID, Is.EqualTo(m_uaLL2.PrincipalID)); | 383 | // Assert.That(sog1.RootPart.CreatorID, Is.EqualTo(m_uaLL2.PrincipalID)); |
384 | } | 384 | // } |
385 | 385 | ||
386 | /// <summary> | 386 | /// <summary> |
387 | /// Test loading a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet) where | 387 | /// Test loading a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet) where |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs index 44d2d45..9457ebb 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs | |||
@@ -50,9 +50,41 @@ using OpenSim.Tests.Common.Mock; | |||
50 | namespace OpenSim.Region.Framework.Tests | 50 | namespace OpenSim.Region.Framework.Tests |
51 | { | 51 | { |
52 | [TestFixture] | 52 | [TestFixture] |
53 | public class UserInventoryTests | 53 | public class UserInventoryTests : OpenSimTestCase |
54 | { | 54 | { |
55 | [Test] | 55 | [Test] |
56 | public void TestCreateInventoryFolders() | ||
57 | { | ||
58 | TestHelpers.InMethod(); | ||
59 | // TestHelpers.EnableLogging(); | ||
60 | |||
61 | // For this test both folders will have the same name which is legal in SL user inventories. | ||
62 | string foldersName = "f1"; | ||
63 | |||
64 | Scene scene = new SceneHelpers().SetupScene(); | ||
65 | UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene, TestHelpers.ParseTail(1001)); | ||
66 | |||
67 | UserInventoryHelpers.CreateInventoryFolder(scene.InventoryService, user1.PrincipalID, foldersName); | ||
68 | |||
69 | List<InventoryFolderBase> oneFolder | ||
70 | = UserInventoryHelpers.GetInventoryFolders(scene.InventoryService, user1.PrincipalID, foldersName); | ||
71 | |||
72 | Assert.That(oneFolder.Count, Is.EqualTo(1)); | ||
73 | InventoryFolderBase firstRetrievedFolder = oneFolder[0]; | ||
74 | Assert.That(firstRetrievedFolder.Name, Is.EqualTo(foldersName)); | ||
75 | |||
76 | UserInventoryHelpers.CreateInventoryFolder(scene.InventoryService, user1.PrincipalID, foldersName); | ||
77 | |||
78 | List<InventoryFolderBase> twoFolders | ||
79 | = UserInventoryHelpers.GetInventoryFolders(scene.InventoryService, user1.PrincipalID, foldersName); | ||
80 | |||
81 | Assert.That(twoFolders.Count, Is.EqualTo(2)); | ||
82 | Assert.That(twoFolders[0].Name, Is.EqualTo(foldersName)); | ||
83 | Assert.That(twoFolders[1].Name, Is.EqualTo(foldersName)); | ||
84 | Assert.That(twoFolders[0].ID, Is.Not.EqualTo(twoFolders[1].ID)); | ||
85 | } | ||
86 | |||
87 | [Test] | ||
56 | public void TestGiveInventoryItem() | 88 | public void TestGiveInventoryItem() |
57 | { | 89 | { |
58 | TestHelpers.InMethod(); | 90 | TestHelpers.InMethod(); |
@@ -83,7 +115,7 @@ namespace OpenSim.Region.Framework.Tests | |||
83 | public void TestGiveInventoryFolder() | 115 | public void TestGiveInventoryFolder() |
84 | { | 116 | { |
85 | TestHelpers.InMethod(); | 117 | TestHelpers.InMethod(); |
86 | // log4net.Config.XmlConfigurator.Configure(); | 118 | // TestHelpers.EnableLogging(); |
87 | 119 | ||
88 | Scene scene = new SceneHelpers().SetupScene(); | 120 | Scene scene = new SceneHelpers().SetupScene(); |
89 | UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene, TestHelpers.ParseTail(1001)); | 121 | UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene, TestHelpers.ParseTail(1001)); |