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