aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorJustin Clarke Casey2009-02-10 16:56:35 +0000
committerJustin Clarke Casey2009-02-10 16:56:35 +0000
commit879338499f8921b1eb576f47a2b141b95c43f6af (patch)
tree647a9672619a48d68b78fc018092ea1bf39eeb6f /OpenSim/Region
parent* Ignored some gens (diff)
downloadopensim-SC_OLD-879338499f8921b1eb576f47a2b141b95c43f6af.zip
opensim-SC_OLD-879338499f8921b1eb576f47a2b141b95c43f6af.tar.gz
opensim-SC_OLD-879338499f8921b1eb576f47a2b141b95c43f6af.tar.bz2
opensim-SC_OLD-879338499f8921b1eb576f47a2b141b95c43f6af.tar.xz
* extend load oar test to check that an object was actually loaded
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs42
1 files changed, 37 insertions, 5 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
index a14e0f6..77a3044 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
@@ -57,7 +57,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
57 [Test] 57 [Test]
58 public void TestSaveOarV0p2() 58 public void TestSaveOarV0p2()
59 { 59 {
60 log4net.Config.XmlConfigurator.Configure(); 60 //log4net.Config.XmlConfigurator.Configure();
61 61
62 ArchiverModule archiverModule = new ArchiverModule(); 62 ArchiverModule archiverModule = new ArchiverModule();
63 SerialiserModule serialiserModule = new SerialiserModule(); 63 SerialiserModule serialiserModule = new SerialiserModule();
@@ -162,27 +162,59 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
162 } 162 }
163 163
164 /// <summary> 164 /// <summary>
165 /// Test loading a V0.2 OpenSim Region Archive. Does not yet do what it says on the tin. 165 /// Test loading a V0.2 OpenSim Region Archive.
166 /// </summary> 166 /// </summary>
167 [Test] 167 [Test]
168 public void TestLoadOarV0p2() 168 public void TestLoadOarV0p2()
169 { 169 {
170 log4net.Config.XmlConfigurator.Configure();
171
170 MemoryStream archiveWriteStream = new MemoryStream(); 172 MemoryStream archiveWriteStream = new MemoryStream();
171 TarArchiveWriter tar = new TarArchiveWriter(); 173 TarArchiveWriter tar = new TarArchiveWriter();
172 174
173 tar.AddFile(ArchiveConstants.CONTROL_FILE_PATH, ArchiveWriteRequestExecution.Create0p2ControlFile()); 175 tar.AddFile(ArchiveConstants.CONTROL_FILE_PATH, ArchiveWriteRequestExecution.Create0p2ControlFile());
176
177 UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000020");
178 string part1Name = "object1";
179 PrimitiveBaseShape shape = PrimitiveBaseShape.CreateCylinder();
180 Vector3 groupPosition = new Vector3(90, 80, 70);
181 Quaternion rotationOffset = new Quaternion(60, 70, 80, 90);
182 Vector3 offsetPosition = new Vector3(20, 25, 30);
183
184 SceneObjectPart part1
185 = new SceneObjectPart(
186 UUID.Zero, shape, groupPosition, rotationOffset, offsetPosition);
187 part1.Name = part1Name;
188 SceneObjectGroup object1 = new SceneObjectGroup(part1);
189
190 string object1FileName = string.Format(
191 "{0}_{1:000}-{2:000}-{3:000}__{4}.xml",
192 part1Name,
193 Math.Round(groupPosition.X), Math.Round(groupPosition.Y), Math.Round(groupPosition.Z),
194 part1.UUID);
195 tar.AddFile(ArchiveConstants.OBJECTS_PATH + object1FileName, object1.ToXmlString2());
196
174 tar.WriteTar(archiveWriteStream); 197 tar.WriteTar(archiveWriteStream);
175 198
176 MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray()); 199 MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray());
177 200
201 SerialiserModule serialiserModule = new SerialiserModule();
178 ArchiverModule archiverModule = new ArchiverModule(); 202 ArchiverModule archiverModule = new ArchiverModule();
179 203
180 Scene scene = SceneSetupHelpers.SetupScene(); 204 Scene scene = SceneSetupHelpers.SetupScene();
181 SceneSetupHelpers.SetupSceneModules(scene, archiverModule); 205 SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule);
182 206
183 archiverModule.DearchiveRegion(archiveReadStream); 207 archiverModule.DearchiveRegion(archiveReadStream);
184 208
185 // TODO: Okay, so nothing is tested yet apart from the fact that it doesn't blow up 209 SceneObjectPart object1PartLoaded = scene.GetSceneObjectPart(part1Name);
210
211 Assert.That(object1PartLoaded, Is.Not.Null, "object1 was not loaded");
212 Assert.That(object1PartLoaded.Name, Is.EqualTo(part1Name), "object1 names not identical");
213 Assert.That(object1PartLoaded.GroupPosition, Is.EqualTo(groupPosition), "object1 group position not equal");
214 Assert.That(
215 object1PartLoaded.RotationOffset, Is.EqualTo(rotationOffset), "object1 rotation offset not equal");
216 Assert.That(
217 object1PartLoaded.OffsetPosition, Is.EqualTo(offsetPosition), "object1 offset position not equal");
186 } 218 }
187 } 219 }
188} \ No newline at end of file 220} \ No newline at end of file