diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Archiver/Tests')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs | 154 |
1 files changed, 77 insertions, 77 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs index f6d0347..6a64ff1 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs | |||
@@ -34,7 +34,7 @@ using NUnit.Framework; | |||
34 | using NUnit.Framework.SyntaxHelpers; | 34 | using NUnit.Framework.SyntaxHelpers; |
35 | using OpenMetaverse; | 35 | using OpenMetaverse; |
36 | using OpenSim.Framework; | 36 | using OpenSim.Framework; |
37 | using OpenSim.Framework.Archive; | 37 | using OpenSim.Framework.Serialization; |
38 | using OpenSim.Region.CoreModules.World.Serialiser; | 38 | using OpenSim.Region.CoreModules.World.Serialiser; |
39 | using OpenSim.Region.CoreModules.World.Terrain; | 39 | using OpenSim.Region.CoreModules.World.Terrain; |
40 | using OpenSim.Region.Framework.Scenes; | 40 | using OpenSim.Region.Framework.Scenes; |
@@ -48,29 +48,29 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
48 | private void SaveCompleted(string errorMessage) | 48 | private void SaveCompleted(string errorMessage) |
49 | { | 49 | { |
50 | lock (this) | 50 | lock (this) |
51 | { | 51 | { |
52 | System.Console.WriteLine("About to pulse ArchiverTests"); | 52 | System.Console.WriteLine("About to pulse ArchiverTests"); |
53 | Monitor.PulseAll(this); | 53 | Monitor.PulseAll(this); |
54 | } | 54 | } |
55 | } | 55 | } |
56 | 56 | ||
57 | /// <summary> | 57 | /// <summary> |
58 | /// Test saving a V0.2 OpenSim Region Archive. | 58 | /// Test saving a V0.2 OpenSim Region Archive. |
59 | /// </summary> | 59 | /// </summary> |
60 | [Test] | 60 | [Test] |
61 | public void TestSaveOarV0p2() | 61 | public void TestSaveOarV0p2() |
62 | { | 62 | { |
63 | log4net.Config.XmlConfigurator.Configure(); | 63 | log4net.Config.XmlConfigurator.Configure(); |
64 | 64 | ||
65 | ArchiverModule archiverModule = new ArchiverModule(); | 65 | ArchiverModule archiverModule = new ArchiverModule(); |
66 | SerialiserModule serialiserModule = new SerialiserModule(); | 66 | SerialiserModule serialiserModule = new SerialiserModule(); |
67 | TerrainModule terrainModule = new TerrainModule(); | 67 | TerrainModule terrainModule = new TerrainModule(); |
68 | 68 | ||
69 | Scene scene = SceneSetupHelpers.SetupScene(); | 69 | Scene scene = SceneSetupHelpers.SetupScene(); |
70 | SceneSetupHelpers.SetupSceneModules(scene, archiverModule, serialiserModule, terrainModule); | 70 | SceneSetupHelpers.SetupSceneModules(scene, archiverModule, serialiserModule, terrainModule); |
71 | 71 | ||
72 | SceneObjectPart part1; | 72 | SceneObjectPart part1; |
73 | 73 | ||
74 | // Create and add prim 1 | 74 | // Create and add prim 1 |
75 | { | 75 | { |
76 | string partName = "My Little Pony"; | 76 | string partName = "My Little Pony"; |
@@ -79,17 +79,17 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
79 | Vector3 groupPosition = new Vector3(10, 20, 30); | 79 | Vector3 groupPosition = new Vector3(10, 20, 30); |
80 | Quaternion rotationOffset = new Quaternion(20, 30, 40, 50); | 80 | Quaternion rotationOffset = new Quaternion(20, 30, 40, 50); |
81 | Vector3 offsetPosition = new Vector3(5, 10, 15); | 81 | Vector3 offsetPosition = new Vector3(5, 10, 15); |
82 | 82 | ||
83 | part1 | 83 | part1 |
84 | = new SceneObjectPart( | 84 | = new SceneObjectPart( |
85 | ownerId, shape, groupPosition, rotationOffset, offsetPosition); | 85 | ownerId, shape, groupPosition, rotationOffset, offsetPosition); |
86 | part1.Name = partName; | 86 | part1.Name = partName; |
87 | 87 | ||
88 | scene.AddNewSceneObject(new SceneObjectGroup(part1), false); | 88 | scene.AddNewSceneObject(new SceneObjectGroup(part1), false); |
89 | } | 89 | } |
90 | 90 | ||
91 | SceneObjectPart part2; | 91 | SceneObjectPart part2; |
92 | 92 | ||
93 | // Create and add prim 2 | 93 | // Create and add prim 2 |
94 | { | 94 | { |
95 | string partName = "Action Man"; | 95 | string partName = "Action Man"; |
@@ -98,28 +98,28 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
98 | Vector3 groupPosition = new Vector3(90, 80, 70); | 98 | Vector3 groupPosition = new Vector3(90, 80, 70); |
99 | Quaternion rotationOffset = new Quaternion(60, 70, 80, 90); | 99 | Quaternion rotationOffset = new Quaternion(60, 70, 80, 90); |
100 | Vector3 offsetPosition = new Vector3(20, 25, 30); | 100 | Vector3 offsetPosition = new Vector3(20, 25, 30); |
101 | 101 | ||
102 | part2 | 102 | part2 |
103 | = new SceneObjectPart( | 103 | = new SceneObjectPart( |
104 | ownerId, shape, groupPosition, rotationOffset, offsetPosition); | 104 | ownerId, shape, groupPosition, rotationOffset, offsetPosition); |
105 | part2.Name = partName; | 105 | part2.Name = partName; |
106 | 106 | ||
107 | scene.AddNewSceneObject(new SceneObjectGroup(part2), false); | 107 | scene.AddNewSceneObject(new SceneObjectGroup(part2), false); |
108 | } | 108 | } |
109 | 109 | ||
110 | MemoryStream archiveWriteStream = new MemoryStream(); | 110 | MemoryStream archiveWriteStream = new MemoryStream(); |
111 | scene.EventManager.OnOarFileSaved += SaveCompleted; | 111 | scene.EventManager.OnOarFileSaved += SaveCompleted; |
112 | 112 | ||
113 | lock (this) | 113 | lock (this) |
114 | { | 114 | { |
115 | archiverModule.ArchiveRegion(archiveWriteStream); | 115 | archiverModule.ArchiveRegion(archiveWriteStream); |
116 | Monitor.Wait(this, 60000); | 116 | Monitor.Wait(this, 60000); |
117 | } | 117 | } |
118 | 118 | ||
119 | byte[] archive = archiveWriteStream.ToArray(); | 119 | byte[] archive = archiveWriteStream.ToArray(); |
120 | MemoryStream archiveReadStream = new MemoryStream(archive); | 120 | MemoryStream archiveReadStream = new MemoryStream(archive); |
121 | TarArchiveReader tar = new TarArchiveReader(archiveReadStream); | 121 | TarArchiveReader tar = new TarArchiveReader(archiveReadStream); |
122 | 122 | ||
123 | bool gotControlFile = false; | 123 | bool gotControlFile = false; |
124 | bool gotObject1File = false; | 124 | bool gotObject1File = false; |
125 | bool gotObject2File = false; | 125 | bool gotObject2File = false; |
@@ -132,11 +132,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
132 | "{0}_{1:000}-{2:000}-{3:000}__{4}.xml", | 132 | "{0}_{1:000}-{2:000}-{3:000}__{4}.xml", |
133 | part2.Name, | 133 | part2.Name, |
134 | Math.Round(part2.GroupPosition.X), Math.Round(part2.GroupPosition.Y), Math.Round(part2.GroupPosition.Z), | 134 | Math.Round(part2.GroupPosition.X), Math.Round(part2.GroupPosition.Y), Math.Round(part2.GroupPosition.Z), |
135 | part2.UUID); | 135 | part2.UUID); |
136 | 136 | ||
137 | string filePath; | 137 | string filePath; |
138 | TarArchiveReader.TarEntryType tarEntryType; | 138 | TarArchiveReader.TarEntryType tarEntryType; |
139 | 139 | ||
140 | while (tar.ReadEntry(out filePath, out tarEntryType) != null) | 140 | while (tar.ReadEntry(out filePath, out tarEntryType) != null) |
141 | { | 141 | { |
142 | if (ArchiveConstants.CONTROL_FILE_PATH == filePath) | 142 | if (ArchiveConstants.CONTROL_FILE_PATH == filePath) |
@@ -146,7 +146,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
146 | else if (filePath.StartsWith(ArchiveConstants.OBJECTS_PATH)) | 146 | else if (filePath.StartsWith(ArchiveConstants.OBJECTS_PATH)) |
147 | { | 147 | { |
148 | string fileName = filePath.Remove(0, ArchiveConstants.OBJECTS_PATH.Length); | 148 | string fileName = filePath.Remove(0, ArchiveConstants.OBJECTS_PATH.Length); |
149 | 149 | ||
150 | if (fileName.StartsWith(part1.Name)) | 150 | if (fileName.StartsWith(part1.Name)) |
151 | { | 151 | { |
152 | Assert.That(fileName, Is.EqualTo(expectedObject1FileName)); | 152 | Assert.That(fileName, Is.EqualTo(expectedObject1FileName)); |
@@ -155,7 +155,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
155 | else if (fileName.StartsWith(part2.Name)) | 155 | else if (fileName.StartsWith(part2.Name)) |
156 | { | 156 | { |
157 | Assert.That(fileName, Is.EqualTo(expectedObject2FileName)); | 157 | Assert.That(fileName, Is.EqualTo(expectedObject2FileName)); |
158 | gotObject2File = true; | 158 | gotObject2File = true; |
159 | } | 159 | } |
160 | } | 160 | } |
161 | } | 161 | } |
@@ -163,7 +163,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
163 | Assert.That(gotControlFile, Is.True, "No control file in archive"); | 163 | Assert.That(gotControlFile, Is.True, "No control file in archive"); |
164 | Assert.That(gotObject1File, Is.True, "No object1 file in archive"); | 164 | Assert.That(gotObject1File, Is.True, "No object1 file in archive"); |
165 | Assert.That(gotObject2File, Is.True, "No object2 file in archive"); | 165 | Assert.That(gotObject2File, Is.True, "No object2 file in archive"); |
166 | 166 | ||
167 | // TODO: Test presence of more files and contents of files. | 167 | // TODO: Test presence of more files and contents of files. |
168 | // Temporary | 168 | // Temporary |
169 | Console.WriteLine("Successfully completed {0}", MethodBase.GetCurrentMethod()); | 169 | Console.WriteLine("Successfully completed {0}", MethodBase.GetCurrentMethod()); |
@@ -171,143 +171,143 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
171 | 171 | ||
172 | /// <summary> | 172 | /// <summary> |
173 | /// Test loading a V0.2 OpenSim Region Archive. | 173 | /// Test loading a V0.2 OpenSim Region Archive. |
174 | /// </summary> | 174 | /// </summary> |
175 | [Test] | 175 | [Test] |
176 | public void TestLoadOarV0p2() | 176 | public void TestLoadOarV0p2() |
177 | { | 177 | { |
178 | //log4net.Config.XmlConfigurator.Configure(); | 178 | //log4net.Config.XmlConfigurator.Configure(); |
179 | 179 | ||
180 | MemoryStream archiveWriteStream = new MemoryStream(); | 180 | MemoryStream archiveWriteStream = new MemoryStream(); |
181 | TarArchiveWriter tar = new TarArchiveWriter(archiveWriteStream); | 181 | TarArchiveWriter tar = new TarArchiveWriter(archiveWriteStream); |
182 | 182 | ||
183 | tar.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, ArchiveWriteRequestExecution.Create0p2ControlFile()); | 183 | tar.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, ArchiveWriteRequestExecution.Create0p2ControlFile()); |
184 | 184 | ||
185 | string part1Name = "object1"; | 185 | string part1Name = "object1"; |
186 | PrimitiveBaseShape shape = PrimitiveBaseShape.CreateCylinder(); | 186 | PrimitiveBaseShape shape = PrimitiveBaseShape.CreateCylinder(); |
187 | Vector3 groupPosition = new Vector3(90, 80, 70); | 187 | Vector3 groupPosition = new Vector3(90, 80, 70); |
188 | Quaternion rotationOffset = new Quaternion(60, 70, 80, 90); | 188 | Quaternion rotationOffset = new Quaternion(60, 70, 80, 90); |
189 | Vector3 offsetPosition = new Vector3(20, 25, 30); | 189 | Vector3 offsetPosition = new Vector3(20, 25, 30); |
190 | 190 | ||
191 | SceneObjectPart part1 | 191 | SceneObjectPart part1 |
192 | = new SceneObjectPart( | 192 | = new SceneObjectPart( |
193 | UUID.Zero, shape, groupPosition, rotationOffset, offsetPosition); | 193 | UUID.Zero, shape, groupPosition, rotationOffset, offsetPosition); |
194 | part1.Name = part1Name; | 194 | part1.Name = part1Name; |
195 | SceneObjectGroup object1 = new SceneObjectGroup(part1); | 195 | SceneObjectGroup object1 = new SceneObjectGroup(part1); |
196 | 196 | ||
197 | string object1FileName = string.Format( | 197 | string object1FileName = string.Format( |
198 | "{0}_{1:000}-{2:000}-{3:000}__{4}.xml", | 198 | "{0}_{1:000}-{2:000}-{3:000}__{4}.xml", |
199 | part1Name, | 199 | part1Name, |
200 | Math.Round(groupPosition.X), Math.Round(groupPosition.Y), Math.Round(groupPosition.Z), | 200 | Math.Round(groupPosition.X), Math.Round(groupPosition.Y), Math.Round(groupPosition.Z), |
201 | part1.UUID); | 201 | part1.UUID); |
202 | tar.WriteFile(ArchiveConstants.OBJECTS_PATH + object1FileName, object1.ToXmlString2()); | 202 | tar.WriteFile(ArchiveConstants.OBJECTS_PATH + object1FileName, object1.ToXmlString2()); |
203 | 203 | ||
204 | tar.Close(); | 204 | tar.Close(); |
205 | 205 | ||
206 | MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray()); | 206 | MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray()); |
207 | 207 | ||
208 | SerialiserModule serialiserModule = new SerialiserModule(); | 208 | SerialiserModule serialiserModule = new SerialiserModule(); |
209 | ArchiverModule archiverModule = new ArchiverModule(); | 209 | ArchiverModule archiverModule = new ArchiverModule(); |
210 | 210 | ||
211 | Scene scene = SceneSetupHelpers.SetupScene(); | 211 | Scene scene = SceneSetupHelpers.SetupScene(); |
212 | SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); | 212 | SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); |
213 | 213 | ||
214 | archiverModule.DearchiveRegion(archiveReadStream); | 214 | archiverModule.DearchiveRegion(archiveReadStream); |
215 | 215 | ||
216 | SceneObjectPart object1PartLoaded = scene.GetSceneObjectPart(part1Name); | 216 | SceneObjectPart object1PartLoaded = scene.GetSceneObjectPart(part1Name); |
217 | 217 | ||
218 | Assert.That(object1PartLoaded, Is.Not.Null, "object1 was not loaded"); | 218 | Assert.That(object1PartLoaded, Is.Not.Null, "object1 was not loaded"); |
219 | Assert.That(object1PartLoaded.Name, Is.EqualTo(part1Name), "object1 names not identical"); | 219 | Assert.That(object1PartLoaded.Name, Is.EqualTo(part1Name), "object1 names not identical"); |
220 | Assert.That(object1PartLoaded.GroupPosition, Is.EqualTo(groupPosition), "object1 group position not equal"); | 220 | Assert.That(object1PartLoaded.GroupPosition, Is.EqualTo(groupPosition), "object1 group position not equal"); |
221 | Assert.That( | 221 | Assert.That( |
222 | object1PartLoaded.RotationOffset, Is.EqualTo(rotationOffset), "object1 rotation offset not equal"); | 222 | object1PartLoaded.RotationOffset, Is.EqualTo(rotationOffset), "object1 rotation offset not equal"); |
223 | Assert.That( | 223 | Assert.That( |
224 | object1PartLoaded.OffsetPosition, Is.EqualTo(offsetPosition), "object1 offset position not equal"); | 224 | object1PartLoaded.OffsetPosition, Is.EqualTo(offsetPosition), "object1 offset position not equal"); |
225 | 225 | ||
226 | // Temporary | 226 | // Temporary |
227 | Console.WriteLine("Successfully completed {0}", MethodBase.GetCurrentMethod()); | 227 | Console.WriteLine("Successfully completed {0}", MethodBase.GetCurrentMethod()); |
228 | } | 228 | } |
229 | 229 | ||
230 | /// <summary> | 230 | /// <summary> |
231 | /// Test merging a V0.2 OpenSim Region Archive into an existing scene | 231 | /// Test merging a V0.2 OpenSim Region Archive into an existing scene |
232 | /// </summary> | 232 | /// </summary> |
233 | ///[Test] | 233 | ///[Test] |
234 | public void TestMergeOarV0p2() | 234 | public void TestMergeOarV0p2() |
235 | { | 235 | { |
236 | //XmlConfigurator.Configure(); | 236 | //XmlConfigurator.Configure(); |
237 | 237 | ||
238 | MemoryStream archiveWriteStream = new MemoryStream(); | 238 | MemoryStream archiveWriteStream = new MemoryStream(); |
239 | 239 | ||
240 | string part2Name = "objectMerge"; | 240 | string part2Name = "objectMerge"; |
241 | PrimitiveBaseShape part2Shape = PrimitiveBaseShape.CreateCylinder(); | 241 | PrimitiveBaseShape part2Shape = PrimitiveBaseShape.CreateCylinder(); |
242 | Vector3 part2GroupPosition = new Vector3(90, 80, 70); | 242 | Vector3 part2GroupPosition = new Vector3(90, 80, 70); |
243 | Quaternion part2RotationOffset = new Quaternion(60, 70, 80, 90); | 243 | Quaternion part2RotationOffset = new Quaternion(60, 70, 80, 90); |
244 | Vector3 part2OffsetPosition = new Vector3(20, 25, 30); | 244 | Vector3 part2OffsetPosition = new Vector3(20, 25, 30); |
245 | 245 | ||
246 | // Create an oar file that we can use for the merge | 246 | // Create an oar file that we can use for the merge |
247 | { | 247 | { |
248 | ArchiverModule archiverModule = new ArchiverModule(); | 248 | ArchiverModule archiverModule = new ArchiverModule(); |
249 | SerialiserModule serialiserModule = new SerialiserModule(); | 249 | SerialiserModule serialiserModule = new SerialiserModule(); |
250 | TerrainModule terrainModule = new TerrainModule(); | 250 | TerrainModule terrainModule = new TerrainModule(); |
251 | 251 | ||
252 | Scene scene = SceneSetupHelpers.SetupScene(); | 252 | Scene scene = SceneSetupHelpers.SetupScene(); |
253 | SceneSetupHelpers.SetupSceneModules(scene, archiverModule, serialiserModule, terrainModule); | 253 | SceneSetupHelpers.SetupSceneModules(scene, archiverModule, serialiserModule, terrainModule); |
254 | 254 | ||
255 | SceneObjectPart part2 | 255 | SceneObjectPart part2 |
256 | = new SceneObjectPart( | 256 | = new SceneObjectPart( |
257 | UUID.Zero, part2Shape, part2GroupPosition, part2RotationOffset, part2OffsetPosition); | 257 | UUID.Zero, part2Shape, part2GroupPosition, part2RotationOffset, part2OffsetPosition); |
258 | part2.Name = part2Name; | 258 | part2.Name = part2Name; |
259 | SceneObjectGroup object2 = new SceneObjectGroup(part2); | 259 | SceneObjectGroup object2 = new SceneObjectGroup(part2); |
260 | 260 | ||
261 | scene.AddNewSceneObject(object2, false); | 261 | scene.AddNewSceneObject(object2, false); |
262 | 262 | ||
263 | // Write out this scene | 263 | // Write out this scene |
264 | scene.EventManager.OnOarFileSaved += SaveCompleted; | 264 | scene.EventManager.OnOarFileSaved += SaveCompleted; |
265 | 265 | ||
266 | lock (this) | 266 | lock (this) |
267 | { | 267 | { |
268 | archiverModule.ArchiveRegion(archiveWriteStream); | 268 | archiverModule.ArchiveRegion(archiveWriteStream); |
269 | Monitor.Wait(this, 60000); | 269 | Monitor.Wait(this, 60000); |
270 | } | 270 | } |
271 | } | 271 | } |
272 | 272 | ||
273 | { | 273 | { |
274 | ArchiverModule archiverModule = new ArchiverModule(); | 274 | ArchiverModule archiverModule = new ArchiverModule(); |
275 | SerialiserModule serialiserModule = new SerialiserModule(); | 275 | SerialiserModule serialiserModule = new SerialiserModule(); |
276 | TerrainModule terrainModule = new TerrainModule(); | 276 | TerrainModule terrainModule = new TerrainModule(); |
277 | 277 | ||
278 | Scene scene = SceneSetupHelpers.SetupScene(); | 278 | Scene scene = SceneSetupHelpers.SetupScene(); |
279 | SceneSetupHelpers.SetupSceneModules(scene, archiverModule, serialiserModule, terrainModule); | 279 | SceneSetupHelpers.SetupSceneModules(scene, archiverModule, serialiserModule, terrainModule); |
280 | 280 | ||
281 | string part1Name = "objectExisting"; | 281 | string part1Name = "objectExisting"; |
282 | PrimitiveBaseShape part1Shape = PrimitiveBaseShape.CreateCylinder(); | 282 | PrimitiveBaseShape part1Shape = PrimitiveBaseShape.CreateCylinder(); |
283 | Vector3 part1GroupPosition = new Vector3(80, 70, 60); | 283 | Vector3 part1GroupPosition = new Vector3(80, 70, 60); |
284 | Quaternion part1RotationOffset = new Quaternion(50, 60, 70, 80); | 284 | Quaternion part1RotationOffset = new Quaternion(50, 60, 70, 80); |
285 | Vector3 part1OffsetPosition = new Vector3(15, 20, 25); | 285 | Vector3 part1OffsetPosition = new Vector3(15, 20, 25); |
286 | 286 | ||
287 | SceneObjectPart part1 | 287 | SceneObjectPart part1 |
288 | = new SceneObjectPart( | 288 | = new SceneObjectPart( |
289 | UUID.Zero, part1Shape, part1GroupPosition, part1RotationOffset, part1OffsetPosition); | 289 | UUID.Zero, part1Shape, part1GroupPosition, part1RotationOffset, part1OffsetPosition); |
290 | part1.Name = part1Name; | 290 | part1.Name = part1Name; |
291 | SceneObjectGroup object1 = new SceneObjectGroup(part1); | 291 | SceneObjectGroup object1 = new SceneObjectGroup(part1); |
292 | 292 | ||
293 | scene.AddNewSceneObject(object1, false); | 293 | scene.AddNewSceneObject(object1, false); |
294 | 294 | ||
295 | // Merge in the archive we created earlier | 295 | // Merge in the archive we created earlier |
296 | byte[] archive = archiveWriteStream.ToArray(); | 296 | byte[] archive = archiveWriteStream.ToArray(); |
297 | MemoryStream archiveReadStream = new MemoryStream(archive); | 297 | MemoryStream archiveReadStream = new MemoryStream(archive); |
298 | 298 | ||
299 | archiverModule.DearchiveRegion(archiveReadStream, true); | 299 | archiverModule.DearchiveRegion(archiveReadStream, true); |
300 | 300 | ||
301 | SceneObjectPart object1Existing = scene.GetSceneObjectPart(part1Name); | 301 | SceneObjectPart object1Existing = scene.GetSceneObjectPart(part1Name); |
302 | Assert.That(object1Existing, Is.Not.Null, "object1 was not present after merge"); | 302 | Assert.That(object1Existing, Is.Not.Null, "object1 was not present after merge"); |
303 | Assert.That(object1Existing.Name, Is.EqualTo(part1Name), "object1 names not identical after merge"); | 303 | Assert.That(object1Existing.Name, Is.EqualTo(part1Name), "object1 names not identical after merge"); |
304 | Assert.That(object1Existing.GroupPosition, Is.EqualTo(part1GroupPosition), "object1 group position not equal after merge"); | 304 | Assert.That(object1Existing.GroupPosition, Is.EqualTo(part1GroupPosition), "object1 group position not equal after merge"); |
305 | 305 | ||
306 | SceneObjectPart object2PartMerged = scene.GetSceneObjectPart(part2Name); | 306 | SceneObjectPart object2PartMerged = scene.GetSceneObjectPart(part2Name); |
307 | Assert.That(object2PartMerged, Is.Not.Null, "object2 was not present after merge"); | 307 | Assert.That(object2PartMerged, Is.Not.Null, "object2 was not present after merge"); |
308 | Assert.That(object2PartMerged.Name, Is.EqualTo(part2Name), "object2 names not identical after merge"); | 308 | Assert.That(object2PartMerged.Name, Is.EqualTo(part2Name), "object2 names not identical after merge"); |
309 | Assert.That(object2PartMerged.GroupPosition, Is.EqualTo(part2GroupPosition), "object2 group position not equal after merge"); | 309 | Assert.That(object2PartMerged.GroupPosition, Is.EqualTo(part2GroupPosition), "object2 group position not equal after merge"); |
310 | } | 310 | } |
311 | } | 311 | } |
312 | } | 312 | } |
313 | } | 313 | } |