aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs7
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs36
2 files changed, 40 insertions, 3 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
index 694b887..13b1f5a 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
@@ -30,6 +30,7 @@ using System.Collections.Generic;
30using System.IO; 30using System.IO;
31using System.IO.Compression; 31using System.IO.Compression;
32using System.Reflection; 32using System.Reflection;
33using System.Threading;
33using System.Text; 34using System.Text;
34using System.Xml; 35using System.Xml;
35using log4net; 36using log4net;
@@ -116,6 +117,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
116 else 117 else
117 { 118 {
118 m_userInfo.FetchInventory(); 119 m_userInfo.FetchInventory();
120 for (int i = 0 ; i < 50 ; i++)
121 {
122 if (m_userInfo.HasReceivedInventory == true)
123 break;
124 Thread.Sleep(200);
125 }
119 } 126 }
120 } 127 }
121 128
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
index 1e300f5..dd524f5 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
@@ -85,7 +85,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
85 cm.UserAdminService.AddUser(userFirstName, userLastName, string.Empty, string.Empty, 1000, 1000, userId); 85 cm.UserAdminService.AddUser(userFirstName, userLastName, string.Empty, string.Empty, 1000, 1000, userId);
86 CachedUserInfo userInfo = cm.UserProfileCacheService.GetUserDetails(userId); 86 CachedUserInfo userInfo = cm.UserProfileCacheService.GetUserDetails(userId);
87 userInfo.FetchInventory(); 87 userInfo.FetchInventory();
88 while (!userInfo.HasReceivedInventory){ }; 88 for (int i = 0 ; i < 50 ; i++)
89 {
90 if (userInfo.HasReceivedInventory == true)
91 break;
92 Thread.Sleep(200);
93 }
94 Assert.That(userInfo.HasReceivedInventory, Is.True, "FetchInventory timed out (10 seconds)");
89 95
90 // Create asset 96 // Create asset
91 SceneObjectGroup object1; 97 SceneObjectGroup object1;
@@ -248,9 +254,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
248 archiverModule.DearchiveInventory(userFirstName, userLastName, "/", archiveReadStream); 254 archiverModule.DearchiveInventory(userFirstName, userLastName, "/", archiveReadStream);
249 255
250 CachedUserInfo userInfo 256 CachedUserInfo userInfo
251 = scene.CommsManager.UserProfileCacheService.GetUserDetails(userFirstName, userLastName); 257 = scene.CommsManager.UserProfileCacheService.GetUserDetails(userFirstName, userLastName);
258 userInfo.FetchInventory();
259 for (int i = 0 ; i < 50 ; i++)
260 {
261 if (userInfo.HasReceivedInventory == true)
262 break;
263 Thread.Sleep(200);
264 }
265 Assert.That(userInfo.HasReceivedInventory, Is.True, "FetchInventory timed out (10 seconds)");
252 InventoryItemBase foundItem = userInfo.RootFolder.FindItemByPath(itemName); 266 InventoryItemBase foundItem = userInfo.RootFolder.FindItemByPath(itemName);
253 267 Assert.That(foundItem, Is.Not.Null);
254 Assert.That(foundItem.CreatorId, Is.EqualTo(item1.CreatorId)); 268 Assert.That(foundItem.CreatorId, Is.EqualTo(item1.CreatorId));
255 Assert.That(foundItem.CreatorIdAsUuid, Is.EqualTo(user2Uuid)); 269 Assert.That(foundItem.CreatorIdAsUuid, Is.EqualTo(user2Uuid));
256 Assert.That(foundItem.Owner, Is.EqualTo(userUuid)); 270 Assert.That(foundItem.Owner, Is.EqualTo(userUuid));
@@ -318,6 +332,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
318 332
319 CachedUserInfo userInfo 333 CachedUserInfo userInfo
320 = scene.CommsManager.UserProfileCacheService.GetUserDetails(userFirstName, userLastName); 334 = scene.CommsManager.UserProfileCacheService.GetUserDetails(userFirstName, userLastName);
335 userInfo.FetchInventory();
336 for (int i = 0 ; i < 50 ; i++)
337 {
338 if (userInfo.HasReceivedInventory == true)
339 break;
340 Thread.Sleep(200);
341 }
342 Assert.That(userInfo.HasReceivedInventory, Is.True, "FetchInventory timed out (10 seconds)");
321 InventoryItemBase foundItem = userInfo.RootFolder.FindItemByPath(itemName); 343 InventoryItemBase foundItem = userInfo.RootFolder.FindItemByPath(itemName);
322 344
323 Assert.That(foundItem.CreatorId, Is.EqualTo(item1.CreatorId)); 345 Assert.That(foundItem.CreatorId, Is.EqualTo(item1.CreatorId));
@@ -339,6 +361,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
339 CommunicationsManager commsManager = scene.CommsManager; 361 CommunicationsManager commsManager = scene.CommsManager;
340 362
341 CachedUserInfo userInfo = UserProfileTestUtils.CreateUserWithInventory(commsManager); 363 CachedUserInfo userInfo = UserProfileTestUtils.CreateUserWithInventory(commsManager);
364 userInfo.FetchInventory();
365 for (int i = 0 ; i < 50 ; i++)
366 {
367 if (userInfo.HasReceivedInventory == true)
368 break;
369 Thread.Sleep(200);
370 }
371 Assert.That(userInfo.HasReceivedInventory, Is.True, "FetchInventory timed out (10 seconds)");
342 Dictionary <string, InventoryFolderImpl> foldersCreated = new Dictionary<string, InventoryFolderImpl>(); 372 Dictionary <string, InventoryFolderImpl> foldersCreated = new Dictionary<string, InventoryFolderImpl>();
343 List<InventoryNodeBase> nodesLoaded = new List<InventoryNodeBase>(); 373 List<InventoryNodeBase> nodesLoaded = new List<InventoryNodeBase>();
344 374