diff options
author | Justin Clark-Casey (justincc) | 2010-06-11 21:18:09 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2010-06-11 21:18:09 +0100 |
commit | 1a16a92a62069a50efd618b8fd6cbc0d530c7654 (patch) | |
tree | 526df2e2a43a76d8d908b3f911b2375e5deb8fb3 /OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs | |
parent | Remove the cm* function namespace (diff) | |
download | opensim-SC_OLD-1a16a92a62069a50efd618b8fd6cbc0d530c7654.zip opensim-SC_OLD-1a16a92a62069a50efd618b8fd6cbc0d530c7654.tar.gz opensim-SC_OLD-1a16a92a62069a50efd618b8fd6cbc0d530c7654.tar.bz2 opensim-SC_OLD-1a16a92a62069a50efd618b8fd6cbc0d530c7654.tar.xz |
create inactive test for iar folders/items merged with existing paths
add various helper functions for simplifying test readability
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs | 50 |
1 files changed, 48 insertions, 2 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs index 59cd386..00bd27a 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs | |||
@@ -279,7 +279,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
279 | public void TestIarV0_1WithEscapedChars() | 279 | public void TestIarV0_1WithEscapedChars() |
280 | { | 280 | { |
281 | TestHelper.InMethod(); | 281 | TestHelper.InMethod(); |
282 | log4net.Config.XmlConfigurator.Configure(); | 282 | // log4net.Config.XmlConfigurator.Configure(); |
283 | 283 | ||
284 | string itemName = "You & you are a mean/man/"; | 284 | string itemName = "You & you are a mean/man/"; |
285 | string humanEscapedItemName = @"You & you are a mean\/man\/"; | 285 | string humanEscapedItemName = @"You & you are a mean\/man\/"; |
@@ -505,7 +505,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
505 | /// Test replication of an archive path to the user's inventory. | 505 | /// Test replication of an archive path to the user's inventory. |
506 | /// </summary> | 506 | /// </summary> |
507 | [Test] | 507 | [Test] |
508 | public void TestReplicateArchivePathToUserInventory() | 508 | public void TestNewIarPath() |
509 | { | 509 | { |
510 | TestHelper.InMethod(); | 510 | TestHelper.InMethod(); |
511 | //log4net.Config.XmlConfigurator.Configure(); | 511 | //log4net.Config.XmlConfigurator.Configure(); |
@@ -540,5 +540,51 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
540 | InventoryFolderBase folder2 = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, folder1, "b"); | 540 | InventoryFolderBase folder2 = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, folder1, "b"); |
541 | Assert.That(folder2, Is.Not.Null, "Could not find folder b"); | 541 | Assert.That(folder2, Is.Not.Null, "Could not find folder b"); |
542 | } | 542 | } |
543 | |||
544 | /// <summary> | ||
545 | /// Test replication of a partly existing archive path to the user's inventory. | ||
546 | /// </summary> | ||
547 | [Test] | ||
548 | public void TestPartExistingIarPath() | ||
549 | { | ||
550 | TestHelper.InMethod(); | ||
551 | //log4net.Config.XmlConfigurator.Configure(); | ||
552 | |||
553 | Scene scene = SceneSetupHelpers.SetupScene("inventory"); | ||
554 | UserAccount ua1 = UserProfileTestUtils.CreateUserWithInventory(scene); | ||
555 | |||
556 | string folder1ExistingName = "a"; | ||
557 | string folder2Name = "b"; | ||
558 | string itemName = "c.lsl"; | ||
559 | |||
560 | InventoryFolderBase folder1 | ||
561 | = UserInventoryTestUtils.CreateInventoryFolder( | ||
562 | scene.InventoryService, ua1.PrincipalID, folder1ExistingName); | ||
563 | |||
564 | string folder1ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder1ExistingName, UUID.Random()); | ||
565 | string folder2ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder2Name, UUID.Random()); | ||
566 | string itemArchiveName = InventoryArchiveWriteRequest.CreateArchiveItemName(itemName, UUID.Random()); | ||
567 | |||
568 | string itemArchivePath | ||
569 | = string.Format( | ||
570 | "{0}{1}{2}{3}", | ||
571 | ArchiveConstants.INVENTORY_PATH, folder1ArchiveName, folder2ArchiveName, itemArchiveName); | ||
572 | |||
573 | new InventoryArchiveReadRequest(scene, ua1, null, (Stream)null) | ||
574 | .ReplicateArchivePathToUserInventory( | ||
575 | itemArchivePath, scene.InventoryService.GetRootFolder(ua1.PrincipalID), | ||
576 | new Dictionary<string, InventoryFolderBase>(), new List<InventoryNodeBase>()); | ||
577 | |||
578 | InventoryFolderBase folder1Post | ||
579 | = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, ua1.PrincipalID, folder1ExistingName); | ||
580 | Assert.That(folder1Post.ID, Is.EqualTo(folder1.ID)); | ||
581 | /* | ||
582 | InventoryFolderBase folder2 | ||
583 | = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, folder1Post, "b"); | ||
584 | Assert.That(folder2, Is.Not.Null); | ||
585 | InventoryItemBase item = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, folder2, itemName); | ||
586 | Assert.That(item, Is.Not.Null); | ||
587 | */ | ||
588 | } | ||
543 | } | 589 | } |
544 | } \ No newline at end of file | 590 | } \ No newline at end of file |