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";
// string archiveItemName = InventoryArchiveWriteRequest.CreateArchiveItemName(itemName, UUID.Random());
// MemoryStream archiveWriteStream = new MemoryStream(); MemoryStream archiveWriteStream = new MemoryStream();
// TarArchiveWriter tar = new TarArchiveWriter(archiveWriteStream); TarArchiveWriter tar = new TarArchiveWriter(archiveWriteStream);
// InventoryItemBase item1 = new InventoryItemBase(); InventoryItemBase item1 = new InventoryItemBase();
// item1.Name = itemName; item1.Name = itemName;
// item1.AssetID = UUID.Random(); item1.AssetID = UUID.Random();
// item1.GroupID = UUID.Random(); item1.GroupID = UUID.Random();
// item1.CreatorId = OspResolver.MakeOspa(userItemCreatorFirstName, userItemCreatorLastName); item1.CreatorId = OspResolver.MakeOspa(userItemCreatorFirstName, userItemCreatorLastName);
// //item1.CreatorId = userUuid.ToString(); //item1.CreatorId = userUuid.ToString();
// //item1.CreatorId = "00000000-0000-0000-0000-000000000444"; //item1.CreatorId = "00000000-0000-0000-0000-000000000444";
// item1.Owner = UUID.Zero; item1.Owner = UUID.Zero;
// string item1FileName string item1FileName
// = string.Format("{0}{1}", ArchiveConstants.INVENTORY_PATH, archiveItemName); = string.Format("{0}{1}", ArchiveConstants.INVENTORY_PATH, archiveItemName);
// tar.WriteFile(item1FileName, UserInventoryItemSerializer.Serialize(item1)); tar.WriteFile(item1FileName, UserInventoryItemSerializer.Serialize(item1));
// tar.Close(); tar.Close();
// MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray()); MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray());
// SerialiserModule serialiserModule = new SerialiserModule(); SerialiserModule serialiserModule = new SerialiserModule();
// InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); InventoryArchiverModule archiverModule = new InventoryArchiverModule(true);
// // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene
// Scene scene = SceneSetupHelpers.SetupScene("inventory"); Scene scene = SceneSetupHelpers.SetupScene("inventory");
// IUserAdminService userAdminService = scene.CommsManager.UserAdminService;
// SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule);
// userAdminService.AddUser( UserProfileTestUtils.CreateUserWithInventory(scene, userFirstName, userLastName, userUuid, "meowfood");
// userFirstName, userLastName, "meowfood", String.Empty, 1000, 1000, userUuid);
// archiverModule.DearchiveInventory(userFirstName, userLastName, "/", "meowfood", archiveReadStream); archiverModule.DearchiveInventory(userFirstName, userLastName, "/", "meowfood", archiveReadStream);
// CachedUserInfo userInfo InventoryItemBase foundItem1
// = scene.CommsManager.UserProfileCacheService.GetUserDetails(userFirstName, userLastName); = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, userUuid, itemName);
// 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, 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()