aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2010-01-29 21:33:11 +0000
committerJustin Clark-Casey (justincc)2010-01-29 21:33:11 +0000
commit055d991cc12f8c3720b41ffc314d95b8dbd7ce1a (patch)
treee3d56d70578c6d8c24648e90f667426a7784a29f
parentuse common part1 creation in ArchiverTests.TestLoadOarV0_2() (diff)
downloadopensim-SC-055d991cc12f8c3720b41ffc314d95b8dbd7ce1a.zip
opensim-SC-055d991cc12f8c3720b41ffc314d95b8dbd7ce1a.tar.gz
opensim-SC-055d991cc12f8c3720b41ffc314d95b8dbd7ce1a.tar.bz2
opensim-SC-055d991cc12f8c3720b41ffc314d95b8dbd7ce1a.tar.xz
minor: swap which part uses the automatically set up scene in TestMergeOarV0_2()
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs38
1 files changed, 13 insertions, 25 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
index a0958d1..930ea1c 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
@@ -225,18 +225,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
225 SceneObjectPart part1 = CreateSceneObjectPart1(); 225 SceneObjectPart part1 = CreateSceneObjectPart1();
226 SceneObjectGroup object1 = new SceneObjectGroup(part1); 226 SceneObjectGroup object1 = new SceneObjectGroup(part1);
227 227
228// string part1Name = "object1";
229// PrimitiveBaseShape shape = PrimitiveBaseShape.CreateCylinder();
230// Vector3 groupPosition = new Vector3(90, 80, 70);
231// Quaternion rotationOffset = new Quaternion(60, 70, 80, 90);
232// Vector3 offsetPosition = new Vector3(20, 25, 30);
233//
234// SceneObjectPart part1
235// = new SceneObjectPart(
236// UUID.Zero, shape, groupPosition, rotationOffset, offsetPosition);
237// part1.Name = part1Name;
238// SceneObjectGroup object1 = new SceneObjectGroup(part1);
239
240 // Let's put some inventory items into our object 228 // Let's put some inventory items into our object
241 string soundItemName = "sound-item1"; 229 string soundItemName = "sound-item1";
242 UUID soundItemUuid = UUID.Parse("00000000-0000-0000-0000-000000000002"); 230 UUID soundItemUuid = UUID.Parse("00000000-0000-0000-0000-000000000002");
@@ -429,16 +417,23 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
429 417
430 // Create an oar file that we can use for the merge 418 // Create an oar file that we can use for the merge
431 { 419 {
420 ArchiverModule archiverModule = new ArchiverModule();
421 SerialiserModule serialiserModule = new SerialiserModule();
422 TerrainModule terrainModule = new TerrainModule();
423
424 Scene scene = SceneSetupHelpers.SetupScene();
425 SceneSetupHelpers.SetupSceneModules(scene, archiverModule, serialiserModule, terrainModule);
426
432 SceneObjectPart part2 427 SceneObjectPart part2
433 = new SceneObjectPart( 428 = new SceneObjectPart(
434 UUID.Zero, part2Shape, part2GroupPosition, part2RotationOffset, part2OffsetPosition); 429 UUID.Zero, part2Shape, part2GroupPosition, part2RotationOffset, part2OffsetPosition);
435 part2.Name = part2Name; 430 part2.Name = part2Name;
436 SceneObjectGroup object2 = new SceneObjectGroup(part2); 431 SceneObjectGroup object2 = new SceneObjectGroup(part2);
437 432
438 m_scene.AddNewSceneObject(object2, false); 433 scene.AddNewSceneObject(object2, false);
439 434
440 // Write out this scene 435 // Write out this scene
441 m_scene.EventManager.OnOarFileSaved += SaveCompleted; 436 scene.EventManager.OnOarFileSaved += SaveCompleted;
442 437
443 lock (this) 438 lock (this)
444 { 439 {
@@ -448,13 +443,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
448 } 443 }
449 444
450 { 445 {
451 ArchiverModule archiverModule = new ArchiverModule();
452 SerialiserModule serialiserModule = new SerialiserModule();
453 TerrainModule terrainModule = new TerrainModule();
454
455 Scene scene = SceneSetupHelpers.SetupScene();
456 SceneSetupHelpers.SetupSceneModules(scene, archiverModule, serialiserModule, terrainModule);
457
458 string part1Name = "objectExisting"; 446 string part1Name = "objectExisting";
459 PrimitiveBaseShape part1Shape = PrimitiveBaseShape.CreateCylinder(); 447 PrimitiveBaseShape part1Shape = PrimitiveBaseShape.CreateCylinder();
460 Vector3 part1GroupPosition = new Vector3(80, 70, 60); 448 Vector3 part1GroupPosition = new Vector3(80, 70, 60);
@@ -467,20 +455,20 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
467 part1.Name = part1Name; 455 part1.Name = part1Name;
468 SceneObjectGroup object1 = new SceneObjectGroup(part1); 456 SceneObjectGroup object1 = new SceneObjectGroup(part1);
469 457
470 scene.AddNewSceneObject(object1, false); 458 m_scene.AddNewSceneObject(object1, false);
471 459
472 // Merge in the archive we created earlier 460 // Merge in the archive we created earlier
473 byte[] archive = archiveWriteStream.ToArray(); 461 byte[] archive = archiveWriteStream.ToArray();
474 MemoryStream archiveReadStream = new MemoryStream(archive); 462 MemoryStream archiveReadStream = new MemoryStream(archive);
475 463
476 archiverModule.DearchiveRegion(archiveReadStream, true, Guid.Empty); 464 m_archiverModule.DearchiveRegion(archiveReadStream, true, Guid.Empty);
477 465
478 SceneObjectPart object1Existing = scene.GetSceneObjectPart(part1Name); 466 SceneObjectPart object1Existing = m_scene.GetSceneObjectPart(part1Name);
479 Assert.That(object1Existing, Is.Not.Null, "object1 was not present after merge"); 467 Assert.That(object1Existing, Is.Not.Null, "object1 was not present after merge");
480 Assert.That(object1Existing.Name, Is.EqualTo(part1Name), "object1 names not identical after merge"); 468 Assert.That(object1Existing.Name, Is.EqualTo(part1Name), "object1 names not identical after merge");
481 Assert.That(object1Existing.GroupPosition, Is.EqualTo(part1GroupPosition), "object1 group position not equal after merge"); 469 Assert.That(object1Existing.GroupPosition, Is.EqualTo(part1GroupPosition), "object1 group position not equal after merge");
482 470
483 SceneObjectPart object2PartMerged = scene.GetSceneObjectPart(part2Name); 471 SceneObjectPart object2PartMerged = m_scene.GetSceneObjectPart(part2Name);
484 Assert.That(object2PartMerged, Is.Not.Null, "object2 was not present after merge"); 472 Assert.That(object2PartMerged, Is.Not.Null, "object2 was not present after merge");
485 Assert.That(object2PartMerged.Name, Is.EqualTo(part2Name), "object2 names not identical after merge"); 473 Assert.That(object2PartMerged.Name, Is.EqualTo(part2Name), "object2 names not identical after merge");
486 Assert.That(object2PartMerged.GroupPosition, Is.EqualTo(part2GroupPosition), "object2 group position not equal after merge"); 474 Assert.That(object2PartMerged.GroupPosition, Is.EqualTo(part2GroupPosition), "object2 group position not equal after merge");