From 2246b4daaafc15290e1e90011d41ecb77b5be74e Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Fri, 24 Apr 2009 19:43:54 +0000 Subject: * Write separate unit test for replicating iar structure to a user inventory --- .../Archiver/Tests/InventoryArchiverTests.cs | 33 ++++++++++++++++++---- .../World/Archiver/Tests/ArchiverTests.cs | 5 ++-- 2 files changed, 30 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs index 1d4256b..302d214 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs @@ -26,6 +26,7 @@ */ using System; +using System.Collections.Generic; using System.IO; using System.Text; using System.Threading; @@ -244,17 +245,39 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests Console.WriteLine("Finished TestLoadIarV0p1()"); } - /* /// /// Test replication of an archive path to the user's inventory. /// [Test] public void TestReplicateArchivePathToUserInventory() { - CommunicationsManager commsManager = new TestCommunicationsManager(); - CachedUserInfo userInfo = new CachedUserInfo(); - new InventoryArchiveReadRequest(userInfo, "/", null, commsManager); + CommunicationsManager commsManager = new TestCommunicationsManager(); + CachedUserInfo userInfo = UserProfileTestUtils.CreateUserWithInventory(commsManager); + Dictionary foldersCreated = new Dictionary(); + List nodesLoaded = new List(); + + string folder1Name = "a"; + string folder2Name = "b"; + string itemName = "c.lsl"; + + string folder1ArchiveName + = string.Format( + "{0}{1}{2}", folder1Name, ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR, UUID.Random()); + string folder2ArchiveName + = string.Format( + "{0}{1}{2}", folder2Name, ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR, UUID.Random()); + string itemArchivePath + = string.Format( + "{0}{1}/{2}/{3}", + ArchiveConstants.INVENTORY_PATH, folder1ArchiveName, folder2ArchiveName, itemName); + + new InventoryArchiveReadRequest(userInfo, null, (Stream)null, null) + .ReplicateArchivePathToUserInventory(itemArchivePath, false, userInfo.RootFolder, foldersCreated, nodesLoaded); + + InventoryFolderImpl folder1 = userInfo.RootFolder.FindFolderByPath("a"); + Assert.That(folder1, Is.Not.Null, "Could not find folder a"); + InventoryFolderImpl folder2 = folder1.FindFolderByPath("b"); + Assert.That(folder2, Is.Not.Null, "Could not find folder b"); } - */ } } diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs index e75ca20..70ed6a7 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs @@ -243,9 +243,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests /// /// Test merging a V0.2 OpenSim Region Archive into an existing scene - /// - - [Test] + /// + //[Test] public void TestMergeOarV0p2() { //XmlConfigurator.Configure(); -- cgit v1.1