From 76b21860e9f727391849c9b38c620b9bc16e4312 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 8 Sep 2009 16:12:15 +0100 Subject: refactor iar name generation slightly change the format of item archive names --- .../Archiver/InventoryArchiveWriteRequest.cs | 67 +++++++++++++++++++--- .../Archiver/Tests/InventoryArchiverTests.cs | 31 ++++------ 2 files changed, 71 insertions(+), 27 deletions(-) (limited to 'OpenSim/Region/CoreModules/Avatar') diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs index dee4a5d..b178772 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs @@ -138,7 +138,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver protected void SaveInvItem(InventoryItemBase inventoryItem, string path) { - string filename = string.Format("{0}{1}_{2}.xml", path, inventoryItem.Name, inventoryItem.ID); + string filename = path + CreateArchiveItemName(inventoryItem); // Record the creator of this item for user record purposes (which might go away soon) m_userUuids[inventoryItem.CreatorIdAsUuid] = 1; @@ -162,12 +162,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver { if (saveThisFolderItself) { - path += - string.Format( - "{0}{1}{2}/", - inventoryFolder.Name, - ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR, - inventoryFolder.ID); + path += CreateArchiveFolderName(inventoryFolder); // We need to make sure that we record empty folders m_archiveWriter.WriteDir(path); @@ -356,5 +351,63 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver } } } + + /// + /// Create the archive name for a particular folder. + /// + /// + /// These names are prepended with an inventory folder's UUID so that more than one folder can have the + /// same name + /// + /// + /// + public static string CreateArchiveFolderName(InventoryFolderBase folder) + { + return CreateArchiveFolderName(folder.Name, folder.ID); + } + + /// + /// Create the archive name for a particular item. + /// + /// + /// These names are prepended with an inventory item's UUID so that more than one item can have the + /// same name + /// + /// + /// + public static string CreateArchiveItemName(InventoryItemBase item) + { + return CreateArchiveItemName(item.Name, item.ID); + } + + /// + /// Create an archive folder name given its constituent components + /// + /// + /// + /// + public static string CreateArchiveFolderName(string name, UUID id) + { + return string.Format( + "{0}{1}{2}/", + name, + ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR, + id); + } + + /// + /// Create an archive item name given its constituent components + /// + /// + /// + /// + public static string CreateArchiveItemName(string name, UUID id) + { + return string.Format( + "{0}{1}{2}.xml", + name, + ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR, + id); + } } } diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs index d579a81..5461ea2 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs @@ -153,19 +153,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests //bool gotControlFile = false; bool gotObject1File = false; //bool gotObject2File = false; + string expectedObject1FileName = InventoryArchiveWriteRequest.CreateArchiveItemName(item1); string expectedObject1FilePath = string.Format( - "{0}{1}/{2}_{3}.xml", + "{0}{1}{2}", ArchiveConstants.INVENTORY_PATH, - string.Format( - "Objects{0}{1}", ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR, objsFolder.ID), - item1.Name, - item1Id); - -// string expectedObject2FileName = string.Format( -// "{0}_{1:000}-{2:000}-{3:000}__{4}.xml", -// part2.Name, -// Math.Round(part2.GroupPosition.X), Math.Round(part2.GroupPosition.Y), Math.Round(part2.GroupPosition.Z), -// part2.UUID); + InventoryArchiveWriteRequest.CreateArchiveFolderName(objsFolder), + expectedObject1FileName); string filePath; TarArchiveReader.TarEntryType tarEntryType; @@ -187,7 +180,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests // // if (fileName.StartsWith(part1.Name)) // { - Assert.That(filePath, Is.EqualTo(expectedObject1FilePath)); + Assert.That(expectedObject1FilePath, Is.EqualTo(filePath)); gotObject1File = true; // } // else if (fileName.StartsWith(part2.Name)) @@ -385,16 +378,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests 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 folder1ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder1Name, UUID.Random()); + string folder2ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder2Name, UUID.Random()); + string itemArchiveName = InventoryArchiveWriteRequest.CreateArchiveItemName(itemName, UUID.Random()); + string itemArchivePath = string.Format( - "{0}{1}/{2}/{3}", - ArchiveConstants.INVENTORY_PATH, folder1ArchiveName, folder2ArchiveName, itemName); + "{0}{1}{2}{3}", + ArchiveConstants.INVENTORY_PATH, folder1ArchiveName, folder2ArchiveName, itemArchiveName); //Console.WriteLine("userInfo.RootFolder 2: {0}", userInfo.RootFolder); -- cgit v1.1 From 36a40e0295e7c9a60ad4a5047eca9d20df94397f Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 8 Sep 2009 16:29:31 +0100 Subject: refactor: change method argument name --- .../Archiver/InventoryArchiveReadRequest.cs | 46 +++++++++++----------- 1 file changed, 24 insertions(+), 22 deletions(-) (limited to 'OpenSim/Region/CoreModules/Avatar') diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs index ff583e5..3250ddf 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs @@ -206,7 +206,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver /// /// Replicate the inventory paths in the archive to the user's inventory as necessary. /// - /// + /// The item archive path to replicate /// Is the path we're dealing with a directory? /// The root folder for the inventory load /// @@ -218,49 +218,51 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver /// /// The last user inventory folder created or found for the archive path public InventoryFolderBase ReplicateArchivePathToUserInventory( - string fsPath, + string archivePath, bool isDir, InventoryFolderBase rootDestFolder, Dictionary foldersCreated, List nodesLoaded) { - fsPath = fsPath.Substring(ArchiveConstants.INVENTORY_PATH.Length); + archivePath = archivePath.Substring(ArchiveConstants.INVENTORY_PATH.Length); // Remove the file portion if we aren't already dealing with a directory path if (!isDir) - fsPath = fsPath.Remove(fsPath.LastIndexOf("/") + 1); + archivePath = archivePath.Remove(archivePath.LastIndexOf("/") + 1); - string originalFsPath = fsPath; + string originalArchivePath = archivePath; - m_log.DebugFormat("[INVENTORY ARCHIVER]: Loading to folder {0}", fsPath); + m_log.DebugFormat( + "[INVENTORY ARCHIVER]: Loading to folder {0 {1}}", rootDestFolder.Name, rootDestFolder.ID); InventoryFolderBase destFolder = null; // XXX: Nasty way of dealing with a path that has no directory component - if (fsPath.Length > 0) + if (archivePath.Length > 0) { - while (null == destFolder && fsPath.Length > 0) + while (null == destFolder && archivePath.Length > 0) { - if (foldersCreated.ContainsKey(fsPath)) + if (foldersCreated.ContainsKey(archivePath)) { - m_log.DebugFormat("[INVENTORY ARCHIVER]: Found previously created fs path {0}", fsPath); - destFolder = foldersCreated[fsPath]; + m_log.DebugFormat( + "[INVENTORY ARCHIVER]: Found previously created folder from archive path {0}", archivePath); + destFolder = foldersCreated[archivePath]; } else { // Don't include the last slash - int penultimateSlashIndex = fsPath.LastIndexOf("/", fsPath.Length - 2); + int penultimateSlashIndex = archivePath.LastIndexOf("/", archivePath.Length - 2); if (penultimateSlashIndex >= 0) { - fsPath = fsPath.Remove(penultimateSlashIndex + 1); + archivePath = archivePath.Remove(penultimateSlashIndex + 1); } else { m_log.DebugFormat( - "[INVENTORY ARCHIVER]: Found no previously created fs path for {0}", - originalFsPath); - fsPath = string.Empty; + "[INVENTORY ARCHIVER]: Found no previously created folder for archive path {0}", + originalArchivePath); + archivePath = string.Empty; destFolder = rootDestFolder; } } @@ -271,14 +273,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver destFolder = rootDestFolder; } - string fsPathSectionToCreate = originalFsPath.Substring(fsPath.Length); + string archivePathSectionToCreate = originalArchivePath.Substring(archivePath.Length); string[] rawDirsToCreate - = fsPathSectionToCreate.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries); + = archivePathSectionToCreate.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries); int i = 0; while (i < rawDirsToCreate.Length) { - m_log.DebugFormat("[INVENTORY ARCHIVER]: Creating folder {0}", rawDirsToCreate[i]); + m_log.DebugFormat("[INVENTORY ARCHIVER]: Loading archived folder {0}", rawDirsToCreate[i]); int identicalNameIdentifierIndex = rawDirsToCreate[i].LastIndexOf( @@ -305,9 +307,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver // foundFolder.Name, foundFolder.ID); // Record that we have now created this folder - fsPath += rawDirsToCreate[i] + "/"; - m_log.DebugFormat("[INVENTORY ARCHIVER]: Recording creation of fs path {0}", fsPath); - foldersCreated[fsPath] = destFolder; + archivePath += rawDirsToCreate[i] + "/"; + m_log.DebugFormat("[INVENTORY ARCHIVER]: Loaded archive path {0}", archivePath); + foldersCreated[archivePath] = destFolder; if (0 == i) nodesLoaded.Add(destFolder); -- cgit v1.1 From b7256f256733f1c7667edc95ec500694bbe35dab Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 8 Sep 2009 17:42:07 +0100 Subject: extend load iar test to loading into a deeply nested directory correct bug associated with this --- .../Archiver/InventoryArchiveReadRequest.cs | 2 +- .../Inventory/Archiver/InventoryArchiveUtils.cs | 4 +-- .../Archiver/Tests/InventoryArchiverTests.cs | 31 +++++++++++++++++----- 3 files changed, 27 insertions(+), 10 deletions(-) (limited to 'OpenSim/Region/CoreModules/Avatar') diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs index 3250ddf..50c0f93 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs @@ -233,7 +233,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver string originalArchivePath = archivePath; m_log.DebugFormat( - "[INVENTORY ARCHIVER]: Loading to folder {0 {1}}", rootDestFolder.Name, rootDestFolder.ID); + "[INVENTORY ARCHIVER]: Loading to folder {0} {1}", rootDestFolder.Name, rootDestFolder.ID); InventoryFolderBase destFolder = null; diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs index 2eeb637..5ebf2fa 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs @@ -106,8 +106,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver if (path == PATH_DELIMITER) return startFolder; - InventoryFolderBase foundFolder = null; - string[] components = path.Split(new string[] { PATH_DELIMITER }, 2, StringSplitOptions.None); InventoryCollection contents = inventoryService.GetFolderContent(startFolder.Owner, startFolder.ID); @@ -116,7 +114,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver if (folder.Name == components[0]) { if (components.Length > 1) - return FindFolderByPath(inventoryService, foundFolder, components[1]); + return FindFolderByPath(inventoryService, folder, components[1]); else return folder; } diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs index 5461ea2..384a1f2 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs @@ -195,7 +195,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests Assert.That(gotObject1File, Is.True, "No item1 file in archive"); // Assert.That(gotObject2File, Is.True, "No object2 file in archive"); - // TODO: Test presence of more files and contents of files. + // TODO: Test presence of more files and contents of files. } /// @@ -257,24 +257,43 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests CachedUserInfo userInfo = scene.CommsManager.UserProfileCacheService.GetUserDetails(userFirstName, userLastName); - InventoryItemBase foundItem + InventoryItemBase foundItem1 = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, userInfo.UserProfile.ID, itemName); - Assert.That(foundItem, Is.Not.Null, "Didn't find loaded item"); + Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1"); Assert.That( - foundItem.CreatorId, Is.EqualTo(item1.CreatorId), + foundItem1.CreatorId, Is.EqualTo(item1.CreatorId), "Loaded item non-uuid creator doesn't match original"); Assert.That( - foundItem.CreatorIdAsUuid, Is.EqualTo(userItemCreatorUuid), + foundItem1.CreatorIdAsUuid, Is.EqualTo(userItemCreatorUuid), "Loaded item uuid creator doesn't match original"); - Assert.That(foundItem.Owner, Is.EqualTo(userUuid), + Assert.That(foundItem1.Owner, Is.EqualTo(userUuid), "Loaded item owner doesn't match inventory reciever"); + + // Now try loading to a root child folder + UserInventoryTestUtils.CreateInventoryFolder(scene.InventoryService, userInfo.UserProfile.ID, "xA"); + archiveReadStream = new MemoryStream(archiveReadStream.ToArray()); + archiverModule.DearchiveInventory(userFirstName, userLastName, "xA", archiveReadStream); + + InventoryItemBase foundItem2 + = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, userInfo.UserProfile.ID, "xA/" + itemName); + Assert.That(foundItem2, Is.Not.Null, "Didn't find loaded item 2"); + + // Now try loading to a more deeply nested folder + UserInventoryTestUtils.CreateInventoryFolder(scene.InventoryService, userInfo.UserProfile.ID, "xB/xC"); + archiveReadStream = new MemoryStream(archiveReadStream.ToArray()); + archiverModule.DearchiveInventory(userFirstName, userLastName, "xB/xC", archiveReadStream); + + InventoryItemBase foundItem3 + = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, userInfo.UserProfile.ID, "xB/xC/" + itemName); + Assert.That(foundItem3, Is.Not.Null, "Didn't find loaded item 3"); } /// /// Test loading a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet) where /// no account exists with the creator name /// + /// Disabled since temporary profiles have not yet been implemented. //[Test] public void TestLoadIarV0_1TempProfiles() { -- cgit v1.1 From 0683cf6e0d541571d04d6511dc0ecabb17dd1e1e Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 9 Sep 2009 18:03:49 +0100 Subject: Add test to check behaviour if an iar is loaded where no user profile exists for the creators Disable generation of temporary profiles for now, instead record loading user as creator --- .../Archiver/InventoryArchiveReadRequest.cs | 2 + .../Archiver/Tests/InventoryArchiverTests.cs | 79 +++++++++++++++++++++- 2 files changed, 78 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/CoreModules/Avatar') diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs index 50c0f93..2a1c82e 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs @@ -177,6 +177,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver UUID ospResolvedId = OspResolver.ResolveOspa(item.CreatorId, m_scene.CommsManager); if (UUID.Zero != ospResolvedId) item.CreatorIdAsUuid = ospResolvedId; + else + item.CreatorIdAsUuid = m_userInfo.UserProfile.ID; item.Owner = m_userInfo.UserProfile.ID; diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs index 384a1f2..9c5f8f3 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs @@ -81,7 +81,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests public void TestSaveIarV0_1() { TestHelper.InMethod(); - log4net.Config.XmlConfigurator.Configure(); + //log4net.Config.XmlConfigurator.Configure(); InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); @@ -202,12 +202,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests /// Test loading a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet) where /// an account exists with the creator name. /// + /// + /// This test also does some deeper probing of loading into nested inventory structures [Test] public void TestLoadIarV0_1ExistingUsers() { TestHelper.InMethod(); - log4net.Config.XmlConfigurator.Configure(); + //log4net.Config.XmlConfigurator.Configure(); string userFirstName = "Mr"; string userLastName = "Tiddles"; @@ -291,6 +293,77 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests /// /// Test loading a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet) where + /// embedded creators do not exist in the system + /// + /// + /// This may possibly one day get overtaken by the as yet incomplete temporary profiles feature + /// (as tested in the a later commented out test) + [Test] + public void TestLoadIarV0_1AbsentUsers() + { + TestHelper.InMethod(); + + log4net.Config.XmlConfigurator.Configure(); + + string userFirstName = "Charlie"; + string userLastName = "Chan"; + UUID userUuid = UUID.Parse("00000000-0000-0000-0000-000000000999"); + string userItemCreatorFirstName = "Bat"; + string userItemCreatorLastName = "Man"; + //UUID userItemCreatorUuid = UUID.Parse("00000000-0000-0000-0000-000000008888"); + + string itemName = "b.lsl"; + string archiveItemName + = string.Format("{0}{1}{2}", itemName, "_", UUID.Random()); + + MemoryStream archiveWriteStream = new MemoryStream(); + TarArchiveWriter tar = new TarArchiveWriter(archiveWriteStream); + + InventoryItemBase item1 = new InventoryItemBase(); + item1.Name = itemName; + item1.AssetID = UUID.Random(); + item1.GroupID = UUID.Random(); + item1.CreatorId = OspResolver.MakeOspa(userItemCreatorFirstName, userItemCreatorLastName); + //item1.CreatorId = userUuid.ToString(); + //item1.CreatorId = "00000000-0000-0000-0000-000000000444"; + item1.Owner = UUID.Zero; + + string item1FileName + = string.Format("{0}{1}", ArchiveConstants.INVENTORY_PATH, archiveItemName); + tar.WriteFile(item1FileName, UserInventoryItemSerializer.Serialize(item1)); + tar.Close(); + + MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray()); + SerialiserModule serialiserModule = new SerialiserModule(); + InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); + + // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene + Scene scene = SceneSetupHelpers.SetupScene("inventory"); + IUserAdminService userAdminService = scene.CommsManager.UserAdminService; + + SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); + userAdminService.AddUser( + userFirstName, userLastName, "meowfood", String.Empty, 1000, 1000, userUuid); + + archiverModule.DearchiveInventory(userFirstName, userLastName, "/", archiveReadStream); + + CachedUserInfo userInfo + = scene.CommsManager.UserProfileCacheService.GetUserDetails(userFirstName, userLastName); + + InventoryItemBase foundItem1 + = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, userInfo.UserProfile.ID, itemName); + + Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1"); +// Assert.That( +// foundItem1.CreatorId, Is.EqualTo(userUuid), +// "Loaded item non-uuid creator doesn't match that of the loading user"); + Assert.That( + foundItem1.CreatorIdAsUuid, Is.EqualTo(userUuid), + "Loaded item uuid creator doesn't match that of the loading user"); + } + + /// + /// Test loading a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet) where /// no account exists with the creator name /// /// Disabled since temporary profiles have not yet been implemented. @@ -376,7 +449,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests { TestHelper.InMethod(); - log4net.Config.XmlConfigurator.Configure(); + //log4net.Config.XmlConfigurator.Configure(); Scene scene = SceneSetupHelpers.SetupScene("inventory"); CommunicationsManager commsManager = scene.CommsManager; -- cgit v1.1