aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Serialization/Tests/LandDataSerializerTests.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-02-03 22:21:54 +0000
committerJustin Clark-Casey (justincc)2012-02-03 22:21:54 +0000
commitf17066b7bf27c22448d883e0af9d20a42f671b62 (patch)
treec1b4fed29d33d2055dd990fd53c616a8fe1e8f60 /OpenSim/Framework/Serialization/Tests/LandDataSerializerTests.cs
parentCorrected console help texts for "save iar" (diff)
downloadopensim-SC-f17066b7bf27c22448d883e0af9d20a42f671b62.zip
opensim-SC-f17066b7bf27c22448d883e0af9d20a42f671b62.tar.gz
opensim-SC-f17066b7bf27c22448d883e0af9d20a42f671b62.tar.bz2
opensim-SC-f17066b7bf27c22448d883e0af9d20a42f671b62.tar.xz
Change LandDataSerializer deserialization so that in the future it won't care about extra elements or element order.
This brings it into line with other deserializations such as object and will improve future backward compatibility.
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Serialization/Tests/LandDataSerializerTests.cs37
1 files changed, 26 insertions, 11 deletions
diff --git a/OpenSim/Framework/Serialization/Tests/LandDataSerializerTests.cs b/OpenSim/Framework/Serialization/Tests/LandDataSerializerTests.cs
index 3607ce8..11a3a0a 100644
--- a/OpenSim/Framework/Serialization/Tests/LandDataSerializerTests.cs
+++ b/OpenSim/Framework/Serialization/Tests/LandDataSerializerTests.cs
@@ -27,11 +27,12 @@
27 27
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using OpenSim.Framework;
31using OpenSim.Framework.Serialization.External;
32using OpenMetaverse; 30using OpenMetaverse;
33using OpenMetaverse.StructuredData; 31using OpenMetaverse.StructuredData;
34using NUnit.Framework; 32using NUnit.Framework;
33using OpenSim.Framework;
34using OpenSim.Framework.Serialization.External;
35using OpenSim.Tests.Common;
35 36
36namespace OpenSim.Framework.Serialization.Tests 37namespace OpenSim.Framework.Serialization.Tests
37{ 38{
@@ -92,6 +93,8 @@ namespace OpenSim.Framework.Serialization.Tests
92 [Test] 93 [Test]
93 public void LandDataSerializerSerializeTest() 94 public void LandDataSerializerSerializeTest()
94 { 95 {
96 TestHelpers.InMethod();
97
95 string serialized = LandDataSerializer.Serialize(this.land).Replace("\r\n", "\n"); 98 string serialized = LandDataSerializer.Serialize(this.land).Replace("\r\n", "\n");
96 Assert.That(serialized.Length > 0, "Serialize(LandData) returned empty string"); 99 Assert.That(serialized.Length > 0, "Serialize(LandData) returned empty string");
97 100
@@ -112,20 +115,32 @@ namespace OpenSim.Framework.Serialization.Tests
112 /// Test the LandDataSerializer.Deserialize() method 115 /// Test the LandDataSerializer.Deserialize() method
113 /// </summary> 116 /// </summary>
114 [Test] 117 [Test]
115 public void TestLandDataSerializerDeserializeFromStringTest() 118 public void TestLandDataDeserializeNoAccessLists()
119 {
120 TestHelpers.InMethod();
121 log4net.Config.XmlConfigurator.Configure();
122
123 LandData ld = LandDataSerializer.Deserialize(LandDataSerializerTest.preSerialized);
124 Assert.That(ld != null, "Deserialize(string) returned null");
125 Assert.That(ld.GlobalID == this.land.GlobalID, "Reified LandData.GlobalID != original LandData.GlobalID");
126 Assert.That(ld.Name == this.land.Name, "Reified LandData.Name != original LandData.Name");
127 }
128
129 [Test]
130 public void TestLandDataDeserializeWithAccessLists()
116 { 131 {
117 LandData reifiedLandData = LandDataSerializer.Deserialize(LandDataSerializerTest.preSerialized); 132 TestHelpers.InMethod();
118 Assert.That(reifiedLandData != null, "Deserialize(string) returned null"); 133// log4net.Config.XmlConfigurator.Configure();
119 Assert.That(reifiedLandData.GlobalID == this.land.GlobalID, "Reified LandData.GlobalID != original LandData.GlobalID");
120 Assert.That(reifiedLandData.Name == this.land.Name, "Reified LandData.Name != original LandData.Name");
121 134
122 LandData reifiedLandDataWithParcelAccessList = LandDataSerializer.Deserialize(LandDataSerializerTest.preSerializedWithParcelAccessList); 135 LandData ld = LandDataSerializer.Deserialize(LandDataSerializerTest.preSerializedWithParcelAccessList);
123 Assert.That(reifiedLandDataWithParcelAccessList != null, 136 Assert.That(ld != null,
124 "Deserialize(string) returned null (pre-serialized with parcel access list)"); 137 "Deserialize(string) returned null (pre-serialized with parcel access list)");
125 Assert.That(reifiedLandDataWithParcelAccessList.GlobalID == this.landWithParcelAccessList.GlobalID, 138 Assert.That(ld.GlobalID == this.landWithParcelAccessList.GlobalID,
126 "Reified LandData.GlobalID != original LandData.GlobalID (pre-serialized with parcel access list)"); 139 "Reified LandData.GlobalID != original LandData.GlobalID (pre-serialized with parcel access list)");
127 Assert.That(reifiedLandDataWithParcelAccessList.Name == this.landWithParcelAccessList.Name, 140 Assert.That(ld.Name == this.landWithParcelAccessList.Name,
128 "Reified LandData.Name != original LandData.Name (pre-serialized with parcel access list)"); 141 "Reified LandData.Name != original LandData.Name (pre-serialized with parcel access list)");
142 Assert.That(ld.ParcelAccessList.Count, Is.EqualTo(2));
143 Assert.That(ld.ParcelAccessList[0].AgentID, Is.EqualTo(UUID.Parse("62d65d45-c91a-4f77-862c-46557d978b6c")));
129 } 144 }
130 } 145 }
131} 146}