diff options
Diffstat (limited to 'OpenSim/Framework/Serialization')
3 files changed, 17 insertions, 11 deletions
diff --git a/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs b/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs index fb269b7..f50b49a 100644 --- a/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs +++ b/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs | |||
@@ -40,7 +40,7 @@ namespace OpenSim.Framework.Serialization.External | |||
40 | public const int MAJOR_VERSION = 0; | 40 | public const int MAJOR_VERSION = 0; |
41 | public const int MINOR_VERSION = 1; | 41 | public const int MINOR_VERSION = 1; |
42 | 42 | ||
43 | public static string Serialize(UserProfileData profile) | 43 | public static string Serialize(UUID userID, string firstName, string lastName) |
44 | { | 44 | { |
45 | StringWriter sw = new StringWriter(); | 45 | StringWriter sw = new StringWriter(); |
46 | XmlTextWriter xtw = new XmlTextWriter(sw); | 46 | XmlTextWriter xtw = new XmlTextWriter(sw); |
@@ -51,9 +51,9 @@ namespace OpenSim.Framework.Serialization.External | |||
51 | xtw.WriteAttributeString("major_version", MAJOR_VERSION.ToString()); | 51 | xtw.WriteAttributeString("major_version", MAJOR_VERSION.ToString()); |
52 | xtw.WriteAttributeString("minor_version", MINOR_VERSION.ToString()); | 52 | xtw.WriteAttributeString("minor_version", MINOR_VERSION.ToString()); |
53 | 53 | ||
54 | xtw.WriteElementString("name", profile.Name); | 54 | xtw.WriteElementString("name", firstName + " " + lastName); |
55 | xtw.WriteElementString("id", profile.ID.ToString()); | 55 | xtw.WriteElementString("id", userID.ToString()); |
56 | xtw.WriteElementString("about", profile.AboutText); | 56 | xtw.WriteElementString("about", ""); |
57 | 57 | ||
58 | // Not sure if we're storing this yet, need to take a look | 58 | // Not sure if we're storing this yet, need to take a look |
59 | // xtw.WriteElementString("Url", profile.Url); | 59 | // xtw.WriteElementString("Url", profile.Url); |
diff --git a/OpenSim/Framework/Serialization/TarArchiveWriter.cs b/OpenSim/Framework/Serialization/TarArchiveWriter.cs index 20d0f7e..0bd639f 100644 --- a/OpenSim/Framework/Serialization/TarArchiveWriter.cs +++ b/OpenSim/Framework/Serialization/TarArchiveWriter.cs | |||
@@ -208,7 +208,9 @@ namespace OpenSim.Framework.Serialization | |||
208 | m_bw.Write(header); | 208 | m_bw.Write(header); |
209 | 209 | ||
210 | // Write out data | 210 | // Write out data |
211 | m_bw.Write(data); | 211 | // An IOException occurs if we try to write out an empty array in Mono 2.6 |
212 | if (data.Length > 0) | ||
213 | m_bw.Write(data); | ||
212 | 214 | ||
213 | if (data.Length % 512 != 0) | 215 | if (data.Length % 512 != 0) |
214 | { | 216 | { |
diff --git a/OpenSim/Framework/Serialization/Tests/LandDataSerializerTests.cs b/OpenSim/Framework/Serialization/Tests/LandDataSerializerTests.cs index 14e0462..70e87b3 100644 --- a/OpenSim/Framework/Serialization/Tests/LandDataSerializerTests.cs +++ b/OpenSim/Framework/Serialization/Tests/LandDataSerializerTests.cs | |||
@@ -96,15 +96,19 @@ namespace OpenSim.Framework.Serialization.Tests | |||
96 | [Test] | 96 | [Test] |
97 | public void LandDataSerializerSerializeTest() | 97 | public void LandDataSerializerSerializeTest() |
98 | { | 98 | { |
99 | string serialized = LandDataSerializer.Serialize(this.land); | 99 | string serialized = LandDataSerializer.Serialize(this.land).Replace("\r\n", "\n"); |
100 | Assert.That(serialized.Length > 0, "Serialize(LandData) returned empty string"); | 100 | Assert.That(serialized.Length > 0, "Serialize(LandData) returned empty string"); |
101 | Assert.That(serialized == LandDataSerializerTest.preSerialized, | ||
102 | "result of Serialize(LandData) does not match expected result"); | ||
103 | 101 | ||
104 | string serializedWithParcelAccessList = LandDataSerializer.Serialize(this.landWithParcelAccessList); | 102 | // adding a simple boolean variable because resharper nUnit integration doesn't like this |
105 | Assert.That(serializedWithParcelAccessList.Length > 0, | 103 | // XML data in the Assert.That statement. Not sure why. |
104 | bool result = (serialized == preSerialized); | ||
105 | Assert.That(result, "result of Serialize LandData does not match expected result"); | ||
106 | |||
107 | string serializedWithParcelAccessList = LandDataSerializer.Serialize(this.landWithParcelAccessList).Replace("\r\n", "\n"); | ||
108 | Assert.That(serializedWithParcelAccessList.Length > 0, | ||
106 | "Serialize(LandData) returned empty string for LandData object with ParcelAccessList"); | 109 | "Serialize(LandData) returned empty string for LandData object with ParcelAccessList"); |
107 | Assert.That(serializedWithParcelAccessList == LandDataSerializerTest.preSerializedWithParcelAccessList, | 110 | result = (serializedWithParcelAccessList == preSerializedWithParcelAccessList); |
111 | Assert.That(result, | ||
108 | "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"); |
109 | } | 113 | } |
110 | 114 | ||