refactor out scene object 1 creation n ArchiverTetss
parent
c1da07e4eb
commit
115e66218e
|
@ -56,6 +56,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
|
|||
protected TestScene m_scene;
|
||||
protected ArchiverModule m_archiverModule;
|
||||
|
||||
protected SceneObjectPart m_part1;
|
||||
|
||||
[SetUp]
|
||||
public void SetUp()
|
||||
{
|
||||
|
@ -90,22 +92,20 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
|
|||
}
|
||||
}
|
||||
|
||||
// protected void AddSceneObject1()
|
||||
// {
|
||||
// string partName = "My Little Pony";
|
||||
// UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000015");
|
||||
// PrimitiveBaseShape shape = PrimitiveBaseShape.CreateSphere();
|
||||
// Vector3 groupPosition = new Vector3(10, 20, 30);
|
||||
// Quaternion rotationOffset = new Quaternion(20, 30, 40, 50);
|
||||
// Vector3 offsetPosition = new Vector3(5, 10, 15);
|
||||
//
|
||||
// part1
|
||||
// = new SceneObjectPart(
|
||||
// ownerId, shape, groupPosition, rotationOffset, offsetPosition);
|
||||
// part1.Name = partName;
|
||||
//
|
||||
// scene.AddNewSceneObject(new SceneObjectGroup(part1), false);
|
||||
// }
|
||||
protected void AddSceneObject1()
|
||||
{
|
||||
string partName = "My Little Pony";
|
||||
UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000015");
|
||||
PrimitiveBaseShape shape = PrimitiveBaseShape.CreateSphere();
|
||||
Vector3 groupPosition = new Vector3(10, 20, 30);
|
||||
Quaternion rotationOffset = new Quaternion(20, 30, 40, 50);
|
||||
Vector3 offsetPosition = new Vector3(5, 10, 15);
|
||||
|
||||
m_part1
|
||||
= new SceneObjectPart(ownerId, shape, groupPosition, rotationOffset, offsetPosition) { Name = partName };
|
||||
|
||||
m_scene.AddNewSceneObject(new SceneObjectGroup(m_part1), false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test saving a V0.2 OpenSim Region Archive.
|
||||
|
@ -116,24 +116,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
|
|||
TestHelper.InMethod();
|
||||
//log4net.Config.XmlConfigurator.Configure();
|
||||
|
||||
SceneObjectPart part1;
|
||||
|
||||
// Create and add prim 1
|
||||
{
|
||||
string partName = "My Little Pony";
|
||||
UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000015");
|
||||
PrimitiveBaseShape shape = PrimitiveBaseShape.CreateSphere();
|
||||
Vector3 groupPosition = new Vector3(10, 20, 30);
|
||||
Quaternion rotationOffset = new Quaternion(20, 30, 40, 50);
|
||||
Vector3 offsetPosition = new Vector3(5, 10, 15);
|
||||
|
||||
part1
|
||||
= new SceneObjectPart(
|
||||
ownerId, shape, groupPosition, rotationOffset, offsetPosition);
|
||||
part1.Name = partName;
|
||||
|
||||
m_scene.AddNewSceneObject(new SceneObjectGroup(part1), false);
|
||||
}
|
||||
AddSceneObject1();
|
||||
|
||||
SceneObjectPart part2;
|
||||
|
||||
|
@ -180,9 +163,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
|
|||
bool gotObject2File = false;
|
||||
string expectedObject1FileName = string.Format(
|
||||
"{0}_{1:000}-{2:000}-{3:000}__{4}.xml",
|
||||
part1.Name,
|
||||
Math.Round(part1.GroupPosition.X), Math.Round(part1.GroupPosition.Y), Math.Round(part1.GroupPosition.Z),
|
||||
part1.UUID);
|
||||
m_part1.Name,
|
||||
Math.Round(m_part1.GroupPosition.X), Math.Round(m_part1.GroupPosition.Y), Math.Round(m_part1.GroupPosition.Z),
|
||||
m_part1.UUID);
|
||||
string expectedObject2FileName = string.Format(
|
||||
"{0}_{1:000}-{2:000}-{3:000}__{4}.xml",
|
||||
part2.Name,
|
||||
|
@ -202,7 +185,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
|
|||
{
|
||||
string fileName = filePath.Remove(0, ArchiveConstants.OBJECTS_PATH.Length);
|
||||
|
||||
if (fileName.StartsWith(part1.Name))
|
||||
if (fileName.StartsWith(m_part1.Name))
|
||||
{
|
||||
Assert.That(fileName, Is.EqualTo(expectedObject1FileName));
|
||||
gotObject1File = true;
|
||||
|
@ -243,18 +226,13 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
|
|||
|
||||
tar.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, ArchiveWriteRequestExecution.Create0p2ControlFile());
|
||||
|
||||
AddSceneObject1();
|
||||
string part1Name = "object1";
|
||||
PrimitiveBaseShape shape = PrimitiveBaseShape.CreateCylinder();
|
||||
Vector3 groupPosition = new Vector3(90, 80, 70);
|
||||
Quaternion rotationOffset = new Quaternion(60, 70, 80, 90);
|
||||
Vector3 offsetPosition = new Vector3(20, 25, 30);
|
||||
|
||||
// SerialiserModule serialiserModule = new SerialiserModule();
|
||||
// ArchiverModule archiverModule = new ArchiverModule();
|
||||
//
|
||||
// Scene scene = SceneSetupHelpers.SetupScene();
|
||||
// SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule);
|
||||
|
||||
SceneObjectPart part1
|
||||
= new SceneObjectPart(
|
||||
UUID.Zero, shape, groupPosition, rotationOffset, offsetPosition);
|
||||
|
|
Loading…
Reference in New Issue