diff options
author | Michael Cortez | 2009-08-06 09:38:51 -0700 |
---|---|---|
committer | Michael Cortez | 2009-08-06 09:38:51 -0700 |
commit | 2ac04cb624d36c048b6793f9db7c073eb6a01026 (patch) | |
tree | cb76f55c634c9f1107dea7204729497c5ba3bb75 /OpenSim/Region/CoreModules/Avatar/Inventory/Archiver | |
parent | Fixing comments re: INI file. (diff) | |
parent | Add the config-include statement to OpenSim.ini.example. (diff) | |
download | opensim-SC_OLD-2ac04cb624d36c048b6793f9db7c073eb6a01026.zip opensim-SC_OLD-2ac04cb624d36c048b6793f9db7c073eb6a01026.tar.gz opensim-SC_OLD-2ac04cb624d36c048b6793f9db7c073eb6a01026.tar.bz2 opensim-SC_OLD-2ac04cb624d36c048b6793f9db7c073eb6a01026.tar.xz |
Merge branch 'master' into groups-core-contrib
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Inventory/Archiver')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs | 48 |
1 files changed, 31 insertions, 17 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs index dd524f5..14cee36 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs | |||
@@ -66,7 +66,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
66 | /// <summary> | 66 | /// <summary> |
67 | /// Test saving a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet). | 67 | /// Test saving a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet). |
68 | /// </summary> | 68 | /// </summary> |
69 | //[Test] | 69 | [Test] |
70 | public void TestSaveIarV0_1() | 70 | public void TestSaveIarV0_1() |
71 | { | 71 | { |
72 | TestHelper.InMethod(); | 72 | TestHelper.InMethod(); |
@@ -202,19 +202,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
202 | /// Test loading a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet) where | 202 | /// Test loading a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet) where |
203 | /// an account exists with the creator name. | 203 | /// an account exists with the creator name. |
204 | /// </summary> | 204 | /// </summary> |
205 | //[Test] | 205 | [Test] |
206 | public void TestLoadIarV0_1ExistingUsers() | 206 | public void TestLoadIarV0_1ExistingUsers() |
207 | { | 207 | { |
208 | TestHelper.InMethod(); | 208 | TestHelper.InMethod(); |
209 | 209 | ||
210 | //log4net.Config.XmlConfigurator.Configure(); | 210 | log4net.Config.XmlConfigurator.Configure(); |
211 | 211 | ||
212 | string userFirstName = "Mr"; | 212 | string userFirstName = "Mr"; |
213 | string userLastName = "Tiddles"; | 213 | string userLastName = "Tiddles"; |
214 | UUID userUuid = UUID.Parse("00000000-0000-0000-0000-000000000555"); | 214 | UUID userUuid = UUID.Parse("00000000-0000-0000-0000-000000000555"); |
215 | string user2FirstName = "Lord"; | 215 | string userItemCreatorFirstName = "Lord"; |
216 | string user2LastName = "Lucan"; | 216 | string userItemCreatorLastName = "Lucan"; |
217 | UUID user2Uuid = UUID.Parse("00000000-0000-0000-0000-000000000666"); | 217 | UUID userItemCreatorUuid = UUID.Parse("00000000-0000-0000-0000-000000000666"); |
218 | 218 | ||
219 | string itemName = "b.lsl"; | 219 | string itemName = "b.lsl"; |
220 | string archiveItemName | 220 | string archiveItemName |
@@ -227,7 +227,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
227 | item1.Name = itemName; | 227 | item1.Name = itemName; |
228 | item1.AssetID = UUID.Random(); | 228 | item1.AssetID = UUID.Random(); |
229 | item1.GroupID = UUID.Random(); | 229 | item1.GroupID = UUID.Random(); |
230 | item1.CreatorId = OspResolver.MakeOspa(user2FirstName, user2LastName); | 230 | item1.CreatorId = OspResolver.MakeOspa(userItemCreatorFirstName, userItemCreatorLastName); |
231 | //item1.CreatorId = userUuid.ToString(); | 231 | //item1.CreatorId = userUuid.ToString(); |
232 | //item1.CreatorId = "00000000-0000-0000-0000-000000000444"; | 232 | //item1.CreatorId = "00000000-0000-0000-0000-000000000444"; |
233 | item1.Owner = UUID.Zero; | 233 | item1.Owner = UUID.Zero; |
@@ -249,13 +249,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
249 | userAdminService.AddUser( | 249 | userAdminService.AddUser( |
250 | userFirstName, userLastName, "meowfood", String.Empty, 1000, 1000, userUuid); | 250 | userFirstName, userLastName, "meowfood", String.Empty, 1000, 1000, userUuid); |
251 | userAdminService.AddUser( | 251 | userAdminService.AddUser( |
252 | user2FirstName, user2LastName, "hampshire", String.Empty, 1000, 1000, user2Uuid); | 252 | userItemCreatorFirstName, userItemCreatorLastName, "hampshire", |
253 | String.Empty, 1000, 1000, userItemCreatorUuid); | ||
253 | 254 | ||
254 | archiverModule.DearchiveInventory(userFirstName, userLastName, "/", archiveReadStream); | 255 | archiverModule.DearchiveInventory(userFirstName, userLastName, "/", archiveReadStream); |
255 | 256 | ||
256 | CachedUserInfo userInfo | 257 | CachedUserInfo userInfo |
257 | = scene.CommsManager.UserProfileCacheService.GetUserDetails(userFirstName, userLastName); | 258 | = scene.CommsManager.UserProfileCacheService.GetUserDetails(userFirstName, userLastName); |
258 | userInfo.FetchInventory(); | 259 | //userInfo.FetchInventory(); |
260 | /* | ||
259 | for (int i = 0 ; i < 50 ; i++) | 261 | for (int i = 0 ; i < 50 ; i++) |
260 | { | 262 | { |
261 | if (userInfo.HasReceivedInventory == true) | 263 | if (userInfo.HasReceivedInventory == true) |
@@ -263,18 +265,22 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
263 | Thread.Sleep(200); | 265 | Thread.Sleep(200); |
264 | } | 266 | } |
265 | Assert.That(userInfo.HasReceivedInventory, Is.True, "FetchInventory timed out (10 seconds)"); | 267 | Assert.That(userInfo.HasReceivedInventory, Is.True, "FetchInventory timed out (10 seconds)"); |
268 | */ | ||
266 | InventoryItemBase foundItem = userInfo.RootFolder.FindItemByPath(itemName); | 269 | InventoryItemBase foundItem = userInfo.RootFolder.FindItemByPath(itemName); |
267 | Assert.That(foundItem, Is.Not.Null); | 270 | Assert.That(foundItem, Is.Not.Null, "Didn't find loaded item"); |
268 | Assert.That(foundItem.CreatorId, Is.EqualTo(item1.CreatorId)); | 271 | Assert.That( |
269 | Assert.That(foundItem.CreatorIdAsUuid, Is.EqualTo(user2Uuid)); | 272 | foundItem.CreatorId, Is.EqualTo(item1.CreatorId), |
270 | Assert.That(foundItem.Owner, Is.EqualTo(userUuid)); | 273 | "Loaded item non-uuid creator doesn't match original"); |
271 | 274 | Assert.That( | |
272 | Console.WriteLine("Successfully completed {0}", MethodBase.GetCurrentMethod()); | 275 | foundItem.CreatorIdAsUuid, Is.EqualTo(userItemCreatorUuid), |
276 | "Loaded item uuid creator doesn't match original"); | ||
277 | Assert.That(foundItem.Owner, Is.EqualTo(userUuid), | ||
278 | "Loaded item owner doesn't match inventory reciever"); | ||
273 | } | 279 | } |
274 | 280 | ||
275 | /// <summary> | 281 | /// <summary> |
276 | /// Test loading a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet) where | 282 | /// Test loading a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet) where |
277 | /// no account exists with the creator name | 283 | /// no account exists with the creator name |
278 | /// </summary> | 284 | /// </summary> |
279 | //[Test] | 285 | //[Test] |
280 | public void TestLoadIarV0_1TempProfiles() | 286 | public void TestLoadIarV0_1TempProfiles() |
@@ -362,6 +368,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
362 | 368 | ||
363 | CachedUserInfo userInfo = UserProfileTestUtils.CreateUserWithInventory(commsManager); | 369 | CachedUserInfo userInfo = UserProfileTestUtils.CreateUserWithInventory(commsManager); |
364 | userInfo.FetchInventory(); | 370 | userInfo.FetchInventory(); |
371 | /* | ||
365 | for (int i = 0 ; i < 50 ; i++) | 372 | for (int i = 0 ; i < 50 ; i++) |
366 | { | 373 | { |
367 | if (userInfo.HasReceivedInventory == true) | 374 | if (userInfo.HasReceivedInventory == true) |
@@ -369,6 +376,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
369 | Thread.Sleep(200); | 376 | Thread.Sleep(200); |
370 | } | 377 | } |
371 | Assert.That(userInfo.HasReceivedInventory, Is.True, "FetchInventory timed out (10 seconds)"); | 378 | Assert.That(userInfo.HasReceivedInventory, Is.True, "FetchInventory timed out (10 seconds)"); |
379 | */ | ||
380 | |||
381 | Console.WriteLine("userInfo.RootFolder 1: {0}", userInfo.RootFolder); | ||
382 | |||
372 | Dictionary <string, InventoryFolderImpl> foldersCreated = new Dictionary<string, InventoryFolderImpl>(); | 383 | Dictionary <string, InventoryFolderImpl> foldersCreated = new Dictionary<string, InventoryFolderImpl>(); |
373 | List<InventoryNodeBase> nodesLoaded = new List<InventoryNodeBase>(); | 384 | List<InventoryNodeBase> nodesLoaded = new List<InventoryNodeBase>(); |
374 | 385 | ||
@@ -386,10 +397,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
386 | = string.Format( | 397 | = string.Format( |
387 | "{0}{1}/{2}/{3}", | 398 | "{0}{1}/{2}/{3}", |
388 | ArchiveConstants.INVENTORY_PATH, folder1ArchiveName, folder2ArchiveName, itemName); | 399 | ArchiveConstants.INVENTORY_PATH, folder1ArchiveName, folder2ArchiveName, itemName); |
400 | |||
401 | Console.WriteLine("userInfo.RootFolder 2: {0}", userInfo.RootFolder); | ||
389 | 402 | ||
390 | new InventoryArchiveReadRequest(userInfo, null, (Stream)null, null, null) | 403 | new InventoryArchiveReadRequest(userInfo, null, (Stream)null, null, null) |
391 | .ReplicateArchivePathToUserInventory(itemArchivePath, false, userInfo.RootFolder, foldersCreated, nodesLoaded); | 404 | .ReplicateArchivePathToUserInventory(itemArchivePath, false, userInfo.RootFolder, foldersCreated, nodesLoaded); |
392 | 405 | ||
406 | Console.WriteLine("userInfo.RootFolder 3: {0}", userInfo.RootFolder); | ||
393 | InventoryFolderImpl folder1 = userInfo.RootFolder.FindFolderByPath("a"); | 407 | InventoryFolderImpl folder1 = userInfo.RootFolder.FindFolderByPath("a"); |
394 | Assert.That(folder1, Is.Not.Null, "Could not find folder a"); | 408 | Assert.That(folder1, Is.Not.Null, "Could not find folder a"); |
395 | InventoryFolderImpl folder2 = folder1.FindFolderByPath("b"); | 409 | InventoryFolderImpl folder2 = folder1.FindFolderByPath("b"); |