diff options
author | Justin Clark-Casey (justincc) | 2011-03-10 00:06:32 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-03-10 00:06:32 +0000 |
commit | 549b0ea17ced61af995984bf8c155477bf9d624b (patch) | |
tree | 1301df774f92bc52dcb70adf3d580f22d16045dc /OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs | |
parent | Make the item created in the default test iar an object rather than a script (diff) | |
download | opensim-SC_OLD-549b0ea17ced61af995984bf8c155477bf9d624b.zip opensim-SC_OLD-549b0ea17ced61af995984bf8c155477bf9d624b.tar.gz opensim-SC_OLD-549b0ea17ced61af995984bf8c155477bf9d624b.tar.bz2 opensim-SC_OLD-549b0ea17ced61af995984bf8c155477bf9d624b.tar.xz |
Split the inventory path testing parts of TestLoadIarV0_1ExistingUsers() into a new test TestLoadIarToInventoryPaths()
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs | 47 |
1 files changed, 46 insertions, 1 deletions
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(); |