diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadPathTests.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadPathTests.cs | 120 |
1 files changed, 60 insertions, 60 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadPathTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadPathTests.cs index c2e645f..86eca17 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadPathTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadPathTests.cs | |||
@@ -56,23 +56,23 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
56 | { | 56 | { |
57 | TestHelpers.InMethod(); | 57 | TestHelpers.InMethod(); |
58 | // log4net.Config.XmlConfigurator.Configure(); | 58 | // log4net.Config.XmlConfigurator.Configure(); |
59 | 59 | ||
60 | SerialiserModule serialiserModule = new SerialiserModule(); | 60 | SerialiserModule serialiserModule = new SerialiserModule(); |
61 | InventoryArchiverModule archiverModule = new InventoryArchiverModule(); | 61 | InventoryArchiverModule archiverModule = new InventoryArchiverModule(); |
62 | 62 | ||
63 | // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene | 63 | // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene |
64 | Scene scene = new SceneHelpers().SetupScene(); | 64 | Scene scene = new SceneHelpers().SetupScene(); |
65 | 65 | ||
66 | SceneHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); | 66 | SceneHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); |
67 | 67 | ||
68 | UserAccountHelpers.CreateUserWithInventory(scene, m_uaMT, "meowfood"); | 68 | UserAccountHelpers.CreateUserWithInventory(scene, m_uaMT, "meowfood"); |
69 | UserAccountHelpers.CreateUserWithInventory(scene, m_uaLL1, "hampshire"); | 69 | UserAccountHelpers.CreateUserWithInventory(scene, m_uaLL1, "hampshire"); |
70 | 70 | ||
71 | archiverModule.DearchiveInventory(UUID.Random(), m_uaMT.FirstName, m_uaMT.LastName, "/", "meowfood", m_iarStream); | 71 | archiverModule.DearchiveInventory(UUID.Random(), m_uaMT.FirstName, m_uaMT.LastName, "/", "meowfood", m_iarStream); |
72 | InventoryItemBase foundItem1 | 72 | InventoryItemBase foundItem1 |
73 | = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, m_uaMT.PrincipalID, m_item1Name); | 73 | = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, m_uaMT.PrincipalID, m_item1Name); |
74 | 74 | ||
75 | Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1"); | 75 | Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1"); |
76 | 76 | ||
77 | // Now try loading to a root child folder | 77 | // Now try loading to a root child folder |
78 | UserInventoryHelpers.CreateInventoryFolder(scene.InventoryService, m_uaMT.PrincipalID, "xA", false); | 78 | UserInventoryHelpers.CreateInventoryFolder(scene.InventoryService, m_uaMT.PrincipalID, "xA", false); |
@@ -90,9 +90,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
90 | 90 | ||
91 | InventoryItemBase foundItem3 | 91 | InventoryItemBase foundItem3 |
92 | = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, m_uaMT.PrincipalID, "xB/xC/" + m_item1Name); | 92 | = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, m_uaMT.PrincipalID, "xB/xC/" + m_item1Name); |
93 | Assert.That(foundItem3, Is.Not.Null, "Didn't find loaded item 3"); | 93 | Assert.That(foundItem3, Is.Not.Null, "Didn't find loaded item 3"); |
94 | } | 94 | } |
95 | 95 | ||
96 | /// <summary> | 96 | /// <summary> |
97 | /// Test that things work when the load path specified starts with a slash | 97 | /// Test that things work when the load path specified starts with a slash |
98 | /// </summary> | 98 | /// </summary> |
@@ -101,22 +101,22 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
101 | { | 101 | { |
102 | TestHelpers.InMethod(); | 102 | TestHelpers.InMethod(); |
103 | // log4net.Config.XmlConfigurator.Configure(); | 103 | // log4net.Config.XmlConfigurator.Configure(); |
104 | 104 | ||
105 | SerialiserModule serialiserModule = new SerialiserModule(); | 105 | SerialiserModule serialiserModule = new SerialiserModule(); |
106 | InventoryArchiverModule archiverModule = new InventoryArchiverModule(); | 106 | InventoryArchiverModule archiverModule = new InventoryArchiverModule(); |
107 | Scene scene = new SceneHelpers().SetupScene(); | 107 | Scene scene = new SceneHelpers().SetupScene(); |
108 | SceneHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); | 108 | SceneHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); |
109 | 109 | ||
110 | UserAccountHelpers.CreateUserWithInventory(scene, m_uaMT, "password"); | 110 | UserAccountHelpers.CreateUserWithInventory(scene, m_uaMT, "password"); |
111 | archiverModule.DearchiveInventory(UUID.Random(), m_uaMT.FirstName, m_uaMT.LastName, "/Objects", "password", m_iarStream); | 111 | archiverModule.DearchiveInventory(UUID.Random(), m_uaMT.FirstName, m_uaMT.LastName, "/Objects", "password", m_iarStream); |
112 | 112 | ||
113 | InventoryItemBase foundItem1 | 113 | InventoryItemBase foundItem1 |
114 | = InventoryArchiveUtils.FindItemByPath( | 114 | = InventoryArchiveUtils.FindItemByPath( |
115 | scene.InventoryService, m_uaMT.PrincipalID, "/Objects/" + m_item1Name); | 115 | scene.InventoryService, m_uaMT.PrincipalID, "/Objects/" + m_item1Name); |
116 | 116 | ||
117 | Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1 in TestLoadIarFolderStartsWithSlash()"); | 117 | Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1 in TestLoadIarFolderStartsWithSlash()"); |
118 | } | 118 | } |
119 | 119 | ||
120 | [Test] | 120 | [Test] |
121 | public void TestLoadIarPathWithEscapedChars() | 121 | public void TestLoadIarPathWithEscapedChars() |
122 | { | 122 | { |
@@ -137,7 +137,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
137 | string userLastName = "Stirrup"; | 137 | string userLastName = "Stirrup"; |
138 | UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000020"); | 138 | UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000020"); |
139 | UserAccountHelpers.CreateUserWithInventory(scene, userFirstName, userLastName, userId, "meowfood"); | 139 | UserAccountHelpers.CreateUserWithInventory(scene, userFirstName, userLastName, userId, "meowfood"); |
140 | 140 | ||
141 | // Create asset | 141 | // Create asset |
142 | SceneObjectGroup object1; | 142 | SceneObjectGroup object1; |
143 | SceneObjectPart part1; | 143 | SceneObjectPart part1; |
@@ -168,7 +168,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
168 | item1.Name = itemName; | 168 | item1.Name = itemName; |
169 | item1.AssetID = asset1.FullID; | 169 | item1.AssetID = asset1.FullID; |
170 | item1.ID = item1Id; | 170 | item1.ID = item1Id; |
171 | InventoryFolderBase objsFolder | 171 | InventoryFolderBase objsFolder |
172 | = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, userId, "Objects")[0]; | 172 | = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, userId, "Objects")[0]; |
173 | item1.Folder = objsFolder.ID; | 173 | item1.Folder = objsFolder.ID; |
174 | scene.AddInventoryItem(item1); | 174 | scene.AddInventoryItem(item1); |
@@ -189,16 +189,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
189 | InventoryItemBase foundItem1 | 189 | InventoryItemBase foundItem1 |
190 | = InventoryArchiveUtils.FindItemByPath( | 190 | = InventoryArchiveUtils.FindItemByPath( |
191 | scene.InventoryService, userId, "Scripts/Objects/" + humanEscapedItemName); | 191 | scene.InventoryService, userId, "Scripts/Objects/" + humanEscapedItemName); |
192 | 192 | ||
193 | Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1"); | 193 | Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1"); |
194 | // Assert.That( | 194 | // Assert.That( |
195 | // foundItem1.CreatorId, Is.EqualTo(userUuid), | 195 | // foundItem1.CreatorId, Is.EqualTo(userUuid), |
196 | // "Loaded item non-uuid creator doesn't match that of the loading user"); | 196 | // "Loaded item non-uuid creator doesn't match that of the loading user"); |
197 | Assert.That( | 197 | Assert.That( |
198 | foundItem1.Name, Is.EqualTo(itemName), | 198 | foundItem1.Name, Is.EqualTo(itemName), |
199 | "Loaded item name doesn't match saved name"); | 199 | "Loaded item name doesn't match saved name"); |
200 | } | 200 | } |
201 | 201 | ||
202 | /// <summary> | 202 | /// <summary> |
203 | /// Test replication of an archive path to the user's inventory. | 203 | /// Test replication of an archive path to the user's inventory. |
204 | /// </summary> | 204 | /// </summary> |
@@ -207,21 +207,21 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
207 | { | 207 | { |
208 | TestHelpers.InMethod(); | 208 | TestHelpers.InMethod(); |
209 | // log4net.Config.XmlConfigurator.Configure(); | 209 | // log4net.Config.XmlConfigurator.Configure(); |
210 | 210 | ||
211 | Scene scene = new SceneHelpers().SetupScene(); | 211 | Scene scene = new SceneHelpers().SetupScene(); |
212 | UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene); | 212 | UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene); |
213 | 213 | ||
214 | Dictionary <string, InventoryFolderBase> foldersCreated = new Dictionary<string, InventoryFolderBase>(); | 214 | Dictionary <string, InventoryFolderBase> foldersCreated = new Dictionary<string, InventoryFolderBase>(); |
215 | HashSet<InventoryNodeBase> nodesLoaded = new HashSet<InventoryNodeBase>(); | 215 | Dictionary<UUID, InventoryNodeBase> nodesLoaded = new Dictionary<UUID, InventoryNodeBase>(); |
216 | 216 | ||
217 | string folder1Name = "1"; | 217 | string folder1Name = "1"; |
218 | string folder2aName = "2a"; | 218 | string folder2aName = "2a"; |
219 | string folder2bName = "2b"; | 219 | string folder2bName = "2b"; |
220 | 220 | ||
221 | string folder1ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder1Name, UUID.Random()); | 221 | string folder1ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder1Name, UUID.Random()); |
222 | string folder2aArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder2aName, UUID.Random()); | 222 | string folder2aArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder2aName, UUID.Random()); |
223 | string folder2bArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder2bName, UUID.Random()); | 223 | string folder2bArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder2bName, UUID.Random()); |
224 | 224 | ||
225 | string iarPath1 = string.Join("", new string[] { folder1ArchiveName, folder2aArchiveName }); | 225 | string iarPath1 = string.Join("", new string[] { folder1ArchiveName, folder2aArchiveName }); |
226 | string iarPath2 = string.Join("", new string[] { folder1ArchiveName, folder2bArchiveName }); | 226 | string iarPath2 = string.Join("", new string[] { folder1ArchiveName, folder2bArchiveName }); |
227 | 227 | ||
@@ -229,42 +229,42 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
229 | // Test replication of path1 | 229 | // Test replication of path1 |
230 | new InventoryArchiveReadRequest(UUID.Random(), null, scene.InventoryService, scene.AssetService, scene.UserAccountService, ua1, null, (Stream)null, false) | 230 | new InventoryArchiveReadRequest(UUID.Random(), null, scene.InventoryService, scene.AssetService, scene.UserAccountService, ua1, null, (Stream)null, false) |
231 | .ReplicateArchivePathToUserInventory( | 231 | .ReplicateArchivePathToUserInventory( |
232 | iarPath1, scene.InventoryService.GetRootFolder(ua1.PrincipalID), | 232 | iarPath1, scene.InventoryService.GetRootFolder(ua1.PrincipalID), |
233 | foldersCreated, nodesLoaded); | 233 | foldersCreated, nodesLoaded); |
234 | 234 | ||
235 | List<InventoryFolderBase> folder1Candidates | 235 | List<InventoryFolderBase> folder1Candidates |
236 | = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, ua1.PrincipalID, folder1Name); | 236 | = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, ua1.PrincipalID, folder1Name); |
237 | Assert.That(folder1Candidates.Count, Is.EqualTo(1)); | 237 | Assert.That(folder1Candidates.Count, Is.EqualTo(1)); |
238 | 238 | ||
239 | InventoryFolderBase folder1 = folder1Candidates[0]; | 239 | InventoryFolderBase folder1 = folder1Candidates[0]; |
240 | List<InventoryFolderBase> folder2aCandidates | 240 | List<InventoryFolderBase> folder2aCandidates |
241 | = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, folder1, folder2aName); | 241 | = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, folder1, folder2aName); |
242 | Assert.That(folder2aCandidates.Count, Is.EqualTo(1)); | 242 | Assert.That(folder2aCandidates.Count, Is.EqualTo(1)); |
243 | } | 243 | } |
244 | 244 | ||
245 | { | 245 | { |
246 | // Test replication of path2 | 246 | // Test replication of path2 |
247 | new InventoryArchiveReadRequest(UUID.Random(), null, scene.InventoryService, scene.AssetService, scene.UserAccountService, ua1, null, (Stream)null, false) | 247 | new InventoryArchiveReadRequest(UUID.Random(), null, scene.InventoryService, scene.AssetService, scene.UserAccountService, ua1, null, (Stream)null, false) |
248 | .ReplicateArchivePathToUserInventory( | 248 | .ReplicateArchivePathToUserInventory( |
249 | iarPath2, scene.InventoryService.GetRootFolder(ua1.PrincipalID), | 249 | iarPath2, scene.InventoryService.GetRootFolder(ua1.PrincipalID), |
250 | foldersCreated, nodesLoaded); | 250 | foldersCreated, nodesLoaded); |
251 | 251 | ||
252 | List<InventoryFolderBase> folder1Candidates | 252 | List<InventoryFolderBase> folder1Candidates |
253 | = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, ua1.PrincipalID, folder1Name); | 253 | = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, ua1.PrincipalID, folder1Name); |
254 | Assert.That(folder1Candidates.Count, Is.EqualTo(1)); | 254 | Assert.That(folder1Candidates.Count, Is.EqualTo(1)); |
255 | 255 | ||
256 | InventoryFolderBase folder1 = folder1Candidates[0]; | 256 | InventoryFolderBase folder1 = folder1Candidates[0]; |
257 | 257 | ||
258 | List<InventoryFolderBase> folder2aCandidates | 258 | List<InventoryFolderBase> folder2aCandidates |
259 | = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, folder1, folder2aName); | 259 | = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, folder1, folder2aName); |
260 | Assert.That(folder2aCandidates.Count, Is.EqualTo(1)); | 260 | Assert.That(folder2aCandidates.Count, Is.EqualTo(1)); |
261 | 261 | ||
262 | List<InventoryFolderBase> folder2bCandidates | 262 | List<InventoryFolderBase> folder2bCandidates |
263 | = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, folder1, folder2bName); | 263 | = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, folder1, folder2bName); |
264 | Assert.That(folder2bCandidates.Count, Is.EqualTo(1)); | 264 | Assert.That(folder2bCandidates.Count, Is.EqualTo(1)); |
265 | } | 265 | } |
266 | } | 266 | } |
267 | 267 | ||
268 | /// <summary> | 268 | /// <summary> |
269 | /// Test replication of a partly existing archive path to the user's inventory. This should create | 269 | /// Test replication of a partly existing archive path to the user's inventory. This should create |
270 | /// a duplicate path without the merge option. | 270 | /// a duplicate path without the merge option. |
@@ -274,31 +274,31 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
274 | { | 274 | { |
275 | TestHelpers.InMethod(); | 275 | TestHelpers.InMethod(); |
276 | //log4net.Config.XmlConfigurator.Configure(); | 276 | //log4net.Config.XmlConfigurator.Configure(); |
277 | 277 | ||
278 | Scene scene = new SceneHelpers().SetupScene(); | 278 | Scene scene = new SceneHelpers().SetupScene(); |
279 | UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene); | 279 | UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene); |
280 | 280 | ||
281 | string folder1ExistingName = "a"; | 281 | string folder1ExistingName = "a"; |
282 | string folder2Name = "b"; | 282 | string folder2Name = "b"; |
283 | 283 | ||
284 | InventoryFolderBase folder1 | 284 | InventoryFolderBase folder1 |
285 | = UserInventoryHelpers.CreateInventoryFolder( | 285 | = UserInventoryHelpers.CreateInventoryFolder( |
286 | scene.InventoryService, ua1.PrincipalID, folder1ExistingName, false); | 286 | scene.InventoryService, ua1.PrincipalID, folder1ExistingName, false); |
287 | 287 | ||
288 | string folder1ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder1ExistingName, UUID.Random()); | 288 | string folder1ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder1ExistingName, UUID.Random()); |
289 | string folder2ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder2Name, UUID.Random()); | 289 | string folder2ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder2Name, UUID.Random()); |
290 | 290 | ||
291 | string itemArchivePath = string.Join("", new string[] { folder1ArchiveName, folder2ArchiveName }); | 291 | string itemArchivePath = string.Join("", new string[] { folder1ArchiveName, folder2ArchiveName }); |
292 | 292 | ||
293 | new InventoryArchiveReadRequest(UUID.Random(), null, scene.InventoryService, scene.AssetService, scene.UserAccountService, ua1, null, (Stream)null, false) | 293 | new InventoryArchiveReadRequest(UUID.Random(), null, scene.InventoryService, scene.AssetService, scene.UserAccountService, ua1, null, (Stream)null, false) |
294 | .ReplicateArchivePathToUserInventory( | 294 | .ReplicateArchivePathToUserInventory( |
295 | itemArchivePath, scene.InventoryService.GetRootFolder(ua1.PrincipalID), | 295 | itemArchivePath, scene.InventoryService.GetRootFolder(ua1.PrincipalID), |
296 | new Dictionary<string, InventoryFolderBase>(), new HashSet<InventoryNodeBase>()); | 296 | new Dictionary<string, InventoryFolderBase>(), new Dictionary<UUID, InventoryNodeBase>()); |
297 | 297 | ||
298 | List<InventoryFolderBase> folder1PostCandidates | 298 | List<InventoryFolderBase> folder1PostCandidates |
299 | = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, ua1.PrincipalID, folder1ExistingName); | 299 | = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, ua1.PrincipalID, folder1ExistingName); |
300 | Assert.That(folder1PostCandidates.Count, Is.EqualTo(2)); | 300 | Assert.That(folder1PostCandidates.Count, Is.EqualTo(2)); |
301 | 301 | ||
302 | // FIXME: Temporarily, we're going to do something messy to make sure we pick up the created folder. | 302 | // FIXME: Temporarily, we're going to do something messy to make sure we pick up the created folder. |
303 | InventoryFolderBase folder1Post = null; | 303 | InventoryFolderBase folder1Post = null; |
304 | foreach (InventoryFolderBase folder in folder1PostCandidates) | 304 | foreach (InventoryFolderBase folder in folder1PostCandidates) |
@@ -311,11 +311,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
311 | } | 311 | } |
312 | // Assert.That(folder1Post.ID, Is.EqualTo(folder1.ID)); | 312 | // Assert.That(folder1Post.ID, Is.EqualTo(folder1.ID)); |
313 | 313 | ||
314 | List<InventoryFolderBase> folder2PostCandidates | 314 | List<InventoryFolderBase> folder2PostCandidates |
315 | = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, folder1Post, "b"); | 315 | = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, folder1Post, "b"); |
316 | Assert.That(folder2PostCandidates.Count, Is.EqualTo(1)); | 316 | Assert.That(folder2PostCandidates.Count, Is.EqualTo(1)); |
317 | } | 317 | } |
318 | 318 | ||
319 | /// <summary> | 319 | /// <summary> |
320 | /// Test replication of a partly existing archive path to the user's inventory. This should create | 320 | /// Test replication of a partly existing archive path to the user's inventory. This should create |
321 | /// a merged path. | 321 | /// a merged path. |
@@ -325,33 +325,33 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
325 | { | 325 | { |
326 | TestHelpers.InMethod(); | 326 | TestHelpers.InMethod(); |
327 | // log4net.Config.XmlConfigurator.Configure(); | 327 | // log4net.Config.XmlConfigurator.Configure(); |
328 | 328 | ||
329 | Scene scene = new SceneHelpers().SetupScene(); | 329 | Scene scene = new SceneHelpers().SetupScene(); |
330 | UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene); | 330 | UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene); |
331 | 331 | ||
332 | string folder1ExistingName = "a"; | 332 | string folder1ExistingName = "a"; |
333 | string folder2Name = "b"; | 333 | string folder2Name = "b"; |
334 | 334 | ||
335 | InventoryFolderBase folder1 | 335 | InventoryFolderBase folder1 |
336 | = UserInventoryHelpers.CreateInventoryFolder( | 336 | = UserInventoryHelpers.CreateInventoryFolder( |
337 | scene.InventoryService, ua1.PrincipalID, folder1ExistingName, false); | 337 | scene.InventoryService, ua1.PrincipalID, folder1ExistingName, false); |
338 | 338 | ||
339 | string folder1ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder1ExistingName, UUID.Random()); | 339 | string folder1ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder1ExistingName, UUID.Random()); |
340 | string folder2ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder2Name, UUID.Random()); | 340 | string folder2ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder2Name, UUID.Random()); |
341 | 341 | ||
342 | string itemArchivePath = string.Join("", new string[] { folder1ArchiveName, folder2ArchiveName }); | 342 | string itemArchivePath = string.Join("", new string[] { folder1ArchiveName, folder2ArchiveName }); |
343 | 343 | ||
344 | new InventoryArchiveReadRequest(UUID.Random(), null, scene.InventoryService, scene.AssetService, scene.UserAccountService, ua1, folder1ExistingName, (Stream)null, true) | 344 | new InventoryArchiveReadRequest(UUID.Random(), null, scene.InventoryService, scene.AssetService, scene.UserAccountService, ua1, folder1ExistingName, (Stream)null, true) |
345 | .ReplicateArchivePathToUserInventory( | 345 | .ReplicateArchivePathToUserInventory( |
346 | itemArchivePath, scene.InventoryService.GetRootFolder(ua1.PrincipalID), | 346 | itemArchivePath, scene.InventoryService.GetRootFolder(ua1.PrincipalID), |
347 | new Dictionary<string, InventoryFolderBase>(), new HashSet<InventoryNodeBase>()); | 347 | new Dictionary<string, InventoryFolderBase>(), new Dictionary<UUID, InventoryNodeBase>()); |
348 | 348 | ||
349 | List<InventoryFolderBase> folder1PostCandidates | 349 | List<InventoryFolderBase> folder1PostCandidates |
350 | = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, ua1.PrincipalID, folder1ExistingName); | 350 | = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, ua1.PrincipalID, folder1ExistingName); |
351 | Assert.That(folder1PostCandidates.Count, Is.EqualTo(1)); | 351 | Assert.That(folder1PostCandidates.Count, Is.EqualTo(1)); |
352 | Assert.That(folder1PostCandidates[0].ID, Is.EqualTo(folder1.ID)); | 352 | Assert.That(folder1PostCandidates[0].ID, Is.EqualTo(folder1.ID)); |
353 | 353 | ||
354 | List<InventoryFolderBase> folder2PostCandidates | 354 | List<InventoryFolderBase> folder2PostCandidates |
355 | = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, folder1PostCandidates[0], "b"); | 355 | = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, folder1PostCandidates[0], "b"); |
356 | Assert.That(folder2PostCandidates.Count, Is.EqualTo(1)); | 356 | Assert.That(folder2PostCandidates.Count, Is.EqualTo(1)); |
357 | } | 357 | } |