diff options
author | Justin Clark-Casey (justincc) | 2010-06-18 17:10:16 +0100 |
---|---|---|
committer | Justin Clark-Casey | 2010-06-18 18:08:47 +0100 |
commit | 701cc35c9f753bcd34b84388deec8a8c3f9c63fd (patch) | |
tree | a67325a157a0599c4b9d8dc63b052099833b0113 /OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs | |
parent | in IAR utils, return all folders that match a particular path rather than jus... (diff) | |
download | opensim-SC_OLD-701cc35c9f753bcd34b84388deec8a8c3f9c63fd.zip opensim-SC_OLD-701cc35c9f753bcd34b84388deec8a8c3f9c63fd.tar.gz opensim-SC_OLD-701cc35c9f753bcd34b84388deec8a8c3f9c63fd.tar.bz2 opensim-SC_OLD-701cc35c9f753bcd34b84388deec8a8c3f9c63fd.tar.xz |
change TestPartExistingIarPath() to check appropriate folder creation
change some names in InventoryArchiveReadRequest in an effort to make the code more comprehendable
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs index 6bf1219..85afbf9 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\/"; |
@@ -542,7 +542,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
542 | } | 542 | } |
543 | 543 | ||
544 | /// <summary> | 544 | /// <summary> |
545 | /// Test replication of a partly existing archive path to the user's inventory. | 545 | /// Test replication of a partly existing archive path to the user's inventory. This should create |
546 | /// a duplicate path without the merge option. | ||
546 | /// </summary> | 547 | /// </summary> |
547 | [Test] | 548 | [Test] |
548 | public void TestPartExistingIarPath() | 549 | public void TestPartExistingIarPath() |
@@ -555,7 +556,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
555 | 556 | ||
556 | string folder1ExistingName = "a"; | 557 | string folder1ExistingName = "a"; |
557 | string folder2Name = "b"; | 558 | string folder2Name = "b"; |
558 | string itemName = "c.lsl"; | ||
559 | 559 | ||
560 | InventoryFolderBase folder1 | 560 | InventoryFolderBase folder1 |
561 | = UserInventoryTestUtils.CreateInventoryFolder( | 561 | = UserInventoryTestUtils.CreateInventoryFolder( |
@@ -563,28 +563,36 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
563 | 563 | ||
564 | string folder1ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder1ExistingName, UUID.Random()); | 564 | string folder1ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder1ExistingName, UUID.Random()); |
565 | string folder2ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder2Name, UUID.Random()); | 565 | string folder2ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder2Name, UUID.Random()); |
566 | string itemArchiveName = InventoryArchiveWriteRequest.CreateArchiveItemName(itemName, UUID.Random()); | ||
567 | 566 | ||
568 | string itemArchivePath | 567 | string itemArchivePath |
569 | = string.Format( | 568 | = string.Format( |
570 | "{0}{1}{2}{3}", | 569 | "{0}{1}{2}", |
571 | ArchiveConstants.INVENTORY_PATH, folder1ArchiveName, folder2ArchiveName, itemArchiveName); | 570 | ArchiveConstants.INVENTORY_PATH, folder1ArchiveName, folder2ArchiveName); |
572 | 571 | ||
573 | new InventoryArchiveReadRequest(scene, ua1, null, (Stream)null) | 572 | new InventoryArchiveReadRequest(scene, ua1, null, (Stream)null) |
574 | .ReplicateArchivePathToUserInventory( | 573 | .ReplicateArchivePathToUserInventory( |
575 | itemArchivePath, scene.InventoryService.GetRootFolder(ua1.PrincipalID), | 574 | itemArchivePath, scene.InventoryService.GetRootFolder(ua1.PrincipalID), |
576 | new Dictionary<string, InventoryFolderBase>(), new List<InventoryNodeBase>()); | 575 | new Dictionary<string, InventoryFolderBase>(), new List<InventoryNodeBase>()); |
577 | 576 | ||
578 | InventoryFolderBase folder1Post | 577 | List<InventoryFolderBase> folder1PostCandidates |
579 | = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, ua1.PrincipalID, folder1ExistingName)[0]; | 578 | = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, ua1.PrincipalID, folder1ExistingName); |
580 | Assert.That(folder1Post.ID, Is.EqualTo(folder1.ID)); | 579 | Assert.That(folder1PostCandidates.Count, Is.EqualTo(2)); |
581 | /* | 580 | |
582 | InventoryFolderBase folder2 | 581 | // FIXME: Temporarily, we're going to do something messy to make sure we pick up the created folder. |
582 | InventoryFolderBase folder1Post = null; | ||
583 | foreach (InventoryFolderBase folder in folder1PostCandidates) | ||
584 | { | ||
585 | if (folder.ID != folder1.ID) | ||
586 | { | ||
587 | folder1Post = folder; | ||
588 | break; | ||
589 | } | ||
590 | } | ||
591 | // Assert.That(folder1Post.ID, Is.EqualTo(folder1.ID)); | ||
592 | |||
593 | List<InventoryFolderBase> folder2PostCandidates | ||
583 | = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, folder1Post, "b"); | 594 | = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, folder1Post, "b"); |
584 | Assert.That(folder2, Is.Not.Null); | 595 | Assert.That(folder2PostCandidates.Count, Is.EqualTo(1)); |
585 | InventoryItemBase item = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, folder2, itemName); | ||
586 | Assert.That(item, Is.Not.Null); | ||
587 | */ | ||
588 | } | 596 | } |
589 | } | 597 | } |
590 | } \ No newline at end of file | 598 | } \ No newline at end of file |