aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs
diff options
context:
space:
mode:
authoronefang2019-05-19 21:24:15 +1000
committeronefang2019-05-19 21:24:15 +1000
commit5e4d6cab00cb29cd088ab7b62ab13aff103b64cb (patch)
treea9fbc62df9eb2d1d9ba2698d8552eae71eca20d8 /OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs
parentAdd a build script. (diff)
downloadopensim-SC_OLD-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.zip
opensim-SC_OLD-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.gz
opensim-SC_OLD-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.bz2
opensim-SC_OLD-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.xz
Dump OpenSim 0.9.0.1 into it's own branch.
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs')
-rw-r--r--OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs28
1 files changed, 16 insertions, 12 deletions
diff --git a/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs b/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs
index a5bb1a7..23475a1 100644
--- a/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs
+++ b/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs
@@ -43,7 +43,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
43 [TestFixture] 43 [TestFixture]
44 public class SerialiserTests : OpenSimTestCase 44 public class SerialiserTests : OpenSimTestCase
45 { 45 {
46 private const string ObjectRootPartStubXml = 46 private const string ObjectRootPartStubXml =
47@"<SceneObjectGroup> 47@"<SceneObjectGroup>
48 <RootPart> 48 <RootPart>
49 <SceneObjectPart xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema""> 49 <SceneObjectPart xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">
@@ -149,9 +149,9 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
149 <llsd> 149 <llsd>
150 <map> 150 <map>
151 <key>MyNamespace</key> 151 <key>MyNamespace</key>
152 <map> 152 <map>
153 <key>MyStore</key> 153 <key>MyStore</key>
154 <map> 154 <map>
155 <key>the answer</key> 155 <key>the answer</key>
156 <integer>42</integer> 156 <integer>42</integer>
157 </map> 157 </map>
@@ -162,12 +162,12 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
162 </SceneObjectPart> 162 </SceneObjectPart>
163 </RootPart>"; 163 </RootPart>";
164 164
165 private const string ObjectWithNoOtherPartsXml = ObjectRootPartStubXml + 165 private const string ObjectWithNoOtherPartsXml = ObjectRootPartStubXml +
166@" 166@"
167 <OtherParts /> 167 <OtherParts />
168</SceneObjectGroup>"; 168</SceneObjectGroup>";
169 169
170 private const string ObjectWithOtherPartsXml = ObjectRootPartStubXml + 170 private const string ObjectWithOtherPartsXml = ObjectRootPartStubXml +
171@" 171@"
172 <OtherParts> 172 <OtherParts>
173 <Part> 173 <Part>
@@ -574,9 +574,9 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
574 <llsd> 574 <llsd>
575 <map> 575 <map>
576 <key>MyNamespace</key> 576 <key>MyNamespace</key>
577 <map> 577 <map>
578 <key>MyStore</key> 578 <key>MyStore</key>
579 <map> 579 <map>
580 <key>last words</key> 580 <key>last words</key>
581 <string>Rosebud</string> 581 <string>Rosebud</string>
582 </map> 582 </map>
@@ -636,7 +636,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
636 Assert.That(part.Name, Is.EqualTo("PrimMyRide")); 636 Assert.That(part.Name, Is.EqualTo("PrimMyRide"));
637 OSDMap store = part.DynAttrs.GetStore("MyNamespace", "MyStore"); 637 OSDMap store = part.DynAttrs.GetStore("MyNamespace", "MyStore");
638 Assert.AreEqual(42, store["the answer"].AsInteger()); 638 Assert.AreEqual(42, store["the answer"].AsInteger());
639 } 639 }
640 640
641 { 641 {
642 SceneObjectPart part = parts[1]; 642 SceneObjectPart part = parts[1];
@@ -720,10 +720,12 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
720 string xml = SceneObjectSerializer.ToOriginalXmlFormat(so); 720 string xml = SceneObjectSerializer.ToOriginalXmlFormat(so);
721 721
722 XmlTextReader xtr = new XmlTextReader(new StringReader(xml)); 722 XmlTextReader xtr = new XmlTextReader(new StringReader(xml));
723 xtr.ProhibitDtd = true;
724
723 xtr.ReadStartElement("SceneObjectGroup"); 725 xtr.ReadStartElement("SceneObjectGroup");
724 xtr.ReadStartElement("RootPart"); 726 xtr.ReadStartElement("RootPart");
725 xtr.ReadStartElement("SceneObjectPart"); 727 xtr.ReadStartElement("SceneObjectPart");
726 728
727 UUID uuid = UUID.Zero; 729 UUID uuid = UUID.Zero;
728 string name = null; 730 string name = null;
729 UUID creatorId = UUID.Zero; 731 UUID creatorId = UUID.Zero;
@@ -733,7 +735,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
733 { 735 {
734 if (xtr.NodeType != XmlNodeType.Element) 736 if (xtr.NodeType != XmlNodeType.Element)
735 continue; 737 continue;
736 738
737 switch (xtr.Name) 739 switch (xtr.Name)
738 { 740 {
739 case "UUID": 741 case "UUID":
@@ -831,9 +833,11 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
831 string xml2 = m_serialiserModule.SerializeGroupToXml2(so, options); 833 string xml2 = m_serialiserModule.SerializeGroupToXml2(so, options);
832 834
833 XmlTextReader xtr = new XmlTextReader(new StringReader(xml2)); 835 XmlTextReader xtr = new XmlTextReader(new StringReader(xml2));
836 xtr.ProhibitDtd = true;
837
834 xtr.ReadStartElement("SceneObjectGroup"); 838 xtr.ReadStartElement("SceneObjectGroup");
835 xtr.ReadStartElement("SceneObjectPart"); 839 xtr.ReadStartElement("SceneObjectPart");
836 840
837 UUID uuid = UUID.Zero; 841 UUID uuid = UUID.Zero;
838 string name = null; 842 string name = null;
839 UUID creatorId = UUID.Zero; 843 UUID creatorId = UUID.Zero;
@@ -843,7 +847,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
843 { 847 {
844 if (xtr.NodeType != XmlNodeType.Element) 848 if (xtr.NodeType != XmlNodeType.Element)
845 continue; 849 continue;
846 850
847 switch (xtr.Name) 851 switch (xtr.Name)
848 { 852 {
849 case "UUID": 853 case "UUID":