diff options
author | Melanie | 2012-08-04 03:00:20 +0100 |
---|---|---|
committer | Melanie | 2012-08-04 03:00:20 +0100 |
commit | b9c4a637b46d0c47d5348181dd75c4cc3d44f43d (patch) | |
tree | 7cf26233b2aaea5556f9842d7a44e35860098a95 /OpenSim/Framework/Serialization | |
parent | Merge branch 'master' into careminster (diff) | |
parent | Strip experimental tag from --publish option of "save oar" region console com... (diff) | |
download | opensim-SC-b9c4a637b46d0c47d5348181dd75c4cc3d44f43d.zip opensim-SC-b9c4a637b46d0c47d5348181dd75c4cc3d44f43d.tar.gz opensim-SC-b9c4a637b46d0c47d5348181dd75c4cc3d44f43d.tar.bz2 opensim-SC-b9c4a637b46d0c47d5348181dd75c4cc3d44f43d.tar.xz |
Merge branch 'master' into careminster
Conflicts:
OpenSim/Region/Framework/Scenes/Scene.cs
Diffstat (limited to 'OpenSim/Framework/Serialization')
-rw-r--r-- | OpenSim/Framework/Serialization/External/LandDataSerializer.cs | 22 | ||||
-rw-r--r-- | OpenSim/Framework/Serialization/Tests/LandDataSerializerTests.cs | 85 |
2 files changed, 72 insertions, 35 deletions
diff --git a/OpenSim/Framework/Serialization/External/LandDataSerializer.cs b/OpenSim/Framework/Serialization/External/LandDataSerializer.cs index a64f01c..709b516 100644 --- a/OpenSim/Framework/Serialization/External/LandDataSerializer.cs +++ b/OpenSim/Framework/Serialization/External/LandDataSerializer.cs | |||
@@ -93,6 +93,8 @@ namespace OpenSim.Framework.Serialization.External | |||
93 | "MediaURL", (ld, xtr) => ld.MediaURL = xtr.ReadElementString("MediaURL")); | 93 | "MediaURL", (ld, xtr) => ld.MediaURL = xtr.ReadElementString("MediaURL")); |
94 | m_ldProcessors.Add( | 94 | m_ldProcessors.Add( |
95 | "MusicURL", (ld, xtr) => ld.MusicURL = xtr.ReadElementString("MusicURL")); | 95 | "MusicURL", (ld, xtr) => ld.MusicURL = xtr.ReadElementString("MusicURL")); |
96 | m_ldProcessors.Add( | ||
97 | "OwnerID", (ld, xtr) => ld.OwnerID = UUID.Parse(xtr.ReadElementString("OwnerID"))); | ||
96 | 98 | ||
97 | m_ldProcessors.Add( | 99 | m_ldProcessors.Add( |
98 | "ParcelAccessList", ProcessParcelAccessList); | 100 | "ParcelAccessList", ProcessParcelAccessList); |
@@ -186,7 +188,16 @@ namespace OpenSim.Framework.Serialization.External | |||
186 | return landData; | 188 | return landData; |
187 | } | 189 | } |
188 | 190 | ||
189 | public static string Serialize(LandData landData) | 191 | /// <summary> |
192 | /// Serialize land data | ||
193 | /// </summary> | ||
194 | /// <param name='landData'></param> | ||
195 | /// <param name='options'> | ||
196 | /// Serialization options. | ||
197 | /// Can be null if there are no options. | ||
198 | /// "wipe-owners" will write UUID.Zero rather than the ownerID so that a later reload loads all parcels with the estate owner as the owner | ||
199 | /// </param> | ||
200 | public static string Serialize(LandData landData, Dictionary<string, object> options) | ||
190 | { | 201 | { |
191 | StringWriter sw = new StringWriter(); | 202 | StringWriter sw = new StringWriter(); |
192 | XmlTextWriter xtw = new XmlTextWriter(sw); | 203 | XmlTextWriter xtw = new XmlTextWriter(sw); |
@@ -215,7 +226,14 @@ namespace OpenSim.Framework.Serialization.External | |||
215 | xtw.WriteElementString("MediaID", landData.MediaID.ToString()); | 226 | xtw.WriteElementString("MediaID", landData.MediaID.ToString()); |
216 | xtw.WriteElementString("MediaURL", landData.MediaURL); | 227 | xtw.WriteElementString("MediaURL", landData.MediaURL); |
217 | xtw.WriteElementString("MusicURL", landData.MusicURL); | 228 | xtw.WriteElementString("MusicURL", landData.MusicURL); |
218 | xtw.WriteElementString("OwnerID", landData.OwnerID.ToString()); | 229 | |
230 | UUID ownerIdToWrite; | ||
231 | if (options != null && options.ContainsKey("wipe-owners")) | ||
232 | ownerIdToWrite = UUID.Zero; | ||
233 | else | ||
234 | ownerIdToWrite = landData.OwnerID; | ||
235 | |||
236 | xtw.WriteElementString("OwnerID", ownerIdToWrite.ToString()); | ||
219 | 237 | ||
220 | xtw.WriteStartElement("ParcelAccessList"); | 238 | xtw.WriteStartElement("ParcelAccessList"); |
221 | foreach (LandAccessEntry pal in landData.ParcelAccessList) | 239 | foreach (LandAccessEntry pal in landData.ParcelAccessList) |
diff --git a/OpenSim/Framework/Serialization/Tests/LandDataSerializerTests.cs b/OpenSim/Framework/Serialization/Tests/LandDataSerializerTests.cs index b8ed9e1..8b9756b 100644 --- a/OpenSim/Framework/Serialization/Tests/LandDataSerializerTests.cs +++ b/OpenSim/Framework/Serialization/Tests/LandDataSerializerTests.cs | |||
@@ -42,22 +42,23 @@ namespace OpenSim.Framework.Serialization.Tests | |||
42 | private LandData land; | 42 | private LandData land; |
43 | private LandData landWithParcelAccessList; | 43 | private LandData landWithParcelAccessList; |
44 | 44 | ||
45 | private static string preSerialized = "<?xml version=\"1.0\" encoding=\"utf-16\"?>\n<LandData>\n <Area>128</Area>\n <AuctionID>0</AuctionID>\n <AuthBuyerID>00000000-0000-0000-0000-000000000000</AuthBuyerID>\n <Category>10</Category>\n <ClaimDate>0</ClaimDate>\n <ClaimPrice>0</ClaimPrice>\n <GlobalID>54ff9641-dd40-4a2c-b1f1-47dd3af24e50</GlobalID>\n <GroupID>d740204e-bbbf-44aa-949d-02c7d739f6a5</GroupID>\n <IsGroupOwned>False</IsGroupOwned>\n <Bitmap>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</Bitmap>\n <Description>land data to test LandDataSerializer</Description>\n <Flags>536870944</Flags>\n <LandingType>2</LandingType>\n <Name>LandDataSerializerTest Land</Name>\n <Status>0</Status>\n <LocalID>0</LocalID>\n <MediaAutoScale>1</MediaAutoScale>\n <MediaID>d4452578-2f25-4b97-a81b-819af559cfd7</MediaID>\n <MediaURL>http://videos.opensimulator.org/bumblebee.mp4</MediaURL>\n <MusicURL />\n <OwnerID>1b8eedf9-6d15-448b-8015-24286f1756bf</OwnerID>\n <ParcelAccessList />\n <PassHours>0</PassHours>\n <PassPrice>0</PassPrice>\n <SalePrice>0</SalePrice>\n <SnapshotID>00000000-0000-0000-0000-000000000000</SnapshotID>\n <UserLocation><0, 0, 0></UserLocation>\n <UserLookAt><0, 0, 0></UserLookAt>\n <Dwell>0</Dwell>\n <OtherCleanTime>0</OtherCleanTime>\n</LandData>"; | 45 | // private static string preSerialized = "<?xml version=\"1.0\" encoding=\"utf-16\"?>\n<LandData>\n <Area>128</Area>\n <AuctionID>0</AuctionID>\n <AuthBuyerID>00000000-0000-0000-0000-000000000000</AuthBuyerID>\n <Category>10</Category>\n <ClaimDate>0</ClaimDate>\n <ClaimPrice>0</ClaimPrice>\n <GlobalID>54ff9641-dd40-4a2c-b1f1-47dd3af24e50</GlobalID>\n <GroupID>d740204e-bbbf-44aa-949d-02c7d739f6a5</GroupID>\n <IsGroupOwned>False</IsGroupOwned>\n <Bitmap>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</Bitmap>\n <Description>land data to test LandDataSerializer</Description>\n <Flags>536870944</Flags>\n <LandingType>2</LandingType>\n <Name>LandDataSerializerTest Land</Name>\n <Status>0</Status>\n <LocalID>0</LocalID>\n <MediaAutoScale>1</MediaAutoScale>\n <MediaID>d4452578-2f25-4b97-a81b-819af559cfd7</MediaID>\n <MediaURL>http://videos.opensimulator.org/bumblebee.mp4</MediaURL>\n <MusicURL />\n <OwnerID>1b8eedf9-6d15-448b-8015-24286f1756bf</OwnerID>\n <ParcelAccessList />\n <PassHours>0</PassHours>\n <PassPrice>0</PassPrice>\n <SalePrice>0</SalePrice>\n <SnapshotID>00000000-0000-0000-0000-000000000000</SnapshotID>\n <UserLocation><0, 0, 0></UserLocation>\n <UserLookAt><0, 0, 0></UserLookAt>\n <Dwell>0</Dwell>\n <OtherCleanTime>0</OtherCleanTime>\n</LandData>"; |
46 | private static string preSerializedWithParcelAccessList = "<?xml version=\"1.0\" encoding=\"utf-16\"?>\n<LandData>\n <Area>128</Area>\n <AuctionID>0</AuctionID>\n <AuthBuyerID>00000000-0000-0000-0000-000000000000</AuthBuyerID>\n <Category>10</Category>\n <ClaimDate>0</ClaimDate>\n <ClaimPrice>0</ClaimPrice>\n <GlobalID>54ff9641-dd40-4a2c-b1f1-47dd3af24e50</GlobalID>\n <GroupID>d740204e-bbbf-44aa-949d-02c7d739f6a5</GroupID>\n <IsGroupOwned>False</IsGroupOwned>\n <Bitmap>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</Bitmap>\n <Description>land data to test LandDataSerializer</Description>\n <Flags>536870944</Flags>\n <LandingType>2</LandingType>\n <Name>LandDataSerializerTest Land</Name>\n <Status>0</Status>\n <LocalID>0</LocalID>\n <MediaAutoScale>1</MediaAutoScale>\n <MediaID>d4452578-2f25-4b97-a81b-819af559cfd7</MediaID>\n <MediaURL>http://videos.opensimulator.org/bumblebee.mp4</MediaURL>\n <MusicURL />\n <OwnerID>1b8eedf9-6d15-448b-8015-24286f1756bf</OwnerID>\n <ParcelAccessList>\n <ParcelAccessEntry>\n <AgentID>62d65d45-c91a-4f77-862c-46557d978b6c</AgentID>\n <Time>0</Time>\n <AccessList>2</AccessList>\n </ParcelAccessEntry>\n <ParcelAccessEntry>\n <AgentID>ec2a8d18-2378-4fe0-8b68-2a31b57c481e</AgentID>\n <Time>0</Time>\n <AccessList>1</AccessList>\n </ParcelAccessEntry>\n </ParcelAccessList>\n <PassHours>0</PassHours>\n <PassPrice>0</PassPrice>\n <SalePrice>0</SalePrice>\n <SnapshotID>00000000-0000-0000-0000-000000000000</SnapshotID>\n <UserLocation><0, 0, 0></UserLocation>\n <UserLookAt><0, 0, 0></UserLookAt>\n <Dwell>0</Dwell>\n <OtherCleanTime>0</OtherCleanTime>\n</LandData>"; | 46 | private static string preSerializedWithParcelAccessList |
47 | = "<?xml version=\"1.0\" encoding=\"utf-16\"?>\n<LandData>\n <Area>128</Area>\n <AuctionID>0</AuctionID>\n <AuthBuyerID>00000000-0000-0000-0000-000000000000</AuthBuyerID>\n <Category>10</Category>\n <ClaimDate>0</ClaimDate>\n <ClaimPrice>0</ClaimPrice>\n <GlobalID>54ff9641-dd40-4a2c-b1f1-47dd3af24e50</GlobalID>\n <GroupID>d740204e-bbbf-44aa-949d-02c7d739f6a5</GroupID>\n <IsGroupOwned>False</IsGroupOwned>\n <Bitmap>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</Bitmap>\n <Description>land data to test LandDataSerializer</Description>\n <Flags>536870944</Flags>\n <LandingType>2</LandingType>\n <Name>LandDataSerializerTest Land</Name>\n <Status>0</Status>\n <LocalID>0</LocalID>\n <MediaAutoScale>1</MediaAutoScale>\n <MediaID>d4452578-2f25-4b97-a81b-819af559cfd7</MediaID>\n <MediaURL>http://videos.opensimulator.org/bumblebee.mp4</MediaURL>\n <MusicURL />\n <OwnerID>1b8eedf9-6d15-448b-8015-24286f1756bf</OwnerID>\n <ParcelAccessList>\n <ParcelAccessEntry>\n <AgentID>62d65d45-c91a-4f77-862c-46557d978b6c</AgentID>\n <Time>0</Time>\n <AccessList>2</AccessList>\n </ParcelAccessEntry>\n <ParcelAccessEntry>\n <AgentID>ec2a8d18-2378-4fe0-8b68-2a31b57c481e</AgentID>\n <Time>0</Time>\n <AccessList>1</AccessList>\n </ParcelAccessEntry>\n </ParcelAccessList>\n <PassHours>0</PassHours>\n <PassPrice>0</PassPrice>\n <SalePrice>0</SalePrice>\n <SnapshotID>00000000-0000-0000-0000-000000000000</SnapshotID>\n <UserLocation><0, 0, 0></UserLocation>\n <UserLookAt><0, 0, 0></UserLookAt>\n <Dwell>0</Dwell>\n <OtherCleanTime>0</OtherCleanTime>\n</LandData>"; | ||
47 | 48 | ||
48 | [SetUp] | 49 | [SetUp] |
49 | public void setup() | 50 | public void setup() |
50 | { | 51 | { |
51 | // setup LandData object | 52 | // setup LandData object |
52 | this.land = new LandData(); | 53 | this.land = new LandData(); |
53 | this.land.AABBMax = new Vector3(0, 0, 0); | 54 | this.land.AABBMax = new Vector3(1, 2, 3); |
54 | this.land.AABBMin = new Vector3(128, 128, 128); | 55 | this.land.AABBMin = new Vector3(129, 130, 131); |
55 | this.land.Area = 128; | 56 | this.land.Area = 128; |
56 | this.land.AuctionID = 0; | 57 | this.land.AuctionID = 4; |
57 | this.land.AuthBuyerID = new UUID(); | 58 | this.land.AuthBuyerID = new UUID("7176df0c-6c50-45db-8a37-5e78be56a0cd"); |
58 | this.land.Category = ParcelCategory.Residential; | 59 | this.land.Category = ParcelCategory.Residential; |
59 | this.land.ClaimDate = 0; | 60 | this.land.ClaimDate = 1; |
60 | this.land.ClaimPrice = 0; | 61 | this.land.ClaimPrice = 2; |
61 | this.land.GlobalID = new UUID("54ff9641-dd40-4a2c-b1f1-47dd3af24e50"); | 62 | this.land.GlobalID = new UUID("54ff9641-dd40-4a2c-b1f1-47dd3af24e50"); |
62 | this.land.GroupID = new UUID("d740204e-bbbf-44aa-949d-02c7d739f6a5"); | 63 | this.land.GroupID = new UUID("d740204e-bbbf-44aa-949d-02c7d739f6a5"); |
63 | this.land.Description = "land data to test LandDataSerializer"; | 64 | this.land.Description = "land data to test LandDataSerializer"; |
@@ -65,7 +66,7 @@ namespace OpenSim.Framework.Serialization.Tests | |||
65 | this.land.LandingType = (byte)LandingType.Direct; | 66 | this.land.LandingType = (byte)LandingType.Direct; |
66 | this.land.Name = "LandDataSerializerTest Land"; | 67 | this.land.Name = "LandDataSerializerTest Land"; |
67 | this.land.Status = ParcelStatus.Leased; | 68 | this.land.Status = ParcelStatus.Leased; |
68 | this.land.LocalID = 0; | 69 | this.land.LocalID = 1; |
69 | this.land.MediaAutoScale = (byte)0x01; | 70 | this.land.MediaAutoScale = (byte)0x01; |
70 | this.land.MediaID = new UUID("d4452578-2f25-4b97-a81b-819af559cfd7"); | 71 | this.land.MediaID = new UUID("d4452578-2f25-4b97-a81b-819af559cfd7"); |
71 | this.land.MediaURL = "http://videos.opensimulator.org/bumblebee.mp4"; | 72 | this.land.MediaURL = "http://videos.opensimulator.org/bumblebee.mp4"; |
@@ -90,26 +91,26 @@ namespace OpenSim.Framework.Serialization.Tests | |||
90 | /// <summary> | 91 | /// <summary> |
91 | /// Test the LandDataSerializer.Serialize() method | 92 | /// Test the LandDataSerializer.Serialize() method |
92 | /// </summary> | 93 | /// </summary> |
93 | [Test] | 94 | // [Test] |
94 | public void LandDataSerializerSerializeTest() | 95 | // public void LandDataSerializerSerializeTest() |
95 | { | 96 | // { |
96 | TestHelpers.InMethod(); | 97 | // TestHelpers.InMethod(); |
97 | 98 | // | |
98 | string serialized = LandDataSerializer.Serialize(this.land).Replace("\r\n", "\n"); | 99 | // string serialized = LandDataSerializer.Serialize(this.land).Replace("\r\n", "\n"); |
99 | Assert.That(serialized.Length > 0, "Serialize(LandData) returned empty string"); | 100 | // Assert.That(serialized.Length > 0, "Serialize(LandData) returned empty string"); |
100 | 101 | // | |
101 | // adding a simple boolean variable because resharper nUnit integration doesn't like this | 102 | // // adding a simple boolean variable because resharper nUnit integration doesn't like this |
102 | // XML data in the Assert.That statement. Not sure why. | 103 | // // XML data in the Assert.That statement. Not sure why. |
103 | bool result = (serialized == preSerialized); | 104 | // bool result = (serialized == preSerialized); |
104 | Assert.That(result, "result of Serialize LandData does not match expected result"); | 105 | // Assert.That(result, "result of Serialize LandData does not match expected result"); |
105 | 106 | // | |
106 | string serializedWithParcelAccessList = LandDataSerializer.Serialize(this.landWithParcelAccessList).Replace("\r\n", "\n"); | 107 | // string serializedWithParcelAccessList = LandDataSerializer.Serialize(this.landWithParcelAccessList).Replace("\r\n", "\n"); |
107 | Assert.That(serializedWithParcelAccessList.Length > 0, | 108 | // Assert.That(serializedWithParcelAccessList.Length > 0, |
108 | "Serialize(LandData) returned empty string for LandData object with ParcelAccessList"); | 109 | // "Serialize(LandData) returned empty string for LandData object with ParcelAccessList"); |
109 | result = (serializedWithParcelAccessList == preSerializedWithParcelAccessList); | 110 | // result = (serializedWithParcelAccessList == preSerializedWithParcelAccessList); |
110 | Assert.That(result, | 111 | // Assert.That(result, |
111 | "result of Serialize(LandData) does not match expected result (pre-serialized with parcel access list"); | 112 | // "result of Serialize(LandData) does not match expected result (pre-serialized with parcel access list"); |
112 | } | 113 | // } |
113 | 114 | ||
114 | /// <summary> | 115 | /// <summary> |
115 | /// Test the LandDataSerializer.Deserialize() method | 116 | /// Test the LandDataSerializer.Deserialize() method |
@@ -120,10 +121,28 @@ namespace OpenSim.Framework.Serialization.Tests | |||
120 | TestHelpers.InMethod(); | 121 | TestHelpers.InMethod(); |
121 | // log4net.Config.XmlConfigurator.Configure(); | 122 | // log4net.Config.XmlConfigurator.Configure(); |
122 | 123 | ||
123 | LandData ld = LandDataSerializer.Deserialize(LandDataSerializerTest.preSerialized); | 124 | LandData ld = LandDataSerializer.Deserialize(LandDataSerializer.Serialize(this.land, null)); |
124 | Assert.That(ld != null, "Deserialize(string) returned null"); | 125 | Assert.That(ld, Is.Not.Null, "Deserialize(string) returned null"); |
125 | Assert.That(ld.GlobalID == this.land.GlobalID, "Reified LandData.GlobalID != original LandData.GlobalID"); | 126 | // Assert.That(ld.AABBMax, Is.EqualTo(land.AABBMax)); |
126 | Assert.That(ld.Name == this.land.Name, "Reified LandData.Name != original LandData.Name"); | 127 | // Assert.That(ld.AABBMin, Is.EqualTo(land.AABBMin)); |
128 | Assert.That(ld.Area, Is.EqualTo(land.Area)); | ||
129 | Assert.That(ld.AuctionID, Is.EqualTo(land.AuctionID)); | ||
130 | Assert.That(ld.AuthBuyerID, Is.EqualTo(land.AuthBuyerID)); | ||
131 | Assert.That(ld.Category, Is.EqualTo(land.Category)); | ||
132 | Assert.That(ld.ClaimDate, Is.EqualTo(land.ClaimDate)); | ||
133 | Assert.That(ld.ClaimPrice, Is.EqualTo(land.ClaimPrice)); | ||
134 | Assert.That(ld.GlobalID, Is.EqualTo(land.GlobalID), "Reified LandData.GlobalID != original LandData.GlobalID"); | ||
135 | Assert.That(ld.GroupID, Is.EqualTo(land.GroupID)); | ||
136 | Assert.That(ld.Description, Is.EqualTo(land.Description)); | ||
137 | Assert.That(ld.Flags, Is.EqualTo(land.Flags)); | ||
138 | Assert.That(ld.LandingType, Is.EqualTo(land.LandingType)); | ||
139 | Assert.That(ld.Name, Is.EqualTo(land.Name), "Reified LandData.Name != original LandData.Name"); | ||
140 | Assert.That(ld.Status, Is.EqualTo(land.Status)); | ||
141 | Assert.That(ld.LocalID, Is.EqualTo(land.LocalID)); | ||
142 | Assert.That(ld.MediaAutoScale, Is.EqualTo(land.MediaAutoScale)); | ||
143 | Assert.That(ld.MediaID, Is.EqualTo(land.MediaID)); | ||
144 | Assert.That(ld.MediaURL, Is.EqualTo(land.MediaURL)); | ||
145 | Assert.That(ld.OwnerID, Is.EqualTo(land.OwnerID)); | ||
127 | } | 146 | } |
128 | 147 | ||
129 | [Test] | 148 | [Test] |