diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs index bc5e564..d1956b4 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs | |||
@@ -26,7 +26,9 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.IO; | ||
29 | using System.Text; | 30 | using System.Text; |
31 | using System.Threading; | ||
30 | using NUnit.Framework; | 32 | using NUnit.Framework; |
31 | using OpenMetaverse; | 33 | using OpenMetaverse; |
32 | using OpenSim.Data; | 34 | using OpenSim.Data; |
@@ -42,10 +44,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
42 | [TestFixture] | 44 | [TestFixture] |
43 | public class InventoryArchiverTests | 45 | public class InventoryArchiverTests |
44 | { | 46 | { |
47 | private EventWaitHandle m_waitHandle = new AutoResetEvent(false); | ||
48 | |||
49 | private void SaveCompleted( | ||
50 | bool succeeded, CachedUserInfo userInfo, string invPath, Stream saveStream, Exception reportedException) | ||
51 | { | ||
52 | m_waitHandle.Set(); | ||
53 | } | ||
54 | |||
45 | /// <summary> | 55 | /// <summary> |
46 | /// Test saving a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet). | 56 | /// Test saving a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet). |
47 | /// </summary> | 57 | /// </summary> |
48 | [Test] | 58 | [Test] |
49 | public void TestSaveIarV0p1() | 59 | public void TestSaveIarV0p1() |
50 | { | 60 | { |
51 | //log4net.Config.XmlConfigurator.Configure(); | 61 | //log4net.Config.XmlConfigurator.Configure(); |
@@ -94,16 +104,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
94 | item1.Name = "My Little Dog"; | 104 | item1.Name = "My Little Dog"; |
95 | item1.AssetID = asset1.FullID; | 105 | item1.AssetID = asset1.FullID; |
96 | item1.Folder = userInfo.RootFolder.FindFolderByPath("Objects").ID; | 106 | item1.Folder = userInfo.RootFolder.FindFolderByPath("Objects").ID; |
97 | scene.AddInventoryItem(userId, item1); | 107 | scene.AddInventoryItem(userId, item1); |
98 | |||
99 | /* | ||
100 | 108 | ||
101 | MemoryStream archiveWriteStream = new MemoryStream(); | 109 | MemoryStream archiveWriteStream = new MemoryStream(); |
102 | 110 | archiverModule.OnInventoryArchiveSaved += SaveCompleted; | |
103 | scene.EventManager.OnOarFileSaved += SaveCompleted; | 111 | |
104 | archiverModule.ArchiveRegion(archiveWriteStream); | 112 | archiverModule.ArchiveInventory(userFirstName, userLastName, "Objects", archiveWriteStream); |
105 | m_waitHandle.WaitOne(60000, true); | 113 | m_waitHandle.WaitOne(60000, true); |
106 | 114 | ||
115 | /* | ||
107 | byte[] archive = archiveWriteStream.ToArray(); | 116 | byte[] archive = archiveWriteStream.ToArray(); |
108 | MemoryStream archiveReadStream = new MemoryStream(archive); | 117 | MemoryStream archiveReadStream = new MemoryStream(archive); |
109 | TarArchiveReader tar = new TarArchiveReader(archiveReadStream); | 118 | TarArchiveReader tar = new TarArchiveReader(archiveReadStream); |