aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2010-01-29 21:10:14 +0000
committerJustin Clark-Casey (justincc)2010-01-29 21:10:14 +0000
commit115e66218eaa6ca4fed8b754765e4c289c24a207 (patch)
treebfff12b424525beb27b4e0a7bc068aaee5ac6a9d /OpenSim
parentfactor out scene setup in ArchiverTests (diff)
downloadopensim-SC_OLD-115e66218eaa6ca4fed8b754765e4c289c24a207.zip
opensim-SC_OLD-115e66218eaa6ca4fed8b754765e4c289c24a207.tar.gz
opensim-SC_OLD-115e66218eaa6ca4fed8b754765e4c289c24a207.tar.bz2
opensim-SC_OLD-115e66218eaa6ca4fed8b754765e4c289c24a207.tar.xz
refactor out scene object 1 creation n ArchiverTetss
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs66
1 files changed, 22 insertions, 44 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
index 5a177b2..b4af8a6 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
@@ -55,6 +55,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
55 55
56 protected TestScene m_scene; 56 protected TestScene m_scene;
57 protected ArchiverModule m_archiverModule; 57 protected ArchiverModule m_archiverModule;
58
59 protected SceneObjectPart m_part1;
58 60
59 [SetUp] 61 [SetUp]
60 public void SetUp() 62 public void SetUp()
@@ -90,22 +92,20 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
90 } 92 }
91 } 93 }
92 94
93// protected void AddSceneObject1() 95 protected void AddSceneObject1()
94// { 96 {
95// string partName = "My Little Pony"; 97 string partName = "My Little Pony";
96// UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000015"); 98 UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000015");
97// PrimitiveBaseShape shape = PrimitiveBaseShape.CreateSphere(); 99 PrimitiveBaseShape shape = PrimitiveBaseShape.CreateSphere();
98// Vector3 groupPosition = new Vector3(10, 20, 30); 100 Vector3 groupPosition = new Vector3(10, 20, 30);
99// Quaternion rotationOffset = new Quaternion(20, 30, 40, 50); 101 Quaternion rotationOffset = new Quaternion(20, 30, 40, 50);
100// Vector3 offsetPosition = new Vector3(5, 10, 15); 102 Vector3 offsetPosition = new Vector3(5, 10, 15);
101// 103
102// part1 104 m_part1
103// = new SceneObjectPart( 105 = new SceneObjectPart(ownerId, shape, groupPosition, rotationOffset, offsetPosition) { Name = partName };
104// ownerId, shape, groupPosition, rotationOffset, offsetPosition); 106
105// part1.Name = partName; 107 m_scene.AddNewSceneObject(new SceneObjectGroup(m_part1), false);
106// 108 }
107// scene.AddNewSceneObject(new SceneObjectGroup(part1), false);
108// }
109 109
110 /// <summary> 110 /// <summary>
111 /// Test saving a V0.2 OpenSim Region Archive. 111 /// Test saving a V0.2 OpenSim Region Archive.
@@ -116,24 +116,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
116 TestHelper.InMethod(); 116 TestHelper.InMethod();
117 //log4net.Config.XmlConfigurator.Configure(); 117 //log4net.Config.XmlConfigurator.Configure();
118 118
119 SceneObjectPart part1; 119 AddSceneObject1();
120
121 // Create and add prim 1
122 {
123 string partName = "My Little Pony";
124 UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000015");
125 PrimitiveBaseShape shape = PrimitiveBaseShape.CreateSphere();
126 Vector3 groupPosition = new Vector3(10, 20, 30);
127 Quaternion rotationOffset = new Quaternion(20, 30, 40, 50);
128 Vector3 offsetPosition = new Vector3(5, 10, 15);
129
130 part1
131 = new SceneObjectPart(
132 ownerId, shape, groupPosition, rotationOffset, offsetPosition);
133 part1.Name = partName;
134
135 m_scene.AddNewSceneObject(new SceneObjectGroup(part1), false);
136 }
137 120
138 SceneObjectPart part2; 121 SceneObjectPart part2;
139 122
@@ -180,9 +163,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
180 bool gotObject2File = false; 163 bool gotObject2File = false;
181 string expectedObject1FileName = string.Format( 164 string expectedObject1FileName = string.Format(
182 "{0}_{1:000}-{2:000}-{3:000}__{4}.xml", 165 "{0}_{1:000}-{2:000}-{3:000}__{4}.xml",
183 part1.Name, 166 m_part1.Name,
184 Math.Round(part1.GroupPosition.X), Math.Round(part1.GroupPosition.Y), Math.Round(part1.GroupPosition.Z), 167 Math.Round(m_part1.GroupPosition.X), Math.Round(m_part1.GroupPosition.Y), Math.Round(m_part1.GroupPosition.Z),
185 part1.UUID); 168 m_part1.UUID);
186 string expectedObject2FileName = string.Format( 169 string expectedObject2FileName = string.Format(
187 "{0}_{1:000}-{2:000}-{3:000}__{4}.xml", 170 "{0}_{1:000}-{2:000}-{3:000}__{4}.xml",
188 part2.Name, 171 part2.Name,
@@ -202,7 +185,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
202 { 185 {
203 string fileName = filePath.Remove(0, ArchiveConstants.OBJECTS_PATH.Length); 186 string fileName = filePath.Remove(0, ArchiveConstants.OBJECTS_PATH.Length);
204 187
205 if (fileName.StartsWith(part1.Name)) 188 if (fileName.StartsWith(m_part1.Name))
206 { 189 {
207 Assert.That(fileName, Is.EqualTo(expectedObject1FileName)); 190 Assert.That(fileName, Is.EqualTo(expectedObject1FileName));
208 gotObject1File = true; 191 gotObject1File = true;
@@ -243,18 +226,13 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
243 226
244 tar.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, ArchiveWriteRequestExecution.Create0p2ControlFile()); 227 tar.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, ArchiveWriteRequestExecution.Create0p2ControlFile());
245 228
229 AddSceneObject1();
246 string part1Name = "object1"; 230 string part1Name = "object1";
247 PrimitiveBaseShape shape = PrimitiveBaseShape.CreateCylinder(); 231 PrimitiveBaseShape shape = PrimitiveBaseShape.CreateCylinder();
248 Vector3 groupPosition = new Vector3(90, 80, 70); 232 Vector3 groupPosition = new Vector3(90, 80, 70);
249 Quaternion rotationOffset = new Quaternion(60, 70, 80, 90); 233 Quaternion rotationOffset = new Quaternion(60, 70, 80, 90);
250 Vector3 offsetPosition = new Vector3(20, 25, 30); 234 Vector3 offsetPosition = new Vector3(20, 25, 30);
251 235
252// SerialiserModule serialiserModule = new SerialiserModule();
253// ArchiverModule archiverModule = new ArchiverModule();
254//
255// Scene scene = SceneSetupHelpers.SetupScene();
256// SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule);
257
258 SceneObjectPart part1 236 SceneObjectPart part1
259 = new SceneObjectPart( 237 = new SceneObjectPart(
260 UUID.Zero, shape, groupPosition, rotationOffset, offsetPosition); 238 UUID.Zero, shape, groupPosition, rotationOffset, offsetPosition);