diff options
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs | 22 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs | 47 |
2 files changed, 46 insertions, 23 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs index 67d7159..5f75c4a 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs | |||
@@ -172,8 +172,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
172 | /// Test loading a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet) where | 172 | /// Test loading a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet) where |
173 | /// an account exists with the creator name. | 173 | /// an account exists with the creator name. |
174 | /// </summary> | 174 | /// </summary> |
175 | /// | ||
176 | /// This test also does some deeper probing of loading into nested inventory structures | ||
177 | [Test] | 175 | [Test] |
178 | public void TestLoadIarV0_1ExistingUsers() | 176 | public void TestLoadIarV0_1ExistingUsers() |
179 | { | 177 | { |
@@ -194,8 +192,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
194 | archiverModule.DearchiveInventory(m_ua1.FirstName, m_ua1.LastName, "/", "meowfood", m_iarStream); | 192 | archiverModule.DearchiveInventory(m_ua1.FirstName, m_ua1.LastName, "/", "meowfood", m_iarStream); |
195 | InventoryItemBase foundItem1 | 193 | InventoryItemBase foundItem1 |
196 | = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, m_ua1.PrincipalID, m_item1Name); | 194 | = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, m_ua1.PrincipalID, m_item1Name); |
197 | |||
198 | Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1"); | ||
199 | 195 | ||
200 | // We have to disable this check since loaded items that did find users via OSPA resolution are now only storing the | 196 | // We have to disable this check since loaded items that did find users via OSPA resolution are now only storing the |
201 | // UUID, not the OSPA itself. | 197 | // UUID, not the OSPA itself. |
@@ -211,24 +207,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
211 | "Loaded item uuid creator doesn't match original"); | 207 | "Loaded item uuid creator doesn't match original"); |
212 | Assert.That(foundItem1.Owner, Is.EqualTo(m_ua1.PrincipalID), | 208 | Assert.That(foundItem1.Owner, Is.EqualTo(m_ua1.PrincipalID), |
213 | "Loaded item owner doesn't match inventory reciever"); | 209 | "Loaded item owner doesn't match inventory reciever"); |
214 | |||
215 | // Now try loading to a root child folder | ||
216 | UserInventoryTestUtils.CreateInventoryFolder(scene.InventoryService, m_ua1.PrincipalID, "xA"); | ||
217 | MemoryStream archiveReadStream = new MemoryStream(m_iarStream.ToArray()); | ||
218 | archiverModule.DearchiveInventory(m_ua1.FirstName, m_ua1.LastName, "xA", "meowfood", archiveReadStream); | ||
219 | |||
220 | InventoryItemBase foundItem2 | ||
221 | = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, m_ua1.PrincipalID, "xA/" + m_item1Name); | ||
222 | Assert.That(foundItem2, Is.Not.Null, "Didn't find loaded item 2"); | ||
223 | |||
224 | // Now try loading to a more deeply nested folder | ||
225 | UserInventoryTestUtils.CreateInventoryFolder(scene.InventoryService, m_ua1.PrincipalID, "xB/xC"); | ||
226 | archiveReadStream = new MemoryStream(archiveReadStream.ToArray()); | ||
227 | archiverModule.DearchiveInventory(m_ua1.FirstName, m_ua1.LastName, "xB/xC", "meowfood", archiveReadStream); | ||
228 | |||
229 | InventoryItemBase foundItem3 | ||
230 | = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, m_ua1.PrincipalID, "xB/xC/" + m_item1Name); | ||
231 | Assert.That(foundItem3, Is.Not.Null, "Didn't find loaded item 3"); | ||
232 | } | 210 | } |
233 | 211 | ||
234 | /// <summary> | 212 | /// <summary> |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs index 4b7de0c..1220a70 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs | |||
@@ -170,6 +170,51 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
170 | } | 170 | } |
171 | 171 | ||
172 | /// <summary> | 172 | /// <summary> |
173 | /// Test loading an IAR to various different inventory paths. | ||
174 | /// </summary> | ||
175 | [Test] | ||
176 | public void TestLoadIarToInventoryPaths() | ||
177 | { | ||
178 | TestHelper.InMethod(); | ||
179 | // log4net.Config.XmlConfigurator.Configure(); | ||
180 | |||
181 | SerialiserModule serialiserModule = new SerialiserModule(); | ||
182 | InventoryArchiverModule archiverModule = new InventoryArchiverModule(); | ||
183 | |||
184 | // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene | ||
185 | Scene scene = SceneSetupHelpers.SetupScene("inventory"); | ||
186 | |||
187 | SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); | ||
188 | |||
189 | UserProfileTestUtils.CreateUserWithInventory(scene, m_ua1, "meowfood"); | ||
190 | UserProfileTestUtils.CreateUserWithInventory(scene, m_ua2, "hampshire"); | ||
191 | |||
192 | archiverModule.DearchiveInventory(m_ua1.FirstName, m_ua1.LastName, "/", "meowfood", m_iarStream); | ||
193 | InventoryItemBase foundItem1 | ||
194 | = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, m_ua1.PrincipalID, m_item1Name); | ||
195 | |||
196 | Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1"); | ||
197 | |||
198 | // Now try loading to a root child folder | ||
199 | UserInventoryTestUtils.CreateInventoryFolder(scene.InventoryService, m_ua1.PrincipalID, "xA"); | ||
200 | MemoryStream archiveReadStream = new MemoryStream(m_iarStream.ToArray()); | ||
201 | archiverModule.DearchiveInventory(m_ua1.FirstName, m_ua1.LastName, "xA", "meowfood", archiveReadStream); | ||
202 | |||
203 | InventoryItemBase foundItem2 | ||
204 | = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, m_ua1.PrincipalID, "xA/" + m_item1Name); | ||
205 | Assert.That(foundItem2, Is.Not.Null, "Didn't find loaded item 2"); | ||
206 | |||
207 | // Now try loading to a more deeply nested folder | ||
208 | UserInventoryTestUtils.CreateInventoryFolder(scene.InventoryService, m_ua1.PrincipalID, "xB/xC"); | ||
209 | archiveReadStream = new MemoryStream(archiveReadStream.ToArray()); | ||
210 | archiverModule.DearchiveInventory(m_ua1.FirstName, m_ua1.LastName, "xB/xC", "meowfood", archiveReadStream); | ||
211 | |||
212 | InventoryItemBase foundItem3 | ||
213 | = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, m_ua1.PrincipalID, "xB/xC/" + m_item1Name); | ||
214 | Assert.That(foundItem3, Is.Not.Null, "Didn't find loaded item 3"); | ||
215 | } | ||
216 | |||
217 | /// <summary> | ||
173 | /// Test that things work when the load path specified starts with a slash | 218 | /// Test that things work when the load path specified starts with a slash |
174 | /// </summary> | 219 | /// </summary> |
175 | [Test] | 220 | [Test] |
@@ -194,7 +239,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
194 | } | 239 | } |
195 | 240 | ||
196 | [Test] | 241 | [Test] |
197 | public void TestIarV0_1WithEscapedChars() | 242 | public void TestLoadIarPathWithEscapedChars() |
198 | { | 243 | { |
199 | TestHelper.InMethod(); | 244 | TestHelper.InMethod(); |
200 | // log4net.Config.XmlConfigurator.Configure(); | 245 | // log4net.Config.XmlConfigurator.Configure(); |