aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs7
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs15
-rw-r--r--OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs8
3 files changed, 24 insertions, 6 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
index 18728c6..6653516 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
@@ -207,6 +207,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
207 InventoryFolderImpl inventoryFolder = null; 207 InventoryFolderImpl inventoryFolder = null;
208 InventoryItemBase inventoryItem = null; 208 InventoryItemBase inventoryItem = null;
209 209
210 // XXX: Very temporarily, drop and refetch inventory to make sure we have any newly created items in cache
211 // This will disappear very soon once we stop using the old cached inventory.
212 /*
213 m_userInfo.DropInventory();
214 m_userInfo.FetchInventory();
215 */
216
210 if (!m_userInfo.HasReceivedInventory) 217 if (!m_userInfo.HasReceivedInventory)
211 { 218 {
212 // If the region server has access to the user admin service (by which users are created), 219 // If the region server has access to the user admin service (by which users are created),
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
index a151c9d..2ad6f1a 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
@@ -77,7 +77,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
77 /// </summary> 77 /// </summary>
78 // Commenting for now! The mock inventory service needs more beef, at least for 78 // Commenting for now! The mock inventory service needs more beef, at least for
79 // GetFolderForType 79 // GetFolderForType
80 //[Test] 80 [Test]
81 public void TestSaveIarV0_1() 81 public void TestSaveIarV0_1()
82 { 82 {
83 TestHelper.InMethod(); 83 TestHelper.InMethod();
@@ -93,11 +93,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
93 string userFirstName = "Jock"; 93 string userFirstName = "Jock";
94 string userLastName = "Stirrup"; 94 string userLastName = "Stirrup";
95 UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000020"); 95 UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000020");
96 // CachedUserInfo userInfo; 96 CachedUserInfo userInfo;
97 97
98 lock (this) 98 lock (this)
99 { 99 {
100 UserProfileTestUtils.CreateUserWithInventory( 100 userInfo = UserProfileTestUtils.CreateUserWithInventory(
101 cm, userFirstName, userLastName, userId, InventoryReceived); 101 cm, userFirstName, userLastName, userId, InventoryReceived);
102 Monitor.Wait(this, 60000); 102 Monitor.Wait(this, 60000);
103 } 103 }
@@ -136,18 +136,23 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
136 item1.Name = "My Little Dog"; 136 item1.Name = "My Little Dog";
137 item1.AssetID = asset1.FullID; 137 item1.AssetID = asset1.FullID;
138 item1.ID = item1Id; 138 item1.ID = item1Id;
139 //userInfo.RootFolder.FindFolderByPath("Objects").ID; 139 InventoryFolderImpl objsFolder = userInfo.RootFolder.FindFolderByPath("Objects");
140 //InventoryFolderBase objsFolder = scene.InventoryService.GetFolderForType(userId, AssetType.Object); 140 //InventoryFolderBase objsFolder = scene.InventoryService.GetFolderForType(userId, AssetType.Object);
141 Console.WriteLine("here2"); 141 Console.WriteLine("here2");
142 /*
142 IInventoryService inventoryService = scene.InventoryService; 143 IInventoryService inventoryService = scene.InventoryService;
143 InventoryFolderBase rootFolder = inventoryService.GetRootFolder(userId); 144 InventoryFolderBase rootFolder = inventoryService.GetRootFolder(userId);
144 InventoryCollection rootContents = inventoryService.GetFolderContent(userId, rootFolder.ID); 145 InventoryCollection rootContents = inventoryService.GetFolderContent(userId, rootFolder.ID);
146 */
147 /*
145 InventoryFolderBase objsFolder = null; 148 InventoryFolderBase objsFolder = null;
146 foreach (InventoryFolderBase folder in rootContents.Folders) 149 foreach (InventoryFolderBase folder in rootContents.Folders)
147 if (folder.Name == "Objects") 150 if (folder.Name == "Objects")
148 objsFolder = folder; 151 objsFolder = folder;
152 */
149 item1.Folder = objsFolder.ID; 153 item1.Folder = objsFolder.ID;
150 scene.AddInventoryItem(userId, item1); 154 scene.AddInventoryItem(userId, item1);
155 userInfo.AddItem(item1);
151 156
152 MemoryStream archiveWriteStream = new MemoryStream(); 157 MemoryStream archiveWriteStream = new MemoryStream();
153 archiverModule.OnInventoryArchiveSaved += SaveCompleted; 158 archiverModule.OnInventoryArchiveSaved += SaveCompleted;
@@ -155,7 +160,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
155 mre.Reset(); 160 mre.Reset();
156 archiverModule.ArchiveInventory( 161 archiverModule.ArchiveInventory(
157 Guid.NewGuid(), userFirstName, userLastName, "Objects", archiveWriteStream); 162 Guid.NewGuid(), userFirstName, userLastName, "Objects", archiveWriteStream);
158 mre.WaitOne(); 163 mre.WaitOne(60000, false);
159 164
160 byte[] archive = archiveWriteStream.ToArray(); 165 byte[] archive = archiveWriteStream.ToArray();
161 MemoryStream archiveReadStream = new MemoryStream(archive); 166 MemoryStream archiveReadStream = new MemoryStream(archive);
diff --git a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs
index ce116f2..a444d91 100644
--- a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs
+++ b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs
@@ -154,7 +154,13 @@ namespace OpenSim.Tests.Common.Mock
154 m_folders.Remove(folderId); 154 m_folders.Remove(folderId);
155 } 155 }
156 156
157 public void addInventoryItem(InventoryItemBase item) { m_items[item.ID] = item; } 157 public void addInventoryItem(InventoryItemBase item)
158 {
159 m_log.DebugFormat(
160 "[MOCK INV DB]: Adding inventory item {0} {1} in {2}", item.Name, item.ID, item.Folder);
161
162 m_items[item.ID] = item;
163 }
158 164
159 public void updateInventoryItem(InventoryItemBase item) { addInventoryItem(item); } 165 public void updateInventoryItem(InventoryItemBase item) { addInventoryItem(item); }
160 166