diff options
author | Jeff Ames | 2010-09-12 13:43:49 -0400 |
---|---|---|
committer | Jeff Ames | 2010-09-12 13:43:49 -0400 |
commit | f1f0bc23f4501ba99035283d3407ddad2b21b785 (patch) | |
tree | 2b62a244eddf18f5608405abcefa9f763ab54340 /OpenSim/Region/CoreModules/Avatar/Inventory/Archiver | |
parent | Add copyright headers. (diff) | |
download | opensim-SC_OLD-f1f0bc23f4501ba99035283d3407ddad2b21b785.zip opensim-SC_OLD-f1f0bc23f4501ba99035283d3407ddad2b21b785.tar.gz opensim-SC_OLD-f1f0bc23f4501ba99035283d3407ddad2b21b785.tar.bz2 opensim-SC_OLD-f1f0bc23f4501ba99035283d3407ddad2b21b785.tar.xz |
Formatting cleanup.
Diffstat (limited to '')
5 files changed, 56 insertions, 56 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs index 52342ec..c1df827 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs | |||
@@ -179,14 +179,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
179 | m_log.DebugFormat( | 179 | m_log.DebugFormat( |
180 | "[INVENTORY ARCHIVER]: Successfully loaded {0} assets with {1} failures", | 180 | "[INVENTORY ARCHIVER]: Successfully loaded {0} assets with {1} failures", |
181 | successfulAssetRestores, failedAssetRestores); | 181 | successfulAssetRestores, failedAssetRestores); |
182 | m_log.InfoFormat("[INVENTORY ARCHIVER]: Successfully loaded {0} items", successfulItemRestores); | 182 | m_log.InfoFormat("[INVENTORY ARCHIVER]: Successfully loaded {0} items", successfulItemRestores); |
183 | 183 | ||
184 | return loadedNodes; | 184 | return loadedNodes; |
185 | } | 185 | } |
186 | finally | 186 | finally |
187 | { | 187 | { |
188 | m_loadStream.Close(); | 188 | m_loadStream.Close(); |
189 | } | 189 | } |
190 | } | 190 | } |
191 | 191 | ||
192 | public void Close() | 192 | public void Close() |
@@ -201,7 +201,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
201 | /// <param name="iarPath">The item archive path to replicate</param> | 201 | /// <param name="iarPath">The item archive path to replicate</param> |
202 | /// <param name="rootDestinationFolder">The root folder for the inventory load</param> | 202 | /// <param name="rootDestinationFolder">The root folder for the inventory load</param> |
203 | /// <param name="resolvedFolders"> | 203 | /// <param name="resolvedFolders"> |
204 | /// The folders that we have resolved so far for a given archive path. | 204 | /// The folders that we have resolved so far for a given archive path. |
205 | /// This method will add more folders if necessary | 205 | /// This method will add more folders if necessary |
206 | /// </param> | 206 | /// </param> |
207 | /// <param name="loadedNodes"> | 207 | /// <param name="loadedNodes"> |
@@ -246,17 +246,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
246 | /// The root folder for the inventory load | 246 | /// The root folder for the inventory load |
247 | /// </param> | 247 | /// </param> |
248 | /// <param name="resolvedFolders"> | 248 | /// <param name="resolvedFolders"> |
249 | /// The folders that we have resolved so far for a given archive path. | 249 | /// The folders that we have resolved so far for a given archive path. |
250 | /// </param> | 250 | /// </param> |
251 | /// <returns> | 251 | /// <returns> |
252 | /// The folder in the user's inventory that matches best the archive path given. If no such folder was found | 252 | /// The folder in the user's inventory that matches best the archive path given. If no such folder was found |
253 | /// then the passed in root destination folder is returned. | 253 | /// then the passed in root destination folder is returned. |
254 | /// </returns> | 254 | /// </returns> |
255 | protected InventoryFolderBase ResolveDestinationFolder( | 255 | protected InventoryFolderBase ResolveDestinationFolder( |
256 | InventoryFolderBase rootDestFolder, | 256 | InventoryFolderBase rootDestFolder, |
257 | ref string archivePath, | 257 | ref string archivePath, |
258 | Dictionary <string, InventoryFolderBase> resolvedFolders) | 258 | Dictionary <string, InventoryFolderBase> resolvedFolders) |
259 | { | 259 | { |
260 | // string originalArchivePath = archivePath; | 260 | // string originalArchivePath = archivePath; |
261 | 261 | ||
262 | while (archivePath.Length > 0) | 262 | while (archivePath.Length > 0) |
@@ -370,7 +370,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
370 | 370 | ||
371 | if (0 == i) | 371 | if (0 == i) |
372 | loadedNodes.Add(destFolder); | 372 | loadedNodes.Add(destFolder); |
373 | } | 373 | } |
374 | } | 374 | } |
375 | 375 | ||
376 | /// <summary> | 376 | /// <summary> |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs index 9908018..bae5a7a 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs | |||
@@ -119,7 +119,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
119 | protected void ReceivedAllAssets(ICollection<UUID> assetsFoundUuids, ICollection<UUID> assetsNotFoundUuids) | 119 | protected void ReceivedAllAssets(ICollection<UUID> assetsFoundUuids, ICollection<UUID> assetsNotFoundUuids) |
120 | { | 120 | { |
121 | Exception reportedException = null; | 121 | Exception reportedException = null; |
122 | bool succeeded = true; | 122 | bool succeeded = true; |
123 | 123 | ||
124 | try | 124 | try |
125 | { | 125 | { |
@@ -136,7 +136,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
136 | finally | 136 | finally |
137 | { | 137 | { |
138 | m_saveStream.Close(); | 138 | m_saveStream.Close(); |
139 | } | 139 | } |
140 | 140 | ||
141 | m_module.TriggerInventoryArchiveSaved( | 141 | m_module.TriggerInventoryArchiveSaved( |
142 | m_id, succeeded, m_userInfo, m_invPath, m_saveStream, reportedException); | 142 | m_id, succeeded, m_userInfo, m_invPath, m_saveStream, reportedException); |
@@ -270,7 +270,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
270 | { | 270 | { |
271 | // We couldn't find the path indicated | 271 | // We couldn't find the path indicated |
272 | string errorMessage = string.Format("Aborted save. Could not find inventory path {0}", m_invPath); | 272 | string errorMessage = string.Format("Aborted save. Could not find inventory path {0}", m_invPath); |
273 | Exception e = new InventoryArchiverException(errorMessage); | 273 | Exception e = new InventoryArchiverException(errorMessage); |
274 | m_module.TriggerInventoryArchiveSaved(m_id, false, m_userInfo, m_invPath, m_saveStream, e); | 274 | m_module.TriggerInventoryArchiveSaved(m_id, false, m_userInfo, m_invPath, m_saveStream, e); |
275 | throw e; | 275 | throw e; |
276 | } | 276 | } |
@@ -283,7 +283,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
283 | "[INVENTORY ARCHIVER]: Found folder {0} {1} at {2}", | 283 | "[INVENTORY ARCHIVER]: Found folder {0} {1} at {2}", |
284 | inventoryFolder.Name, | 284 | inventoryFolder.Name, |
285 | inventoryFolder.ID, | 285 | inventoryFolder.ID, |
286 | m_invPath == String.Empty ? InventoryFolderImpl.PATH_DELIMITER : m_invPath ); | 286 | m_invPath == String.Empty ? InventoryFolderImpl.PATH_DELIMITER : m_invPath); |
287 | 287 | ||
288 | //recurse through all dirs getting dirs and files | 288 | //recurse through all dirs getting dirs and files |
289 | SaveInvFolder(inventoryFolder, ArchiveConstants.INVENTORY_PATH, !saveFolderContentsOnly); | 289 | SaveInvFolder(inventoryFolder, ArchiveConstants.INVENTORY_PATH, !saveFolderContentsOnly); |
@@ -301,7 +301,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
301 | //SaveUsers(); | 301 | //SaveUsers(); |
302 | 302 | ||
303 | new AssetsRequest( | 303 | new AssetsRequest( |
304 | new AssetsArchiver(m_archiveWriter), m_assetUuids, m_scene.AssetService, ReceivedAllAssets).Execute(); | 304 | new AssetsArchiver(m_archiveWriter), m_assetUuids, m_scene.AssetService, ReceivedAllAssets).Execute(); |
305 | } | 305 | } |
306 | catch (Exception) | 306 | catch (Exception) |
307 | { | 307 | { |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverException.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverException.cs index e07e2ca..5fd1a7e 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverException.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverException.cs | |||
@@ -33,7 +33,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
33 | /// Signals an inventory archiving problem | 33 | /// Signals an inventory archiving problem |
34 | /// </summary> | 34 | /// </summary> |
35 | public class InventoryArchiverException : Exception | 35 | public class InventoryArchiverException : Exception |
36 | { | 36 | { |
37 | public InventoryArchiverException(string message) : base(message) {} | 37 | public InventoryArchiverException(string message) : base(message) {} |
38 | public InventoryArchiverException(string message, Exception e) : base(message, e) {} | 38 | public InventoryArchiverException(string message, Exception e) : base(message, e) {} |
39 | } | 39 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs index f03f2a1..2eaca49 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs | |||
@@ -91,12 +91,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
91 | 91 | ||
92 | scene.AddCommand( | 92 | scene.AddCommand( |
93 | this, "load iar", | 93 | this, "load iar", |
94 | "load iar <first> <last> <inventory path> <password> [<IAR path>]", | 94 | "load iar <first> <last> <inventory path> <password> [<IAR path>]", |
95 | //"load iar [--merge] <first> <last> <inventory path> <password> [<IAR path>]", | 95 | //"load iar [--merge] <first> <last> <inventory path> <password> [<IAR path>]", |
96 | "Load user inventory archive (IAR).", | 96 | "Load user inventory archive (IAR).", |
97 | //"--merge is an option which merges the loaded IAR with existing inventory folders where possible, rather than always creating new ones" | 97 | //"--merge is an option which merges the loaded IAR with existing inventory folders where possible, rather than always creating new ones" |
98 | //+ "<first> is user's first name." + Environment.NewLine | 98 | //+ "<first> is user's first name." + Environment.NewLine |
99 | "<first> is user's first name." + Environment.NewLine | 99 | "<first> is user's first name." + Environment.NewLine |
100 | + "<last> is user's last name." + Environment.NewLine | 100 | + "<last> is user's last name." + Environment.NewLine |
101 | + "<inventory path> is the path inside the user's inventory where the IAR should be loaded." + Environment.NewLine | 101 | + "<inventory path> is the path inside the user's inventory where the IAR should be loaded." + Environment.NewLine |
102 | + "<password> is the user's password." + Environment.NewLine | 102 | + "<password> is the user's password." + Environment.NewLine |
@@ -241,7 +241,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
241 | if (CheckPresence(userInfo.PrincipalID)) | 241 | if (CheckPresence(userInfo.PrincipalID)) |
242 | { | 242 | { |
243 | InventoryArchiveReadRequest request; | 243 | InventoryArchiveReadRequest request; |
244 | bool merge = (options.ContainsKey("merge") ? (bool)options["merge"] : false); | 244 | bool merge = (options.ContainsKey("merge") ? (bool)options["merge"] : false); |
245 | 245 | ||
246 | try | 246 | try |
247 | { | 247 | { |
@@ -286,10 +286,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
286 | if (CheckPresence(userInfo.PrincipalID)) | 286 | if (CheckPresence(userInfo.PrincipalID)) |
287 | { | 287 | { |
288 | InventoryArchiveReadRequest request; | 288 | InventoryArchiveReadRequest request; |
289 | bool merge = (options.ContainsKey("merge") ? (bool)options["merge"] : false); | 289 | bool merge = (options.ContainsKey("merge") ? (bool)options["merge"] : false); |
290 | 290 | ||
291 | try | 291 | try |
292 | { | 292 | { |
293 | request = new InventoryArchiveReadRequest(m_aScene, userInfo, invPath, loadPath, merge); | 293 | request = new InventoryArchiveReadRequest(m_aScene, userInfo, invPath, loadPath, merge); |
294 | } | 294 | } |
295 | catch (EntryPointNotFoundException e) | 295 | catch (EntryPointNotFoundException e) |
@@ -325,20 +325,20 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
325 | protected void HandleLoadInvConsoleCommand(string module, string[] cmdparams) | 325 | protected void HandleLoadInvConsoleCommand(string module, string[] cmdparams) |
326 | { | 326 | { |
327 | try | 327 | try |
328 | { | 328 | { |
329 | m_log.Info("[INVENTORY ARCHIVER]: PLEASE NOTE THAT THIS FACILITY IS EXPERIMENTAL. BUG REPORTS WELCOME."); | 329 | m_log.Info("[INVENTORY ARCHIVER]: PLEASE NOTE THAT THIS FACILITY IS EXPERIMENTAL. BUG REPORTS WELCOME."); |
330 | 330 | ||
331 | Dictionary<string, object> options = new Dictionary<string, object>(); | 331 | Dictionary<string, object> options = new Dictionary<string, object>(); |
332 | OptionSet optionSet = new OptionSet().Add("m|merge", delegate (string v) { options["merge"] = v != null; }); | 332 | OptionSet optionSet = new OptionSet().Add("m|merge", delegate (string v) { options["merge"] = v != null; }); |
333 | 333 | ||
334 | List<string> mainParams = optionSet.Parse(cmdparams); | 334 | List<string> mainParams = optionSet.Parse(cmdparams); |
335 | 335 | ||
336 | if (mainParams.Count < 6) | 336 | if (mainParams.Count < 6) |
337 | { | 337 | { |
338 | m_log.Error( | 338 | m_log.Error( |
339 | "[INVENTORY ARCHIVER]: usage is load iar [--merge] <first name> <last name> <inventory path> <user password> [<load file path>]"); | 339 | "[INVENTORY ARCHIVER]: usage is load iar [--merge] <first name> <last name> <inventory path> <user password> [<load file path>]"); |
340 | return; | 340 | return; |
341 | } | 341 | } |
342 | 342 | ||
343 | string firstName = mainParams[2]; | 343 | string firstName = mainParams[2]; |
344 | string lastName = mainParams[3]; | 344 | string lastName = mainParams[3]; |
@@ -353,7 +353,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
353 | if (DearchiveInventory(firstName, lastName, invPath, pass, loadPath, options)) | 353 | if (DearchiveInventory(firstName, lastName, invPath, pass, loadPath, options)) |
354 | m_log.InfoFormat( | 354 | m_log.InfoFormat( |
355 | "[INVENTORY ARCHIVER]: Loaded archive {0} for {1} {2}", | 355 | "[INVENTORY ARCHIVER]: Loaded archive {0} for {1} {2}", |
356 | loadPath, firstName, lastName); | 356 | loadPath, firstName, lastName); |
357 | } | 357 | } |
358 | catch (InventoryArchiverException e) | 358 | catch (InventoryArchiverException e) |
359 | { | 359 | { |
@@ -390,7 +390,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
390 | "[INVENTORY ARCHIVER]: Saving archive {0} using inventory path {1} for {2} {3}", | 390 | "[INVENTORY ARCHIVER]: Saving archive {0} using inventory path {1} for {2} {3}", |
391 | savePath, invPath, firstName, lastName); | 391 | savePath, invPath, firstName, lastName); |
392 | 392 | ||
393 | ArchiveInventory(id, firstName, lastName, invPath, pass, savePath, new Dictionary<string, object>()); | 393 | ArchiveInventory(id, firstName, lastName, invPath, pass, savePath, new Dictionary<string, object>()); |
394 | } | 394 | } |
395 | catch (InventoryArchiverException e) | 395 | catch (InventoryArchiverException e) |
396 | { | 396 | { |
@@ -398,7 +398,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
398 | } | 398 | } |
399 | 399 | ||
400 | lock (m_pendingConsoleSaves) | 400 | lock (m_pendingConsoleSaves) |
401 | m_pendingConsoleSaves.Add(id); | 401 | m_pendingConsoleSaves.Add(id); |
402 | } | 402 | } |
403 | 403 | ||
404 | private void SaveInvConsoleCommandCompleted( | 404 | private void SaveInvConsoleCommandCompleted( |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs index d66a1d0..938886b2 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs | |||
@@ -58,18 +58,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
58 | /// <summary> | 58 | /// <summary> |
59 | /// Stream of data representing a common IAR that can be reused in load tests. | 59 | /// Stream of data representing a common IAR that can be reused in load tests. |
60 | /// </summary> | 60 | /// </summary> |
61 | protected MemoryStream m_iarStream; | 61 | protected MemoryStream m_iarStream; |
62 | 62 | ||
63 | protected UserAccount m_ua1 | 63 | protected UserAccount m_ua1 |
64 | = new UserAccount { | 64 | = new UserAccount { |
65 | PrincipalID = UUID.Parse("00000000-0000-0000-0000-000000000555"), | 65 | PrincipalID = UUID.Parse("00000000-0000-0000-0000-000000000555"), |
66 | FirstName = "Mr", | 66 | FirstName = "Mr", |
67 | LastName = "Tiddles" }; | 67 | LastName = "Tiddles" }; |
68 | protected UserAccount m_ua2 | 68 | protected UserAccount m_ua2 |
69 | = new UserAccount { | 69 | = new UserAccount { |
70 | PrincipalID = UUID.Parse("00000000-0000-0000-0000-000000000666"), | 70 | PrincipalID = UUID.Parse("00000000-0000-0000-0000-000000000666"), |
71 | FirstName = "Lord", | 71 | FirstName = "Lord", |
72 | LastName = "Lucan" }; | 72 | LastName = "Lucan" }; |
73 | string m_item1Name = "b.lsl"; | 73 | string m_item1Name = "b.lsl"; |
74 | 74 | ||
75 | private void SaveCompleted( | 75 | private void SaveCompleted( |
@@ -86,7 +86,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
86 | } | 86 | } |
87 | 87 | ||
88 | protected void ConstructDefaultIarForTestLoad() | 88 | protected void ConstructDefaultIarForTestLoad() |
89 | { | 89 | { |
90 | string archiveItemName = InventoryArchiveWriteRequest.CreateArchiveItemName(m_item1Name, UUID.Random()); | 90 | string archiveItemName = InventoryArchiveWriteRequest.CreateArchiveItemName(m_item1Name, UUID.Random()); |
91 | 91 | ||
92 | MemoryStream archiveWriteStream = new MemoryStream(); | 92 | MemoryStream archiveWriteStream = new MemoryStream(); |
@@ -104,7 +104,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
104 | string item1FileName | 104 | string item1FileName |
105 | = string.Format("{0}{1}", ArchiveConstants.INVENTORY_PATH, archiveItemName); | 105 | = string.Format("{0}{1}", ArchiveConstants.INVENTORY_PATH, archiveItemName); |
106 | tar.WriteFile(item1FileName, UserInventoryItemSerializer.Serialize(item1)); | 106 | tar.WriteFile(item1FileName, UserInventoryItemSerializer.Serialize(item1)); |
107 | tar.Close(); | 107 | tar.Close(); |
108 | m_iarStream = new MemoryStream(archiveWriteStream.ToArray()); | 108 | m_iarStream = new MemoryStream(archiveWriteStream.ToArray()); |
109 | } | 109 | } |
110 | 110 | ||
@@ -341,7 +341,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
341 | // Assert.That(gotObject2File, Is.True, "No object2 file in archive"); | 341 | // Assert.That(gotObject2File, Is.True, "No object2 file in archive"); |
342 | 342 | ||
343 | // TODO: Test presence of more files and contents of files. | 343 | // TODO: Test presence of more files and contents of files. |
344 | } | 344 | } |
345 | 345 | ||
346 | /// <summary> | 346 | /// <summary> |
347 | /// Test that things work when the load path specified starts with a slash | 347 | /// Test that things work when the load path specified starts with a slash |
@@ -349,22 +349,22 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
349 | [Test] | 349 | [Test] |
350 | public void TestLoadIarPathStartsWithSlash() | 350 | public void TestLoadIarPathStartsWithSlash() |
351 | { | 351 | { |
352 | TestHelper.InMethod(); | 352 | TestHelper.InMethod(); |
353 | // log4net.Config.XmlConfigurator.Configure(); | 353 | // log4net.Config.XmlConfigurator.Configure(); |
354 | 354 | ||
355 | SerialiserModule serialiserModule = new SerialiserModule(); | 355 | SerialiserModule serialiserModule = new SerialiserModule(); |
356 | InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); | 356 | InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); |
357 | Scene scene = SceneSetupHelpers.SetupScene("inventory"); | 357 | Scene scene = SceneSetupHelpers.SetupScene("inventory"); |
358 | SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); | 358 | SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); |
359 | 359 | ||
360 | UserProfileTestUtils.CreateUserWithInventory(scene, m_ua1, "password"); | 360 | UserProfileTestUtils.CreateUserWithInventory(scene, m_ua1, "password"); |
361 | archiverModule.DearchiveInventory(m_ua1.FirstName, m_ua1.LastName, "/Objects", "password", m_iarStream); | 361 | archiverModule.DearchiveInventory(m_ua1.FirstName, m_ua1.LastName, "/Objects", "password", m_iarStream); |
362 | 362 | ||
363 | InventoryItemBase foundItem1 | 363 | InventoryItemBase foundItem1 |
364 | = InventoryArchiveUtils.FindItemByPath( | 364 | = InventoryArchiveUtils.FindItemByPath( |
365 | scene.InventoryService, m_ua1.PrincipalID, "/Objects/" + m_item1Name); | 365 | scene.InventoryService, m_ua1.PrincipalID, "/Objects/" + m_item1Name); |
366 | 366 | ||
367 | Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1 in TestLoadIarFolderStartsWithSlash()"); | 367 | Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1 in TestLoadIarFolderStartsWithSlash()"); |
368 | } | 368 | } |
369 | 369 | ||
370 | /// <summary> | 370 | /// <summary> |
@@ -376,7 +376,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
376 | [Test] | 376 | [Test] |
377 | public void TestLoadIarV0_1ExistingUsers() | 377 | public void TestLoadIarV0_1ExistingUsers() |
378 | { | 378 | { |
379 | TestHelper.InMethod(); | 379 | TestHelper.InMethod(); |
380 | //log4net.Config.XmlConfigurator.Configure(); | 380 | //log4net.Config.XmlConfigurator.Configure(); |
381 | 381 | ||
382 | SerialiserModule serialiserModule = new SerialiserModule(); | 382 | SerialiserModule serialiserModule = new SerialiserModule(); |
@@ -386,9 +386,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
386 | Scene scene = SceneSetupHelpers.SetupScene("inventory"); | 386 | Scene scene = SceneSetupHelpers.SetupScene("inventory"); |
387 | 387 | ||
388 | SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); | 388 | SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); |
389 | 389 | ||
390 | UserProfileTestUtils.CreateUserWithInventory(scene, m_ua1, "meowfood"); | 390 | UserProfileTestUtils.CreateUserWithInventory(scene, m_ua1, "meowfood"); |
391 | UserProfileTestUtils.CreateUserWithInventory(scene, m_ua2, "hampshire"); | 391 | UserProfileTestUtils.CreateUserWithInventory(scene, m_ua2, "hampshire"); |
392 | 392 | ||
393 | archiverModule.DearchiveInventory(m_ua1.FirstName, m_ua1.LastName, "/", "meowfood", m_iarStream); | 393 | archiverModule.DearchiveInventory(m_ua1.FirstName, m_ua1.LastName, "/", "meowfood", m_iarStream); |
394 | 394 | ||
@@ -450,7 +450,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
450 | string userFirstName = "Jock"; | 450 | string userFirstName = "Jock"; |
451 | string userLastName = "Stirrup"; | 451 | string userLastName = "Stirrup"; |
452 | UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000020"); | 452 | UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000020"); |
453 | UserProfileTestUtils.CreateUserWithInventory(scene, userFirstName, userLastName, userId, "meowfood"); | 453 | UserProfileTestUtils.CreateUserWithInventory(scene, userFirstName, userLastName, userId, "meowfood"); |
454 | 454 | ||
455 | // Create asset | 455 | // Create asset |
456 | SceneObjectGroup object1; | 456 | SceneObjectGroup object1; |
@@ -524,7 +524,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
524 | [Test] | 524 | [Test] |
525 | public void TestLoadIarV0_1AbsentUsers() | 525 | public void TestLoadIarV0_1AbsentUsers() |
526 | { | 526 | { |
527 | TestHelper.InMethod(); | 527 | TestHelper.InMethod(); |
528 | //log4net.Config.XmlConfigurator.Configure(); | 528 | //log4net.Config.XmlConfigurator.Configure(); |
529 | 529 | ||
530 | string userFirstName = "Charlie"; | 530 | string userFirstName = "Charlie"; |
@@ -562,7 +562,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
562 | Scene scene = SceneSetupHelpers.SetupScene("inventory"); | 562 | Scene scene = SceneSetupHelpers.SetupScene("inventory"); |
563 | 563 | ||
564 | SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); | 564 | SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); |
565 | UserProfileTestUtils.CreateUserWithInventory(scene, userFirstName, userLastName, userUuid, "meowfood"); | 565 | UserProfileTestUtils.CreateUserWithInventory(scene, userFirstName, userLastName, userUuid, "meowfood"); |
566 | 566 | ||
567 | archiverModule.DearchiveInventory(userFirstName, userLastName, "/", "meowfood", archiveReadStream); | 567 | archiverModule.DearchiveInventory(userFirstName, userLastName, "/", "meowfood", archiveReadStream); |
568 | 568 | ||
@@ -680,8 +680,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
680 | string folder2aArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder2aName, UUID.Random()); | 680 | string folder2aArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder2aName, UUID.Random()); |
681 | string folder2bArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder2bName, UUID.Random()); | 681 | string folder2bArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder2bName, UUID.Random()); |
682 | 682 | ||
683 | string iarPath1 = string.Join("", new string[] { folder1ArchiveName, folder2aArchiveName }); | 683 | string iarPath1 = string.Join("", new string[] { folder1ArchiveName, folder2aArchiveName }); |
684 | string iarPath2 = string.Join("", new string[] { folder1ArchiveName, folder2bArchiveName }); | 684 | string iarPath2 = string.Join("", new string[] { folder1ArchiveName, folder2bArchiveName }); |
685 | 685 | ||
686 | { | 686 | { |
687 | // Test replication of path1 | 687 | // Test replication of path1 |
@@ -694,7 +694,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
694 | = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, ua1.PrincipalID, folder1Name); | 694 | = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, ua1.PrincipalID, folder1Name); |
695 | Assert.That(folder1Candidates.Count, Is.EqualTo(1)); | 695 | Assert.That(folder1Candidates.Count, Is.EqualTo(1)); |
696 | 696 | ||
697 | InventoryFolderBase folder1 = folder1Candidates[0]; | 697 | InventoryFolderBase folder1 = folder1Candidates[0]; |
698 | List<InventoryFolderBase> folder2aCandidates | 698 | List<InventoryFolderBase> folder2aCandidates |
699 | = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, folder1, folder2aName); | 699 | = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, folder1, folder2aName); |
700 | Assert.That(folder2aCandidates.Count, Is.EqualTo(1)); | 700 | Assert.That(folder2aCandidates.Count, Is.EqualTo(1)); |
@@ -715,11 +715,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
715 | 715 | ||
716 | List<InventoryFolderBase> folder2aCandidates | 716 | List<InventoryFolderBase> folder2aCandidates |
717 | = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, folder1, folder2aName); | 717 | = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, folder1, folder2aName); |
718 | Assert.That(folder2aCandidates.Count, Is.EqualTo(1)); | 718 | Assert.That(folder2aCandidates.Count, Is.EqualTo(1)); |
719 | 719 | ||
720 | List<InventoryFolderBase> folder2bCandidates | 720 | List<InventoryFolderBase> folder2bCandidates |
721 | = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, folder1, folder2bName); | 721 | = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, folder1, folder2bName); |
722 | Assert.That(folder2bCandidates.Count, Is.EqualTo(1)); | 722 | Assert.That(folder2bCandidates.Count, Is.EqualTo(1)); |
723 | } | 723 | } |
724 | } | 724 | } |
725 | 725 | ||
@@ -741,7 +741,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
741 | 741 | ||
742 | InventoryFolderBase folder1 | 742 | InventoryFolderBase folder1 |
743 | = UserInventoryTestUtils.CreateInventoryFolder( | 743 | = UserInventoryTestUtils.CreateInventoryFolder( |
744 | scene.InventoryService, ua1.PrincipalID, folder1ExistingName); | 744 | scene.InventoryService, ua1.PrincipalID, folder1ExistingName); |
745 | 745 | ||
746 | string folder1ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder1ExistingName, UUID.Random()); | 746 | string folder1ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder1ExistingName, UUID.Random()); |
747 | string folder2ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder2Name, UUID.Random()); | 747 | string folder2ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder2Name, UUID.Random()); |
@@ -772,7 +772,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
772 | List<InventoryFolderBase> folder2PostCandidates | 772 | List<InventoryFolderBase> folder2PostCandidates |
773 | = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, folder1Post, "b"); | 773 | = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, folder1Post, "b"); |
774 | Assert.That(folder2PostCandidates.Count, Is.EqualTo(1)); | 774 | Assert.That(folder2PostCandidates.Count, Is.EqualTo(1)); |
775 | } | 775 | } |
776 | 776 | ||
777 | /// <summary> | 777 | /// <summary> |
778 | /// Test replication of a partly existing archive path to the user's inventory. This should create | 778 | /// Test replication of a partly existing archive path to the user's inventory. This should create |
@@ -792,7 +792,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
792 | 792 | ||
793 | InventoryFolderBase folder1 | 793 | InventoryFolderBase folder1 |
794 | = UserInventoryTestUtils.CreateInventoryFolder( | 794 | = UserInventoryTestUtils.CreateInventoryFolder( |
795 | scene.InventoryService, ua1.PrincipalID, folder1ExistingName); | 795 | scene.InventoryService, ua1.PrincipalID, folder1ExistingName); |
796 | 796 | ||
797 | string folder1ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder1ExistingName, UUID.Random()); | 797 | string folder1ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder1ExistingName, UUID.Random()); |
798 | string folder2ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder2Name, UUID.Random()); | 798 | string folder2ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder2Name, UUID.Random()); |
@@ -812,6 +812,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
812 | List<InventoryFolderBase> folder2PostCandidates | 812 | List<InventoryFolderBase> folder2PostCandidates |
813 | = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, folder1PostCandidates[0], "b"); | 813 | = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, folder1PostCandidates[0], "b"); |
814 | Assert.That(folder2PostCandidates.Count, Is.EqualTo(1)); | 814 | Assert.That(folder2PostCandidates.Count, Is.EqualTo(1)); |
815 | } | 815 | } |
816 | } | 816 | } |
817 | } \ No newline at end of file | 817 | } \ No newline at end of file |