aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2009-09-06 19:30:03 +0100
committerJustin Clark-Casey (justincc)2009-09-06 19:30:03 +0100
commit304c78bbbbc9a176d70d2967a3f703f2e545565c (patch)
tree09f6e89a31ac9e10ddd1848c929d57d593de08ed /OpenSim/Region
parentAdd ids to iar requests (diff)
downloadopensim-SC_OLD-304c78bbbbc9a176d70d2967a3f703f2e545565c.zip
opensim-SC_OLD-304c78bbbbc9a176d70d2967a3f703f2e545565c.tar.gz
opensim-SC_OLD-304c78bbbbc9a176d70d2967a3f703f2e545565c.tar.bz2
opensim-SC_OLD-304c78bbbbc9a176d70d2967a3f703f2e545565c.tar.xz
Temporarily re-enable save iar test by manually insert the item into the old cache during the test
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs7
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs15
2 files changed, 17 insertions, 5 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);