bring TestLoadIarV0_1AbsentUsers() back online

soprefactor
Justin Clark-Casey (justincc) 2010-06-04 21:19:37 +01:00
parent a08ace300b
commit 0526d3a535
1 changed files with 45 additions and 52 deletions

View File

@ -364,76 +364,69 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
/// ///
/// This may possibly one day get overtaken by the as yet incomplete temporary profiles feature /// This may possibly one day get overtaken by the as yet incomplete temporary profiles feature
/// (as tested in the a later commented out test) /// (as tested in the a later commented out test)
/// REFACTORING PROBLEM. Needs rewrite. /// This test is currently disabled
// [Test] [Test]
// public void TestLoadIarV0_1AbsentUsers() public void TestLoadIarV0_1AbsentUsers()
// { {
// TestHelper.InMethod(); TestHelper.InMethod();
//log4net.Config.XmlConfigurator.Configure();
// //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 userFirstName = "Charlie"; string itemName = "b.lsl";
// string userLastName = "Chan"; string archiveItemName = InventoryArchiveWriteRequest.CreateArchiveItemName(itemName, UUID.Random());
// 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"; MemoryStream archiveWriteStream = new MemoryStream();
// string archiveItemName = InventoryArchiveWriteRequest.CreateArchiveItemName(itemName, UUID.Random()); TarArchiveWriter tar = new TarArchiveWriter(archiveWriteStream);
// MemoryStream archiveWriteStream = new MemoryStream(); InventoryItemBase item1 = new InventoryItemBase();
// TarArchiveWriter tar = new TarArchiveWriter(archiveWriteStream); 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;
// InventoryItemBase item1 = new InventoryItemBase(); string item1FileName
// item1.Name = itemName; = string.Format("{0}{1}", ArchiveConstants.INVENTORY_PATH, archiveItemName);
// item1.AssetID = UUID.Random(); tar.WriteFile(item1FileName, UserInventoryItemSerializer.Serialize(item1));
// item1.GroupID = UUID.Random(); tar.Close();
// item1.CreatorId = OspResolver.MakeOspa(userItemCreatorFirstName, userItemCreatorLastName);
// //item1.CreatorId = userUuid.ToString();
// //item1.CreatorId = "00000000-0000-0000-0000-000000000444";
// item1.Owner = UUID.Zero;
// string item1FileName MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray());
// = string.Format("{0}{1}", ArchiveConstants.INVENTORY_PATH, archiveItemName); SerialiserModule serialiserModule = new SerialiserModule();
// tar.WriteFile(item1FileName, UserInventoryItemSerializer.Serialize(item1)); InventoryArchiverModule archiverModule = new InventoryArchiverModule(true);
// tar.Close();
// MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray()); // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene
// SerialiserModule serialiserModule = new SerialiserModule(); Scene scene = SceneSetupHelpers.SetupScene("inventory");
// InventoryArchiverModule archiverModule = new InventoryArchiverModule(true);
// // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule);
// Scene scene = SceneSetupHelpers.SetupScene("inventory"); UserProfileTestUtils.CreateUserWithInventory(scene, userFirstName, userLastName, userUuid, "meowfood");
// IUserAdminService userAdminService = scene.CommsManager.UserAdminService;
// SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); archiverModule.DearchiveInventory(userFirstName, userLastName, "/", "meowfood", archiveReadStream);
// userAdminService.AddUser(
// userFirstName, userLastName, "meowfood", String.Empty, 1000, 1000, userUuid);
// archiverModule.DearchiveInventory(userFirstName, userLastName, "/", "meowfood", archiveReadStream); InventoryItemBase foundItem1
= InventoryArchiveUtils.FindItemByPath(scene.InventoryService, userUuid, itemName);
// CachedUserInfo userInfo Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1");
// = 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( // Assert.That(
// foundItem1.CreatorIdAsUuid, Is.EqualTo(userUuid), // foundItem1.CreatorId, Is.EqualTo(userUuid),
// "Loaded item uuid creator doesn't match that of the loading user"); // "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");
}
/// <summary> /// <summary>
/// Test loading a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet) where /// 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 /// no account exists with the creator name
/// </summary> /// </summary>
/// Disabled since temporary profiles have not yet been implemented. /// Disabled since temporary profiles have not yet been implemented.
/// REFACTORING PROBLEM. Needs rewrite.
/// ///
//[Test] //[Test]
//public void TestLoadIarV0_1TempProfiles() //public void TestLoadIarV0_1TempProfiles()