diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Archiver/Tests')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs index 25fffc4..bde15b3 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs | |||
@@ -43,11 +43,12 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
43 | [TestFixture] | 43 | [TestFixture] |
44 | public class ArchiverTests | 44 | public class ArchiverTests |
45 | { | 45 | { |
46 | private EventWaitHandle m_waitHandle = new ManualResetEvent(false); | ||
47 | |||
48 | private void SaveCompleted(string errorMessage) | 46 | private void SaveCompleted(string errorMessage) |
49 | { | 47 | { |
50 | m_waitHandle.Set(); | 48 | lock (this) |
49 | { | ||
50 | Monitor.PulseAll(this); | ||
51 | } | ||
51 | } | 52 | } |
52 | 53 | ||
53 | /// <summary> | 54 | /// <summary> |
@@ -103,12 +104,14 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
103 | scene.AddNewSceneObject(new SceneObjectGroup(part2), false); | 104 | scene.AddNewSceneObject(new SceneObjectGroup(part2), false); |
104 | } | 105 | } |
105 | 106 | ||
106 | MemoryStream archiveWriteStream = new MemoryStream(); | 107 | MemoryStream archiveWriteStream = new MemoryStream(); |
107 | |||
108 | scene.EventManager.OnOarFileSaved += SaveCompleted; | 108 | scene.EventManager.OnOarFileSaved += SaveCompleted; |
109 | archiverModule.ArchiveRegion(archiveWriteStream); | 109 | |
110 | m_waitHandle.WaitOne(60000, true); | 110 | lock (this) |
111 | m_waitHandle.Reset(); | 111 | { |
112 | archiverModule.ArchiveRegion(archiveWriteStream); | ||
113 | Monitor.Wait(this, 60000); | ||
114 | } | ||
112 | 115 | ||
113 | byte[] archive = archiveWriteStream.ToArray(); | 116 | byte[] archive = archiveWriteStream.ToArray(); |
114 | MemoryStream archiveReadStream = new MemoryStream(archive); | 117 | MemoryStream archiveReadStream = new MemoryStream(archive); |
@@ -251,9 +254,12 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
251 | 254 | ||
252 | // Write out this scene | 255 | // Write out this scene |
253 | scene.EventManager.OnOarFileSaved += SaveCompleted; | 256 | scene.EventManager.OnOarFileSaved += SaveCompleted; |
254 | archiverModule.ArchiveRegion(archiveWriteStream); | 257 | |
255 | m_waitHandle.WaitOne(60000, true); | 258 | lock (this) |
256 | m_waitHandle.Reset(); | 259 | { |
260 | archiverModule.ArchiveRegion(archiveWriteStream); | ||
261 | Monitor.Wait(this, 60000); | ||
262 | } | ||
257 | } | 263 | } |
258 | 264 | ||
259 | { | 265 | { |