bring test TestLoadIarV0_1ExistingUsers() back online
parent
df2bcf7b6b
commit
f523c2033d
|
@ -80,7 +80,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
|
||||||
public void TestSaveIarV0_1()
|
public void TestSaveIarV0_1()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelper.InMethod();
|
||||||
log4net.Config.XmlConfigurator.Configure();
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
InventoryArchiverModule archiverModule = new InventoryArchiverModule(true);
|
InventoryArchiverModule archiverModule = new InventoryArchiverModule(true);
|
||||||
|
|
||||||
|
@ -195,99 +195,94 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
|
||||||
/// </summary>
|
/// </summary>
|
||||||
///
|
///
|
||||||
/// This test also does some deeper probing of loading into nested inventory structures
|
/// This test also does some deeper probing of loading into nested inventory structures
|
||||||
/// REFACTORING PROBLEM. This needs to be rewritten.
|
[Test]
|
||||||
// [Test]
|
public void TestLoadIarV0_1ExistingUsers()
|
||||||
// public void TestLoadIarV0_1ExistingUsers()
|
{
|
||||||
// {
|
TestHelper.InMethod();
|
||||||
// TestHelper.InMethod();
|
|
||||||
|
|
||||||
// //log4net.Config.XmlConfigurator.Configure();
|
//log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
// string userFirstName = "Mr";
|
string userFirstName = "Mr";
|
||||||
// string userLastName = "Tiddles";
|
string userLastName = "Tiddles";
|
||||||
// UUID userUuid = UUID.Parse("00000000-0000-0000-0000-000000000555");
|
UUID userUuid = UUID.Parse("00000000-0000-0000-0000-000000000555");
|
||||||
// string userItemCreatorFirstName = "Lord";
|
string userItemCreatorFirstName = "Lord";
|
||||||
// string userItemCreatorLastName = "Lucan";
|
string userItemCreatorLastName = "Lucan";
|
||||||
// UUID userItemCreatorUuid = UUID.Parse("00000000-0000-0000-0000-000000000666");
|
UUID userItemCreatorUuid = UUID.Parse("00000000-0000-0000-0000-000000000666");
|
||||||
|
|
||||||
// string item1Name = "b.lsl";
|
string item1Name = "b.lsl";
|
||||||
// string archiveItemName = InventoryArchiveWriteRequest.CreateArchiveItemName(item1Name, UUID.Random());
|
string archiveItemName = InventoryArchiveWriteRequest.CreateArchiveItemName(item1Name, 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 = item1Name;
|
item1.Name = item1Name;
|
||||||
// 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(
|
|
||||||
// userFirstName, userLastName, "meowfood", String.Empty, 1000, 1000, userUuid);
|
|
||||||
// userAdminService.AddUser(
|
|
||||||
// userItemCreatorFirstName, userItemCreatorLastName, "hampshire",
|
|
||||||
// String.Empty, 1000, 1000, userItemCreatorUuid);
|
|
||||||
|
|
||||||
// archiverModule.DearchiveInventory(userFirstName, userLastName, "/", "meowfood", archiveReadStream);
|
UserProfileTestUtils.CreateUserWithInventory(
|
||||||
|
scene, userFirstName, userLastName, userUuid, "meowfood");
|
||||||
|
UserProfileTestUtils.CreateUserWithInventory(
|
||||||
|
scene, userItemCreatorFirstName, userItemCreatorLastName, userItemCreatorUuid, "hampshire");
|
||||||
|
|
||||||
// CachedUserInfo userInfo
|
archiverModule.DearchiveInventory(userFirstName, userLastName, "/", "meowfood", archiveReadStream);
|
||||||
// = scene.CommsManager.UserProfileCacheService.GetUserDetails(userFirstName, userLastName);
|
|
||||||
|
|
||||||
// InventoryItemBase foundItem1
|
InventoryItemBase foundItem1
|
||||||
// = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, userInfo.UserProfile.ID, item1Name);
|
= InventoryArchiveUtils.FindItemByPath(scene.InventoryService, userUuid, item1Name);
|
||||||
|
|
||||||
// Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1");
|
Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1");
|
||||||
|
|
||||||
//// We have to disable this check since loaded items that did find users via OSPA resolution are now only storing the
|
// We have to disable this check since loaded items that did find users via OSPA resolution are now only storing the
|
||||||
//// UUID, not the OSPA itself.
|
// UUID, not the OSPA itself.
|
||||||
//// Assert.That(
|
|
||||||
//// foundItem1.CreatorId, Is.EqualTo(item1.CreatorId),
|
|
||||||
//// "Loaded item non-uuid creator doesn't match original");
|
|
||||||
// Assert.That(
|
// Assert.That(
|
||||||
// foundItem1.CreatorId, Is.EqualTo(userItemCreatorUuid.ToString()),
|
// foundItem1.CreatorId, Is.EqualTo(item1.CreatorId),
|
||||||
// "Loaded item non-uuid creator doesn't match original");
|
// "Loaded item non-uuid creator doesn't match original");
|
||||||
|
Assert.That(
|
||||||
|
foundItem1.CreatorId, Is.EqualTo(userItemCreatorUuid.ToString()),
|
||||||
|
"Loaded item non-uuid creator doesn't match original");
|
||||||
|
|
||||||
// Assert.That(
|
Assert.That(
|
||||||
// foundItem1.CreatorIdAsUuid, Is.EqualTo(userItemCreatorUuid),
|
foundItem1.CreatorIdAsUuid, Is.EqualTo(userItemCreatorUuid),
|
||||||
// "Loaded item uuid creator doesn't match original");
|
"Loaded item uuid creator doesn't match original");
|
||||||
// Assert.That(foundItem1.Owner, Is.EqualTo(userUuid),
|
Assert.That(foundItem1.Owner, Is.EqualTo(userUuid),
|
||||||
// "Loaded item owner doesn't match inventory reciever");
|
"Loaded item owner doesn't match inventory reciever");
|
||||||
|
|
||||||
// // Now try loading to a root child folder
|
// Now try loading to a root child folder
|
||||||
// UserInventoryTestUtils.CreateInventoryFolder(scene.InventoryService, userInfo.UserProfile.ID, "xA");
|
UserInventoryTestUtils.CreateInventoryFolder(scene.InventoryService, userUuid, "xA");
|
||||||
// archiveReadStream = new MemoryStream(archiveReadStream.ToArray());
|
archiveReadStream = new MemoryStream(archiveReadStream.ToArray());
|
||||||
// archiverModule.DearchiveInventory(userFirstName, userLastName, "xA", "meowfood", archiveReadStream);
|
archiverModule.DearchiveInventory(userFirstName, userLastName, "xA", "meowfood", archiveReadStream);
|
||||||
|
|
||||||
// InventoryItemBase foundItem2
|
InventoryItemBase foundItem2
|
||||||
// = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, userInfo.UserProfile.ID, "xA/" + item1Name);
|
= InventoryArchiveUtils.FindItemByPath(scene.InventoryService, userUuid, "xA/" + item1Name);
|
||||||
// Assert.That(foundItem2, Is.Not.Null, "Didn't find loaded item 2");
|
Assert.That(foundItem2, Is.Not.Null, "Didn't find loaded item 2");
|
||||||
|
|
||||||
// // Now try loading to a more deeply nested folder
|
// Now try loading to a more deeply nested folder
|
||||||
// UserInventoryTestUtils.CreateInventoryFolder(scene.InventoryService, userInfo.UserProfile.ID, "xB/xC");
|
UserInventoryTestUtils.CreateInventoryFolder(scene.InventoryService, userUuid, "xB/xC");
|
||||||
// archiveReadStream = new MemoryStream(archiveReadStream.ToArray());
|
archiveReadStream = new MemoryStream(archiveReadStream.ToArray());
|
||||||
// archiverModule.DearchiveInventory(userFirstName, userLastName, "xB/xC", "meowfood", archiveReadStream);
|
archiverModule.DearchiveInventory(userFirstName, userLastName, "xB/xC", "meowfood", archiveReadStream);
|
||||||
|
|
||||||
// InventoryItemBase foundItem3
|
InventoryItemBase foundItem3
|
||||||
// = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, userInfo.UserProfile.ID, "xB/xC/" + item1Name);
|
= InventoryArchiveUtils.FindItemByPath(scene.InventoryService, userUuid, "xB/xC/" + item1Name);
|
||||||
// Assert.That(foundItem3, Is.Not.Null, "Didn't find loaded item 3");
|
Assert.That(foundItem3, Is.Not.Null, "Didn't find loaded item 3");
|
||||||
//}
|
}
|
||||||
|
|
||||||
// REFACTORING PROBLEM. Needs rewrite.
|
// REFACTORING PROBLEM. Needs rewrite.
|
||||||
// [Test]
|
// [Test]
|
||||||
|
|
Loading…
Reference in New Issue