* Add simple original sog xml serialization test

0.6.6-post-fixes
Justin Clarke Casey 2009-06-01 18:03:51 +00:00
parent f6badc528b
commit 412295ccde
3 changed files with 22 additions and 21 deletions

View File

@ -121,7 +121,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser
public void SaveNamedPrimsToXml2(Scene scene, string primName, string fileName) public void SaveNamedPrimsToXml2(Scene scene, string primName, string fileName)
{ {
SceneXmlLoader.SaveNamedPrimsToXml2(scene, primName, fileName); SceneXmlLoader.SaveNamedPrimsToXml2(scene, primName, fileName);
} }
public SceneObjectGroup DeserializeGroupFromXml2(string xmlString) public SceneObjectGroup DeserializeGroupFromXml2(string xmlString)
{ {

View File

@ -31,6 +31,7 @@ using NUnit.Framework.SyntaxHelpers;
using OpenMetaverse; using OpenMetaverse;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Framework.Scenes;
using OpenSim.Region.Framework.Scenes.Serialization;
using OpenSim.Tests.Common; using OpenSim.Tests.Common;
using OpenSim.Tests.Common.Setup; using OpenSim.Tests.Common.Setup;
using System.IO; using System.IO;
@ -53,7 +54,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
<ObjectFlags>0</ObjectFlags> <ObjectFlags>0</ObjectFlags>
<UUID><Guid>e6a5a05e-e8cc-4816-8701-04165e335790</Guid></UUID> <UUID><Guid>e6a5a05e-e8cc-4816-8701-04165e335790</Guid></UUID>
<LocalId>2698615125</LocalId> <LocalId>2698615125</LocalId>
<Name>Primitive</Name> <Name>PrimMyRide</Name>
<Material>0</Material> <Material>0</Material>
<PassTouches>false</PassTouches> <PassTouches>false</PassTouches>
<RegionHandle>1099511628032000</RegionHandle> <RegionHandle>1099511628032000</RegionHandle>
@ -241,21 +242,21 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
SceneSetupHelpers.SetupSceneModules(m_scene, m_serialiserModule); SceneSetupHelpers.SetupSceneModules(m_scene, m_serialiserModule);
} }
// [Test] [Test]
// public void TestLoadXml() public void TestSerializeXml()
// { {
// TestHelper.InMethod(); TestHelper.InMethod();
// //log4net.Config.XmlConfigurator.Configure(); //log4net.Config.XmlConfigurator.Configure();
//
// SceneObjectGroup so = m_serialiserModule.DeserializeGroupFromXml2(xml2); SceneObjectGroup so = SceneObjectSerializer.FromOriginalXmlFormat(xml);
// SceneObjectPart rootPart = so.RootPart; SceneObjectPart rootPart = so.RootPart;
//
// Assert.That(rootPart.UUID, Is.EqualTo(new UUID("9be68fdd-f740-4a0f-9675-dfbbb536b946"))); Assert.That(rootPart.UUID, Is.EqualTo(new UUID("e6a5a05e-e8cc-4816-8701-04165e335790")));
// Assert.That(rootPart.CreatorID, Is.EqualTo(new UUID("b46ef588-411e-4a8b-a284-d7dcfe8e74ef"))); Assert.That(rootPart.CreatorID, Is.EqualTo(new UUID("a6dacf01-4636-4bb9-8a97-30609438af9d")));
// Assert.That(rootPart.Name, Is.EqualTo("PrimFun")); Assert.That(rootPart.Name, Is.EqualTo("PrimMyRide"));
//
// // TODO: Check other properties // TODO: Check other properties
// } }
[Test] [Test]
public void TestDeserializeXml2() public void TestDeserializeXml2()

View File

@ -103,13 +103,13 @@ namespace OpenSim.Region.Framework.Interfaces
/// <param name="max"></param> /// <param name="max"></param>
void SavePrimListToXml2(List<EntityBase> entityList, TextWriter stream, Vector3 min, Vector3 max); void SavePrimListToXml2(List<EntityBase> entityList, TextWriter stream, Vector3 min, Vector3 max);
void SaveNamedPrimsToXml2(Scene scene, string primName, string fileName); void SaveNamedPrimsToXml2(Scene scene, string primName, string fileName);
/// <summary> /// <summary>
/// Deserializes a scene object from its xml2 representation. This does not load the object into the scene. /// Deserializes a scene object from its xml2 representation. This does not load the object into the scene.
/// </summary> /// </summary>
/// <param name="xmlString"></param> /// <param name="xmlString"></param>
/// <returns>The scene object created. null if the scene object already existed</returns> /// <returns>The scene object created</returns>
SceneObjectGroup DeserializeGroupFromXml2(string xmlString); SceneObjectGroup DeserializeGroupFromXml2(string xmlString);
/// <summary> /// <summary>
@ -117,6 +117,6 @@ namespace OpenSim.Region.Framework.Interfaces
/// </summary> /// </summary>
/// <param name="grp"></param> /// <param name="grp"></param>
/// <returns></returns> /// <returns></returns>
string SerializeGroupToXml2(SceneObjectGroup grp); string SerializeGroupToXml2(SceneObjectGroup grp);
} }
} }