diff options
author | Justin Clarke Casey | 2009-04-28 17:47:09 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2009-04-28 17:47:09 +0000 |
commit | 52d56288060caca4f92fee9549090390d7053549 (patch) | |
tree | 48836efd21fb682658e12c1bdd785669eeeff84c /OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs | |
parent | Correctly handle group owned land in the Datasnapshot module. Will return (diff) | |
download | opensim-SC_OLD-52d56288060caca4f92fee9549090390d7053549.zip opensim-SC_OLD-52d56288060caca4f92fee9549090390d7053549.tar.gz opensim-SC_OLD-52d56288060caca4f92fee9549090390d7053549.tar.bz2 opensim-SC_OLD-52d56288060caca4f92fee9549090390d7053549.tar.xz |
* Add preliminary code for resolving iar profile names
* Not yet active
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs index 302d214..5ae1cbd 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs | |||
@@ -204,9 +204,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
204 | 204 | ||
205 | string userFirstName = "Mr"; | 205 | string userFirstName = "Mr"; |
206 | string userLastName = "Tiddles"; | 206 | string userLastName = "Tiddles"; |
207 | string folderName = "a"; | 207 | UUID userUuid = UUID.Parse("00000000-0000-0000-0000-000000000555"); |
208 | string archiveFolderName | ||
209 | = string.Format("{0}{1}{2}", folderName, ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR, UUID.Random()); | ||
210 | string itemName = "b.lsl"; | 208 | string itemName = "b.lsl"; |
211 | string archiveItemName | 209 | string archiveItemName |
212 | = string.Format("{0}{1}{2}", itemName, "_", UUID.Random()); | 210 | = string.Format("{0}{1}{2}", itemName, "_", UUID.Random()); |
@@ -218,29 +216,33 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
218 | item1.Name = itemName; | 216 | item1.Name = itemName; |
219 | item1.AssetID = UUID.Random(); | 217 | item1.AssetID = UUID.Random(); |
220 | item1.GroupID = UUID.Random(); | 218 | item1.GroupID = UUID.Random(); |
219 | item1.CreatorId = userUuid.ToString(); | ||
220 | //item1.CreatorId = "00000000-0000-0000-0000-000000000444"; | ||
221 | item1.Owner = UUID.Parse(item1.CreatorId); | ||
221 | 222 | ||
222 | string item1FileName | 223 | string item1FileName |
223 | = string.Format("{0}{1}/{2}", ArchiveConstants.INVENTORY_PATH, archiveFolderName, archiveItemName); | 224 | = string.Format("{0}{1}", ArchiveConstants.INVENTORY_PATH, archiveItemName); |
224 | tar.WriteFile(item1FileName, UserInventoryItemSerializer.Serialize(item1)); | 225 | tar.WriteFile(item1FileName, UserInventoryItemSerializer.Serialize(item1)); |
225 | tar.Close(); | 226 | tar.Close(); |
226 | 227 | ||
227 | MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray()); | 228 | MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray()); |
228 | |||
229 | SerialiserModule serialiserModule = new SerialiserModule(); | 229 | SerialiserModule serialiserModule = new SerialiserModule(); |
230 | InventoryArchiverModule archiverModule = new InventoryArchiverModule(); | 230 | InventoryArchiverModule archiverModule = new InventoryArchiverModule(); |
231 | 231 | ||
232 | // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene | 232 | // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene |
233 | Scene scene = SceneSetupHelpers.SetupScene(); | 233 | Scene scene = SceneSetupHelpers.SetupScene(); |
234 | SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); | 234 | SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); |
235 | scene.CommsManager.UserAdminService.AddUser(userFirstName, userLastName, "meowfood", String.Empty, 1000, 1000); | 235 | scene.CommsManager.UserAdminService.AddUser( |
236 | userFirstName, userLastName, "meowfood", String.Empty, 1000, 1000, userUuid); | ||
236 | archiverModule.DearchiveInventory(userFirstName, userLastName, "/", archiveReadStream); | 237 | archiverModule.DearchiveInventory(userFirstName, userLastName, "/", archiveReadStream); |
237 | 238 | ||
238 | CachedUserInfo userInfo = scene.CommsManager.UserProfileCacheService.GetUserDetails(userFirstName, userLastName); | 239 | CachedUserInfo userInfo |
239 | InventoryFolderImpl foundFolder = userInfo.RootFolder.FindFolderByPath(folderName); | 240 | = scene.CommsManager.UserProfileCacheService.GetUserDetails(userFirstName, userLastName); |
240 | Assert.That(foundFolder, Is.Not.Null, string.Format("Folder {0} not found on load", folderName)); | 241 | InventoryItemBase foundItem = userInfo.RootFolder.FindItemByPath(itemName); |
241 | 242 | ||
242 | InventoryItemBase foundItem = foundFolder.FindItemByPath(itemName); | 243 | // Currently, creator and ownership both revert to the loader |
243 | Assert.That(foundItem, Is.Not.Null, string.Format("Item {0} not found on load", itemName)); | 244 | Assert.That(foundItem.CreatorId, Is.EqualTo(userUuid.ToString())); |
245 | Assert.That(foundItem.Owner, Is.EqualTo(userUuid)); | ||
244 | 246 | ||
245 | Console.WriteLine("Finished TestLoadIarV0p1()"); | 247 | Console.WriteLine("Finished TestLoadIarV0p1()"); |
246 | } | 248 | } |