diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs | 556 |
1 files changed, 442 insertions, 114 deletions
diff --git a/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs b/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs index bcb8e2f..a5bb1a7 100644 --- a/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs +++ b/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs | |||
@@ -27,6 +27,7 @@ | |||
27 | 27 | ||
28 | using System.Collections.Generic; | 28 | using System.Collections.Generic; |
29 | using System.IO; | 29 | using System.IO; |
30 | using System.Text; | ||
30 | using System.Xml; | 31 | using System.Xml; |
31 | using log4net.Config; | 32 | using log4net.Config; |
32 | using NUnit.Framework; | 33 | using NUnit.Framework; |
@@ -35,120 +36,358 @@ using OpenSim.Framework; | |||
35 | using OpenSim.Region.Framework.Scenes; | 36 | using OpenSim.Region.Framework.Scenes; |
36 | using OpenSim.Region.Framework.Scenes.Serialization; | 37 | using OpenSim.Region.Framework.Scenes.Serialization; |
37 | using OpenSim.Tests.Common; | 38 | using OpenSim.Tests.Common; |
39 | using OpenMetaverse.StructuredData; | ||
38 | 40 | ||
39 | namespace OpenSim.Region.CoreModules.World.Serialiser.Tests | 41 | namespace OpenSim.Region.CoreModules.World.Serialiser.Tests |
40 | { | 42 | { |
41 | [TestFixture] | 43 | [TestFixture] |
42 | public class SerialiserTests : OpenSimTestCase | 44 | public class SerialiserTests : OpenSimTestCase |
43 | { | 45 | { |
44 | private string xml = @" | 46 | private const string ObjectRootPartStubXml = |
45 | <SceneObjectGroup> | 47 | @"<SceneObjectGroup> |
46 | <RootPart> | 48 | <RootPart> |
47 | <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""> |
48 | <AllowedDrop>false</AllowedDrop> | 50 | <AllowedDrop>false</AllowedDrop> |
49 | <CreatorID><Guid>a6dacf01-4636-4bb9-8a97-30609438af9d</Guid></CreatorID> | 51 | <CreatorID><Guid>a6dacf01-4636-4bb9-8a97-30609438af9d</Guid></CreatorID> |
50 | <FolderID><Guid>e6a5a05e-e8cc-4816-8701-04165e335790</Guid></FolderID> | 52 | <FolderID><Guid>e6a5a05e-e8cc-4816-8701-04165e335790</Guid></FolderID> |
51 | <InventorySerial>1</InventorySerial> | 53 | <InventorySerial>1</InventorySerial> |
52 | <TaskInventory /> | 54 | <TaskInventory /> |
53 | <ObjectFlags>0</ObjectFlags> | 55 | <ObjectFlags>0</ObjectFlags> |
54 | <UUID><Guid>e6a5a05e-e8cc-4816-8701-04165e335790</Guid></UUID> | 56 | <UUID><Guid>e6a5a05e-e8cc-4816-8701-04165e335790</Guid></UUID> |
55 | <LocalId>2698615125</LocalId> | 57 | <LocalId>2698615125</LocalId> |
56 | <Name>PrimMyRide</Name> | 58 | <Name>PrimMyRide</Name> |
57 | <Material>0</Material> | 59 | <Material>0</Material> |
58 | <PassTouches>false</PassTouches> | 60 | <PassTouches>false</PassTouches> |
59 | <RegionHandle>1099511628032000</RegionHandle> | 61 | <RegionHandle>1099511628032000</RegionHandle> |
60 | <ScriptAccessPin>0</ScriptAccessPin> | 62 | <ScriptAccessPin>0</ScriptAccessPin> |
61 | <GroupPosition><X>147.23</X><Y>92.698</Y><Z>22.78084</Z></GroupPosition> | 63 | <GroupPosition><X>147.23</X><Y>92.698</Y><Z>22.78084</Z></GroupPosition> |
62 | <OffsetPosition><X>0</X><Y>0</Y><Z>0</Z></OffsetPosition> | 64 | <OffsetPosition><X>0</X><Y>0</Y><Z>0</Z></OffsetPosition> |
63 | <RotationOffset><X>-4.371139E-08</X><Y>-1</Y><Z>-4.371139E-08</Z><W>0</W></RotationOffset> | 65 | <RotationOffset><X>-4.371139E-08</X><Y>-1</Y><Z>-4.371139E-08</Z><W>0</W></RotationOffset> |
64 | <Velocity><X>0</X><Y>0</Y><Z>0</Z></Velocity> | 66 | <Velocity><X>0</X><Y>0</Y><Z>0</Z></Velocity> |
65 | <RotationalVelocity><X>0</X><Y>0</Y><Z>0</Z></RotationalVelocity> | 67 | <RotationalVelocity><X>0</X><Y>0</Y><Z>0</Z></RotationalVelocity> |
66 | <AngularVelocity><X>0</X><Y>0</Y><Z>0</Z></AngularVelocity> | 68 | <AngularVelocity><X>0</X><Y>0</Y><Z>0</Z></AngularVelocity> |
67 | <Acceleration><X>0</X><Y>0</Y><Z>0</Z></Acceleration> | 69 | <Acceleration><X>0</X><Y>0</Y><Z>0</Z></Acceleration> |
68 | <Description /> | 70 | <Description /> |
69 | <Color /> | 71 | <Color /> |
70 | <Text /> | 72 | <Text /> |
71 | <SitName /> | 73 | <SitName /> |
72 | <TouchName /> | 74 | <TouchName /> |
73 | <LinkNum>0</LinkNum> | 75 | <LinkNum>0</LinkNum> |
74 | <ClickAction>0</ClickAction> | 76 | <ClickAction>0</ClickAction> |
75 | <Shape> | 77 | <Shape> |
76 | <ProfileCurve>1</ProfileCurve> | 78 | <ProfileCurve>1</ProfileCurve> |
77 | <TextureEntry>AAAAAAAAERGZmQAAAAAABQCVlZUAAAAAQEAAAABAQAAAAAAAAAAAAAAAAAAAAA==</TextureEntry> | 79 | <TextureEntry>AAAAAAAAERGZmQAAAAAABQCVlZUAAAAAQEAAAABAQAAAAAAAAAAAAAAAAAAAAA==</TextureEntry> |
78 | <ExtraParams>AA==</ExtraParams> | 80 | <ExtraParams>AA==</ExtraParams> |
79 | <PathBegin>0</PathBegin> | 81 | <PathBegin>0</PathBegin> |
80 | <PathCurve>16</PathCurve> | 82 | <PathCurve>16</PathCurve> |
81 | <PathEnd>0</PathEnd> | 83 | <PathEnd>0</PathEnd> |
82 | <PathRadiusOffset>0</PathRadiusOffset> | 84 | <PathRadiusOffset>0</PathRadiusOffset> |
83 | <PathRevolutions>0</PathRevolutions> | 85 | <PathRevolutions>0</PathRevolutions> |
84 | <PathScaleX>100</PathScaleX> | 86 | <PathScaleX>100</PathScaleX> |
85 | <PathScaleY>100</PathScaleY> | 87 | <PathScaleY>100</PathScaleY> |
86 | <PathShearX>0</PathShearX> | 88 | <PathShearX>0</PathShearX> |
87 | <PathShearY>0</PathShearY> | 89 | <PathShearY>0</PathShearY> |
88 | <PathSkew>0</PathSkew> | 90 | <PathSkew>0</PathSkew> |
89 | <PathTaperX>0</PathTaperX> | 91 | <PathTaperX>0</PathTaperX> |
90 | <PathTaperY>0</PathTaperY> | 92 | <PathTaperY>0</PathTaperY> |
91 | <PathTwist>0</PathTwist> | 93 | <PathTwist>0</PathTwist> |
92 | <PathTwistBegin>0</PathTwistBegin> | 94 | <PathTwistBegin>0</PathTwistBegin> |
93 | <PCode>9</PCode> | 95 | <PCode>9</PCode> |
94 | <ProfileBegin>0</ProfileBegin> | 96 | <ProfileBegin>0</ProfileBegin> |
95 | <ProfileEnd>0</ProfileEnd> | 97 | <ProfileEnd>0</ProfileEnd> |
96 | <ProfileHollow>0</ProfileHollow> | 98 | <ProfileHollow>0</ProfileHollow> |
97 | <Scale><X>10</X><Y>10</Y><Z>0.5</Z></Scale> | 99 | <Scale><X>10</X><Y>10</Y><Z>0.5</Z></Scale> |
98 | <State>0</State> | 100 | <State>0</State> |
99 | <ProfileShape>Square</ProfileShape> | 101 | <ProfileShape>Square</ProfileShape> |
100 | <HollowShape>Same</HollowShape> | 102 | <HollowShape>Same</HollowShape> |
101 | <SculptTexture><Guid>00000000-0000-0000-0000-000000000000</Guid></SculptTexture> | 103 | <SculptTexture><Guid>00000000-0000-0000-0000-000000000000</Guid></SculptTexture> |
102 | <SculptType>0</SculptType><SculptData /> | 104 | <SculptType>0</SculptType><SculptData /> |
103 | <FlexiSoftness>0</FlexiSoftness> | 105 | <FlexiSoftness>0</FlexiSoftness> |
104 | <FlexiTension>0</FlexiTension> | 106 | <FlexiTension>0</FlexiTension> |
105 | <FlexiDrag>0</FlexiDrag> | 107 | <FlexiDrag>0</FlexiDrag> |
106 | <FlexiGravity>0</FlexiGravity> | 108 | <FlexiGravity>0</FlexiGravity> |
107 | <FlexiWind>0</FlexiWind> | 109 | <FlexiWind>0</FlexiWind> |
108 | <FlexiForceX>0</FlexiForceX> | 110 | <FlexiForceX>0</FlexiForceX> |
109 | <FlexiForceY>0</FlexiForceY> | 111 | <FlexiForceY>0</FlexiForceY> |
110 | <FlexiForceZ>0</FlexiForceZ> | 112 | <FlexiForceZ>0</FlexiForceZ> |
111 | <LightColorR>0</LightColorR> | 113 | <LightColorR>0</LightColorR> |
112 | <LightColorG>0</LightColorG> | 114 | <LightColorG>0</LightColorG> |
113 | <LightColorB>0</LightColorB> | 115 | <LightColorB>0</LightColorB> |
114 | <LightColorA>1</LightColorA> | 116 | <LightColorA>1</LightColorA> |
115 | <LightRadius>0</LightRadius> | 117 | <LightRadius>0</LightRadius> |
116 | <LightCutoff>0</LightCutoff> | 118 | <LightCutoff>0</LightCutoff> |
117 | <LightFalloff>0</LightFalloff> | 119 | <LightFalloff>0</LightFalloff> |
118 | <LightIntensity>1</LightIntensity> | 120 | <LightIntensity>1</LightIntensity> |
119 | <FlexiEntry>false</FlexiEntry> | 121 | <FlexiEntry>false</FlexiEntry> |
120 | <LightEntry>false</LightEntry> | 122 | <LightEntry>false</LightEntry> |
121 | <SculptEntry>false</SculptEntry> | 123 | <SculptEntry>false</SculptEntry> |
122 | </Shape> | 124 | </Shape> |
123 | <Scale><X>10</X><Y>10</Y><Z>0.5</Z></Scale> | 125 | <Scale><X>10</X><Y>10</Y><Z>0.5</Z></Scale> |
124 | <UpdateFlag>0</UpdateFlag> | 126 | <UpdateFlag>0</UpdateFlag> |
125 | <SitTargetOrientation><X>0</X><Y>0</Y><Z>0</Z><W>1</W></SitTargetOrientation> | 127 | <SitTargetOrientation><X>0</X><Y>0</Y><Z>0</Z><W>1</W></SitTargetOrientation> |
126 | <SitTargetPosition><X>0</X><Y>0</Y><Z>0</Z></SitTargetPosition> | 128 | <SitTargetPosition><X>0</X><Y>0</Y><Z>0</Z></SitTargetPosition> |
127 | <SitTargetPositionLL><X>0</X><Y>0</Y><Z>0</Z></SitTargetPositionLL> | 129 | <SitTargetPositionLL><X>0</X><Y>0</Y><Z>0</Z></SitTargetPositionLL> |
128 | <SitTargetOrientationLL><X>0</X><Y>0</Y><Z>0</Z><W>1</W></SitTargetOrientationLL> | 130 | <SitTargetOrientationLL><X>0</X><Y>0</Y><Z>0</Z><W>1</W></SitTargetOrientationLL> |
129 | <ParentID>0</ParentID> | 131 | <ParentID>0</ParentID> |
130 | <CreationDate>1211330445</CreationDate> | 132 | <CreationDate>1211330445</CreationDate> |
131 | <Category>0</Category> | 133 | <Category>0</Category> |
132 | <SalePrice>0</SalePrice> | 134 | <SalePrice>0</SalePrice> |
133 | <ObjectSaleType>0</ObjectSaleType> | 135 | <ObjectSaleType>0</ObjectSaleType> |
134 | <OwnershipCost>0</OwnershipCost> | 136 | <OwnershipCost>0</OwnershipCost> |
135 | <GroupID><Guid>00000000-0000-0000-0000-000000000000</Guid></GroupID> | 137 | <GroupID><Guid>00000000-0000-0000-0000-000000000000</Guid></GroupID> |
136 | <OwnerID><Guid>a6dacf01-4636-4bb9-8a97-30609438af9d</Guid></OwnerID> | 138 | <OwnerID><Guid>a6dacf01-4636-4bb9-8a97-30609438af9d</Guid></OwnerID> |
137 | <LastOwnerID><Guid>a6dacf01-4636-4bb9-8a97-30609438af9d</Guid></LastOwnerID> | 139 | <LastOwnerID><Guid>a6dacf01-4636-4bb9-8a97-30609438af9d</Guid></LastOwnerID> |
138 | <BaseMask>2147483647</BaseMask> | 140 | <BaseMask>2147483647</BaseMask> |
139 | <OwnerMask>2147483647</OwnerMask> | 141 | <OwnerMask>2147483647</OwnerMask> |
140 | <GroupMask>0</GroupMask> | 142 | <GroupMask>0</GroupMask> |
141 | <EveryoneMask>0</EveryoneMask> | 143 | <EveryoneMask>0</EveryoneMask> |
142 | <NextOwnerMask>2147483647</NextOwnerMask> | 144 | <NextOwnerMask>2147483647</NextOwnerMask> |
143 | <Flags>None</Flags> | 145 | <Flags>None</Flags> |
144 | <CollisionSound><Guid>00000000-0000-0000-0000-000000000000</Guid></CollisionSound> | 146 | <CollisionSound><Guid>00000000-0000-0000-0000-000000000000</Guid></CollisionSound> |
145 | <CollisionSoundVolume>0</CollisionSoundVolume> | 147 | <CollisionSoundVolume>0</CollisionSoundVolume> |
146 | </SceneObjectPart> | 148 | <DynAttrs> |
147 | </RootPart> | 149 | <llsd> |
148 | <OtherParts /> | 150 | <map> |
149 | </SceneObjectGroup>"; | 151 | <key>MyNamespace</key> |
150 | 152 | <map> | |
151 | private string badFloatsXml = @" | 153 | <key>MyStore</key> |
154 | <map> | ||
155 | <key>the answer</key> | ||
156 | <integer>42</integer> | ||
157 | </map> | ||
158 | </map> | ||
159 | </map> | ||
160 | </llsd> | ||
161 | </DynAttrs> | ||
162 | </SceneObjectPart> | ||
163 | </RootPart>"; | ||
164 | |||
165 | private const string ObjectWithNoOtherPartsXml = ObjectRootPartStubXml + | ||
166 | @" | ||
167 | <OtherParts /> | ||
168 | </SceneObjectGroup>"; | ||
169 | |||
170 | private const string ObjectWithOtherPartsXml = ObjectRootPartStubXml + | ||
171 | @" | ||
172 | <OtherParts> | ||
173 | <Part> | ||
174 | <SceneObjectPart xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema""> | ||
175 | <AllowedDrop>false</AllowedDrop> | ||
176 | <CreatorID><Guid>a6dacf01-4636-4bb9-8a97-30609438af9d</Guid></CreatorID> | ||
177 | <FolderID><Guid>9958feb1-02a6-49e4-a4ce-eba6f578ee13</Guid></FolderID> | ||
178 | <InventorySerial>3</InventorySerial> | ||
179 | <UUID><Guid>9958feb1-02a6-49e4-a4ce-eba6f578ee13</Guid></UUID> | ||
180 | <LocalId>1154704500</LocalId> | ||
181 | <Name>Alien Head 1</Name> | ||
182 | <Material>3</Material> | ||
183 | <PassTouches>false</PassTouches> | ||
184 | <PassCollisions>false</PassCollisions> | ||
185 | <RegionHandle>21990232560640000</RegionHandle> | ||
186 | <ScriptAccessPin>0</ScriptAccessPin> | ||
187 | <GroupPosition><X>125.5655</X><Y>127.346</Y><Z>22.48036</Z></GroupPosition> | ||
188 | <OffsetPosition><X>-0.2171936</X><Y>0.1083984</Y><Z>0.0009994507</Z></OffsetPosition> | ||
189 | <RotationOffset><X>-0.5122106</X><Y>0.4851225</Y><Z>-0.4957454</Z><W>0.5064908</W></RotationOffset> | ||
190 | <Velocity><X>0</X><Y>0</Y><Z>0</Z></Velocity> | ||
191 | <AngularVelocity><X>0</X><Y>0</Y><Z>0</Z></AngularVelocity> | ||
192 | <Acceleration><X>0</X><Y>0</Y><Z>0</Z></Acceleration> | ||
193 | <Description>(No Description)</Description> | ||
194 | <Color><R>0</R><G>0</G><B>0</B><A>255</A></Color> | ||
195 | <Text/> | ||
196 | <SitName/> | ||
197 | <TouchName/> | ||
198 | <LinkNum>253</LinkNum> | ||
199 | <ClickAction>0</ClickAction> | ||
200 | <Shape> | ||
201 | <ProfileCurve>5</ProfileCurve> | ||
202 | <TextureEntry>Vw3dpvgTRUOiIUOGsnpWlAB/f38AAAAAgL8AAACAPwAAAAAAAAAF4ABAAAAAAAAAAAAAAAAAAAAAAAAAAAAA</TextureEntry> | ||
203 | <ExtraParams>AA==</ExtraParams> | ||
204 | <PathBegin>0</PathBegin> | ||
205 | <PathCurve>32</PathCurve> | ||
206 | <PathEnd>0</PathEnd> | ||
207 | <PathRadiusOffset>0</PathRadiusOffset> | ||
208 | <PathRevolutions>0</PathRevolutions> | ||
209 | <PathScaleX>100</PathScaleX> | ||
210 | <PathScaleY>100</PathScaleY> | ||
211 | <PathShearX>0</PathShearX> | ||
212 | <PathShearY>0</PathShearY> | ||
213 | <PathSkew>0</PathSkew> | ||
214 | <PathTaperX>0</PathTaperX> | ||
215 | <PathTaperY>0</PathTaperY> | ||
216 | <PathTwist>0</PathTwist> | ||
217 | <PathTwistBegin>0</PathTwistBegin> | ||
218 | <PCode>9</PCode> | ||
219 | <ProfileBegin>0</ProfileBegin> | ||
220 | <ProfileEnd>0</ProfileEnd> | ||
221 | <ProfileHollow>0</ProfileHollow> | ||
222 | <State>9</State> | ||
223 | <LastAttachPoint>0</LastAttachPoint> | ||
224 | <ProfileShape>HalfCircle</ProfileShape> | ||
225 | <HollowShape>Same</HollowShape> | ||
226 | <SculptTexture><Guid>00000000-0000-0000-0000-000000000000</Guid></SculptTexture> | ||
227 | <SculptType>0</SculptType> | ||
228 | <FlexiSoftness>0</FlexiSoftness> | ||
229 | <FlexiTension>0</FlexiTension> | ||
230 | <FlexiDrag>0</FlexiDrag> | ||
231 | <FlexiGravity>0</FlexiGravity> | ||
232 | <FlexiWind>0</FlexiWind> | ||
233 | <FlexiForceX>0</FlexiForceX> | ||
234 | <FlexiForceY>0</FlexiForceY> | ||
235 | <FlexiForceZ>0</FlexiForceZ> | ||
236 | <LightColorR>0</LightColorR> | ||
237 | <LightColorG>0</LightColorG> | ||
238 | <LightColorB>0</LightColorB> | ||
239 | <LightColorA>1</LightColorA> | ||
240 | <LightRadius>0</LightRadius> | ||
241 | <LightCutoff>0</LightCutoff> | ||
242 | <LightFalloff>0</LightFalloff> | ||
243 | <LightIntensity>1</LightIntensity> | ||
244 | <FlexiEntry>false</FlexiEntry> | ||
245 | <LightEntry>false</LightEntry> | ||
246 | <SculptEntry>false</SculptEntry> | ||
247 | </Shape> | ||
248 | <Scale><X>0.1148195</X><Y>0.0143891</Y><Z>0.02768878</Z></Scale> | ||
249 | <SitTargetOrientation><X>0</X><Y>0</Y><Z>0</Z><W>1</W></SitTargetOrientation> | ||
250 | <SitTargetPosition><X>0</X><Y>0</Y><Z>0</Z></SitTargetPosition> | ||
251 | <SitTargetPositionLL><X>0</X><Y>0</Y><Z>0</Z></SitTargetPositionLL> | ||
252 | <SitTargetOrientationLL><X>0</X><Y>0</Y><Z>0</Z><W>1</W></SitTargetOrientationLL> | ||
253 | <ParentID>1154704499</ParentID> | ||
254 | <CreationDate>1256611042</CreationDate> | ||
255 | <Category>0</Category> | ||
256 | <SalePrice>10</SalePrice> | ||
257 | <ObjectSaleType>0</ObjectSaleType> | ||
258 | <OwnershipCost>0</OwnershipCost> | ||
259 | <GroupID><Guid>00000000-0000-0000-0000-000000000000</Guid></GroupID> | ||
260 | <OwnerID><Guid>7b2022f0-5f19-488c-b7e5-829d8f96b448</Guid></OwnerID> | ||
261 | <LastOwnerID><Guid>7b2022f0-5f19-488c-b7e5-829d8f96b448</Guid></LastOwnerID> | ||
262 | <BaseMask>647168</BaseMask> | ||
263 | <OwnerMask>647168</OwnerMask> | ||
264 | <GroupMask>0</GroupMask> | ||
265 | <EveryoneMask>0</EveryoneMask> | ||
266 | <NextOwnerMask>581632</NextOwnerMask> | ||
267 | <Flags>None</Flags> | ||
268 | <CollisionSound><Guid>00000000-0000-0000-0000-000000000000</Guid></CollisionSound> | ||
269 | <CollisionSoundVolume>0</CollisionSoundVolume> | ||
270 | <AttachedPos><X>0</X><Y>0</Y><Z>0</Z></AttachedPos> | ||
271 | <TextureAnimation/> | ||
272 | <ParticleSystem/> | ||
273 | <PayPrice0>-2</PayPrice0> | ||
274 | <PayPrice1>-2</PayPrice1> | ||
275 | <PayPrice2>-2</PayPrice2> | ||
276 | <PayPrice3>-2</PayPrice3> | ||
277 | <PayPrice4>-2</PayPrice4> | ||
278 | </SceneObjectPart> | ||
279 | </Part> | ||
280 | <Part> | ||
281 | <SceneObjectPart xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema""> | ||
282 | <AllowedDrop>false</AllowedDrop> | ||
283 | <CreatorID><Guid>a6dacf01-4636-4bb9-8a97-30609438af9d</Guid></CreatorID> | ||
284 | <FolderID><Guid>674b6b86-f5aa-439a-8e00-0d75bc08c80a</Guid></FolderID> | ||
285 | <InventorySerial>3</InventorySerial> | ||
286 | <UUID><Guid>674b6b86-f5aa-439a-8e00-0d75bc08c80a</Guid></UUID> | ||
287 | <LocalId>1154704501</LocalId> | ||
288 | <Name>Alien Head 2</Name> | ||
289 | <Material>3</Material> | ||
290 | <PassTouches>false</PassTouches> | ||
291 | <PassCollisions>false</PassCollisions> | ||
292 | <RegionHandle>21990232560640000</RegionHandle> | ||
293 | <ScriptAccessPin>0</ScriptAccessPin> | ||
294 | <GroupPosition><X>125.5655</X><Y>127.346</Y><Z>22.48036</Z></GroupPosition> | ||
295 | <OffsetPosition><X>-0.2490997</X><Y>0.08520126</Y><Z>0.0009002686</Z></OffsetPosition> | ||
296 | <RotationOffset><X>-0.4765368</X><Y>0.5194498</Y><Z>-0.5301372</Z><W>0.4712104</W></RotationOffset> | ||
297 | <Velocity><X>0</X><Y>0</Y><Z>0</Z></Velocity> | ||
298 | <AngularVelocity><X>0</X><Y>0</Y><Z>0</Z></AngularVelocity> | ||
299 | <Acceleration><X>0</X><Y>0</Y><Z>0</Z></Acceleration> | ||
300 | <Description>(No Description)</Description> | ||
301 | <Color><R>0</R><G>0</G><B>0</B><A>255</A></Color> | ||
302 | <Text/> | ||
303 | <SitName/> | ||
304 | <TouchName/> | ||
305 | <LinkNum>252</LinkNum> | ||
306 | <ClickAction>0</ClickAction> | ||
307 | <Shape> | ||
308 | <ProfileCurve>0</ProfileCurve> | ||
309 | <TextureEntry>Vw3dpvgTRUOiIUOGsnpWlAB/f38AAAAAgL8AAACAPwAAAAAAAAAF4ABAAAAAAAAAAAAAAAAAAAAAAAAAAAAA</TextureEntry> | ||
310 | <ExtraParams>AA==</ExtraParams> | ||
311 | <PathBegin>0</PathBegin> | ||
312 | <PathCurve>32</PathCurve> | ||
313 | <PathEnd>0</PathEnd> | ||
314 | <PathRadiusOffset>0</PathRadiusOffset> | ||
315 | <PathRevolutions>0</PathRevolutions> | ||
316 | <PathScaleX>100</PathScaleX> | ||
317 | <PathScaleY>150</PathScaleY> | ||
318 | <PathShearX>0</PathShearX> | ||
319 | <PathShearY>0</PathShearY> | ||
320 | <PathSkew>0</PathSkew> | ||
321 | <PathTaperX>0</PathTaperX> | ||
322 | <PathTaperY>0</PathTaperY> | ||
323 | <PathTwist>0</PathTwist> | ||
324 | <PathTwistBegin>0</PathTwistBegin> | ||
325 | <PCode>9</PCode> | ||
326 | <ProfileBegin>0</ProfileBegin> | ||
327 | <ProfileEnd>0</ProfileEnd> | ||
328 | <ProfileHollow>0</ProfileHollow> | ||
329 | <State>9</State> | ||
330 | <LastAttachPoint>0</LastAttachPoint> | ||
331 | <ProfileShape>Circle</ProfileShape> | ||
332 | <HollowShape>Same</HollowShape> | ||
333 | <SculptTexture><Guid>00000000-0000-0000-0000-000000000000</Guid></SculptTexture> | ||
334 | <SculptType>0</SculptType> | ||
335 | <FlexiSoftness>0</FlexiSoftness> | ||
336 | <FlexiTension>0</FlexiTension> | ||
337 | <FlexiDrag>0</FlexiDrag> | ||
338 | <FlexiGravity>0</FlexiGravity> | ||
339 | <FlexiWind>0</FlexiWind> | ||
340 | <FlexiForceX>0</FlexiForceX> | ||
341 | <FlexiForceY>0</FlexiForceY> | ||
342 | <FlexiForceZ>0</FlexiForceZ> | ||
343 | <LightColorR>0</LightColorR> | ||
344 | <LightColorG>0</LightColorG> | ||
345 | <LightColorB>0</LightColorB> | ||
346 | <LightColorA>1</LightColorA> | ||
347 | <LightRadius>0</LightRadius> | ||
348 | <LightCutoff>0</LightCutoff> | ||
349 | <LightFalloff>0</LightFalloff> | ||
350 | <LightIntensity>1</LightIntensity> | ||
351 | <FlexiEntry>false</FlexiEntry> | ||
352 | <LightEntry>false</LightEntry> | ||
353 | <SculptEntry>false</SculptEntry> | ||
354 | </Shape> | ||
355 | <Scale><X>0.03574385</X><Y>0.05958032</Y><Z>0.04764182</Z></Scale> | ||
356 | <SitTargetOrientation><X>0</X><Y>0</Y><Z>0</Z><W>1</W></SitTargetOrientation> | ||
357 | <SitTargetPosition><X>0</X><Y>0</Y><Z>0</Z></SitTargetPosition> | ||
358 | <SitTargetPositionLL><X>0</X><Y>0</Y><Z>0</Z></SitTargetPositionLL> | ||
359 | <SitTargetOrientationLL><X>0</X><Y>0</Y><Z>0</Z><W>1</W></SitTargetOrientationLL> | ||
360 | <ParentID>1154704499</ParentID> | ||
361 | <CreationDate>1256611042</CreationDate> | ||
362 | <Category>0</Category> | ||
363 | <SalePrice>10</SalePrice> | ||
364 | <ObjectSaleType>0</ObjectSaleType> | ||
365 | <OwnershipCost>0</OwnershipCost> | ||
366 | <GroupID><Guid>00000000-0000-0000-0000-000000000000</Guid></GroupID> | ||
367 | <OwnerID><Guid>7b2022f0-5f19-488c-b7e5-829d8f96b448</Guid></OwnerID> | ||
368 | <LastOwnerID><Guid>7b2022f0-5f19-488c-b7e5-829d8f96b448</Guid></LastOwnerID> | ||
369 | <BaseMask>647168</BaseMask> | ||
370 | <OwnerMask>647168</OwnerMask> | ||
371 | <GroupMask>0</GroupMask> | ||
372 | <EveryoneMask>0</EveryoneMask> | ||
373 | <NextOwnerMask>581632</NextOwnerMask> | ||
374 | <Flags>None</Flags> | ||
375 | <CollisionSound><Guid>00000000-0000-0000-0000-000000000000</Guid></CollisionSound> | ||
376 | <CollisionSoundVolume>0</CollisionSoundVolume> | ||
377 | <AttachedPos><X>0</X><Y>0</Y><Z>0</Z></AttachedPos> | ||
378 | <TextureAnimation/> | ||
379 | <ParticleSystem/> | ||
380 | <PayPrice0>-2</PayPrice0> | ||
381 | <PayPrice1>-2</PayPrice1> | ||
382 | <PayPrice2>-2</PayPrice2> | ||
383 | <PayPrice3>-2</PayPrice3> | ||
384 | <PayPrice4>-2</PayPrice4> | ||
385 | </SceneObjectPart> | ||
386 | </Part> | ||
387 | </OtherParts> | ||
388 | </SceneObjectGroup>"; | ||
389 | |||
390 | private const string ObjectWithBadFloatsXml = @" | ||
152 | <SceneObjectGroup> | 391 | <SceneObjectGroup> |
153 | <RootPart> | 392 | <RootPart> |
154 | <SceneObjectPart xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema""> | 393 | <SceneObjectPart xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema""> |
@@ -255,7 +494,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests | |||
255 | <OtherParts /> | 494 | <OtherParts /> |
256 | </SceneObjectGroup>"; | 495 | </SceneObjectGroup>"; |
257 | 496 | ||
258 | private string xml2 = @" | 497 | private const string ObjectWithNoPartsXml2 = @" |
259 | <SceneObjectGroup> | 498 | <SceneObjectGroup> |
260 | <SceneObjectPart xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema""> | 499 | <SceneObjectPart xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema""> |
261 | <CreatorID><UUID>b46ef588-411e-4a8b-a284-d7dcfe8e74ef</UUID></CreatorID> | 500 | <CreatorID><UUID>b46ef588-411e-4a8b-a284-d7dcfe8e74ef</UUID></CreatorID> |
@@ -331,6 +570,20 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests | |||
331 | <EveryoneMask>0</EveryoneMask> | 570 | <EveryoneMask>0</EveryoneMask> |
332 | <NextOwnerMask>2147483647</NextOwnerMask> | 571 | <NextOwnerMask>2147483647</NextOwnerMask> |
333 | <Flags>None</Flags> | 572 | <Flags>None</Flags> |
573 | <DynAttrs> | ||
574 | <llsd> | ||
575 | <map> | ||
576 | <key>MyNamespace</key> | ||
577 | <map> | ||
578 | <key>MyStore</key> | ||
579 | <map> | ||
580 | <key>last words</key> | ||
581 | <string>Rosebud</string> | ||
582 | </map> | ||
583 | </map> | ||
584 | </map> | ||
585 | </llsd> | ||
586 | </DynAttrs> | ||
334 | <SitTargetAvatar><UUID>00000000-0000-0000-0000-000000000000</UUID></SitTargetAvatar> | 587 | <SitTargetAvatar><UUID>00000000-0000-0000-0000-000000000000</UUID></SitTargetAvatar> |
335 | </SceneObjectPart> | 588 | </SceneObjectPart> |
336 | <OtherParts /> | 589 | <OtherParts /> |
@@ -348,17 +601,58 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests | |||
348 | } | 601 | } |
349 | 602 | ||
350 | [Test] | 603 | [Test] |
351 | public void TestDeserializeXml() | 604 | public void TestDeserializeXmlObjectWithNoOtherParts() |
352 | { | 605 | { |
353 | TestHelpers.InMethod(); | 606 | TestHelpers.InMethod(); |
354 | //log4net.Config.XmlConfigurator.Configure(); | 607 | TestHelpers.EnableLogging(); |
355 | 608 | ||
356 | SceneObjectGroup so = SceneObjectSerializer.FromOriginalXmlFormat(xml); | 609 | SceneObjectGroup so = SceneObjectSerializer.FromOriginalXmlFormat(ObjectWithNoOtherPartsXml); |
357 | SceneObjectPart rootPart = so.RootPart; | 610 | SceneObjectPart rootPart = so.RootPart; |
358 | 611 | ||
359 | Assert.That(rootPart.UUID, Is.EqualTo(new UUID("e6a5a05e-e8cc-4816-8701-04165e335790"))); | 612 | Assert.That(rootPart.UUID, Is.EqualTo(new UUID("e6a5a05e-e8cc-4816-8701-04165e335790"))); |
360 | Assert.That(rootPart.CreatorID, Is.EqualTo(new UUID("a6dacf01-4636-4bb9-8a97-30609438af9d"))); | 613 | Assert.That(rootPart.CreatorID, Is.EqualTo(new UUID("a6dacf01-4636-4bb9-8a97-30609438af9d"))); |
361 | Assert.That(rootPart.Name, Is.EqualTo("PrimMyRide")); | 614 | Assert.That(rootPart.Name, Is.EqualTo("PrimMyRide")); |
615 | OSDMap store = rootPart.DynAttrs.GetStore("MyNamespace", "MyStore"); | ||
616 | Assert.AreEqual(42, store["the answer"].AsInteger()); | ||
617 | |||
618 | // TODO: Check other properties | ||
619 | } | ||
620 | |||
621 | [Test] | ||
622 | public void TestDeserializeXmlObjectWithOtherParts() | ||
623 | { | ||
624 | TestHelpers.InMethod(); | ||
625 | TestHelpers.EnableLogging(); | ||
626 | |||
627 | SceneObjectGroup so = SceneObjectSerializer.FromOriginalXmlFormat(ObjectWithOtherPartsXml); | ||
628 | SceneObjectPart[] parts = so.Parts; | ||
629 | Assert.AreEqual(3, so.Parts.Length); | ||
630 | |||
631 | { | ||
632 | SceneObjectPart part = parts[0]; | ||
633 | |||
634 | Assert.That(part.UUID, Is.EqualTo(new UUID("e6a5a05e-e8cc-4816-8701-04165e335790"))); | ||
635 | Assert.That(part.CreatorID, Is.EqualTo(new UUID("a6dacf01-4636-4bb9-8a97-30609438af9d"))); | ||
636 | Assert.That(part.Name, Is.EqualTo("PrimMyRide")); | ||
637 | OSDMap store = part.DynAttrs.GetStore("MyNamespace", "MyStore"); | ||
638 | Assert.AreEqual(42, store["the answer"].AsInteger()); | ||
639 | } | ||
640 | |||
641 | { | ||
642 | SceneObjectPart part = parts[1]; | ||
643 | |||
644 | Assert.That(part.UUID, Is.EqualTo(new UUID("9958feb1-02a6-49e4-a4ce-eba6f578ee13"))); | ||
645 | Assert.That(part.CreatorID, Is.EqualTo(new UUID("a6dacf01-4636-4bb9-8a97-30609438af9d"))); | ||
646 | Assert.That(part.Name, Is.EqualTo("Alien Head 1")); | ||
647 | } | ||
648 | |||
649 | { | ||
650 | SceneObjectPart part = parts[2]; | ||
651 | |||
652 | Assert.That(part.UUID, Is.EqualTo(new UUID("674b6b86-f5aa-439a-8e00-0d75bc08c80a"))); | ||
653 | Assert.That(part.CreatorID, Is.EqualTo(new UUID("a6dacf01-4636-4bb9-8a97-30609438af9d"))); | ||
654 | Assert.That(part.Name, Is.EqualTo("Alien Head 2")); | ||
655 | } | ||
362 | 656 | ||
363 | // TODO: Check other properties | 657 | // TODO: Check other properties |
364 | } | 658 | } |
@@ -369,7 +663,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests | |||
369 | TestHelpers.InMethod(); | 663 | TestHelpers.InMethod(); |
370 | // log4net.Config.XmlConfigurator.Configure(); | 664 | // log4net.Config.XmlConfigurator.Configure(); |
371 | 665 | ||
372 | SceneObjectGroup so = SceneObjectSerializer.FromOriginalXmlFormat(badFloatsXml); | 666 | SceneObjectGroup so = SceneObjectSerializer.FromOriginalXmlFormat(ObjectWithBadFloatsXml); |
373 | SceneObjectPart rootPart = so.RootPart; | 667 | SceneObjectPart rootPart = so.RootPart; |
374 | 668 | ||
375 | Assert.That(rootPart.UUID, Is.EqualTo(new UUID("e6a5a05e-e8cc-4816-8701-04165e335790"))); | 669 | Assert.That(rootPart.UUID, Is.EqualTo(new UUID("e6a5a05e-e8cc-4816-8701-04165e335790"))); |
@@ -409,6 +703,15 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests | |||
409 | rp.CreatorID = rpCreatorId; | 703 | rp.CreatorID = rpCreatorId; |
410 | rp.Shape = shape; | 704 | rp.Shape = shape; |
411 | 705 | ||
706 | string daNamespace = "MyNamespace"; | ||
707 | string daStoreName = "MyStore"; | ||
708 | string daKey = "foo"; | ||
709 | string daValue = "bar"; | ||
710 | OSDMap myStore = new OSDMap(); | ||
711 | myStore.Add(daKey, daValue); | ||
712 | rp.DynAttrs = new DAMap(); | ||
713 | rp.DynAttrs.SetStore(daNamespace, daStoreName, myStore); | ||
714 | |||
412 | SceneObjectGroup so = new SceneObjectGroup(rp); | 715 | SceneObjectGroup so = new SceneObjectGroup(rp); |
413 | 716 | ||
414 | // Need to add the object to the scene so that the request to get script state succeeds | 717 | // Need to add the object to the scene so that the request to get script state succeeds |
@@ -424,6 +727,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests | |||
424 | UUID uuid = UUID.Zero; | 727 | UUID uuid = UUID.Zero; |
425 | string name = null; | 728 | string name = null; |
426 | UUID creatorId = UUID.Zero; | 729 | UUID creatorId = UUID.Zero; |
730 | DAMap daMap = null; | ||
427 | 731 | ||
428 | while (xtr.Read() && xtr.Name != "SceneObjectPart") | 732 | while (xtr.Read() && xtr.Name != "SceneObjectPart") |
429 | { | 733 | { |
@@ -449,6 +753,10 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests | |||
449 | creatorId = UUID.Parse(xtr.ReadElementString("UUID")); | 753 | creatorId = UUID.Parse(xtr.ReadElementString("UUID")); |
450 | xtr.ReadEndElement(); | 754 | xtr.ReadEndElement(); |
451 | break; | 755 | break; |
756 | case "DynAttrs": | ||
757 | daMap = new DAMap(); | ||
758 | daMap.ReadXml(xtr); | ||
759 | break; | ||
452 | } | 760 | } |
453 | } | 761 | } |
454 | 762 | ||
@@ -462,6 +770,8 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests | |||
462 | Assert.That(uuid, Is.EqualTo(rpUuid)); | 770 | Assert.That(uuid, Is.EqualTo(rpUuid)); |
463 | Assert.That(name, Is.EqualTo(rpName)); | 771 | Assert.That(name, Is.EqualTo(rpName)); |
464 | Assert.That(creatorId, Is.EqualTo(rpCreatorId)); | 772 | Assert.That(creatorId, Is.EqualTo(rpCreatorId)); |
773 | Assert.NotNull(daMap); | ||
774 | Assert.AreEqual(daValue, daMap.GetStore(daNamespace, daStoreName)[daKey].AsString()); | ||
465 | } | 775 | } |
466 | 776 | ||
467 | [Test] | 777 | [Test] |
@@ -470,12 +780,14 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests | |||
470 | TestHelpers.InMethod(); | 780 | TestHelpers.InMethod(); |
471 | //log4net.Config.XmlConfigurator.Configure(); | 781 | //log4net.Config.XmlConfigurator.Configure(); |
472 | 782 | ||
473 | SceneObjectGroup so = m_serialiserModule.DeserializeGroupFromXml2(xml2); | 783 | SceneObjectGroup so = m_serialiserModule.DeserializeGroupFromXml2(ObjectWithNoPartsXml2); |
474 | SceneObjectPart rootPart = so.RootPart; | 784 | SceneObjectPart rootPart = so.RootPart; |
475 | 785 | ||
476 | Assert.That(rootPart.UUID, Is.EqualTo(new UUID("9be68fdd-f740-4a0f-9675-dfbbb536b946"))); | 786 | Assert.That(rootPart.UUID, Is.EqualTo(new UUID("9be68fdd-f740-4a0f-9675-dfbbb536b946"))); |
477 | Assert.That(rootPart.CreatorID, Is.EqualTo(new UUID("b46ef588-411e-4a8b-a284-d7dcfe8e74ef"))); | 787 | Assert.That(rootPart.CreatorID, Is.EqualTo(new UUID("b46ef588-411e-4a8b-a284-d7dcfe8e74ef"))); |
478 | Assert.That(rootPart.Name, Is.EqualTo("PrimFun")); | 788 | Assert.That(rootPart.Name, Is.EqualTo("PrimFun")); |
789 | OSDMap store = rootPart.DynAttrs.GetStore("MyNamespace", "MyStore"); | ||
790 | Assert.AreEqual("Rosebud", store["last words"].AsString()); | ||
479 | 791 | ||
480 | // TODO: Check other properties | 792 | // TODO: Check other properties |
481 | } | 793 | } |
@@ -500,6 +812,15 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests | |||
500 | rp.CreatorID = rpCreatorId; | 812 | rp.CreatorID = rpCreatorId; |
501 | rp.Shape = shape; | 813 | rp.Shape = shape; |
502 | 814 | ||
815 | string daNamespace = "MyNamespace"; | ||
816 | string daStoreName = "MyStore"; | ||
817 | string daKey = "foo"; | ||
818 | string daValue = "bar"; | ||
819 | OSDMap myStore = new OSDMap(); | ||
820 | myStore.Add(daKey, daValue); | ||
821 | rp.DynAttrs = new DAMap(); | ||
822 | rp.DynAttrs.SetStore(daNamespace, daStoreName, myStore); | ||
823 | |||
503 | SceneObjectGroup so = new SceneObjectGroup(rp); | 824 | SceneObjectGroup so = new SceneObjectGroup(rp); |
504 | 825 | ||
505 | // Need to add the object to the scene so that the request to get script state succeeds | 826 | // Need to add the object to the scene so that the request to get script state succeeds |
@@ -516,6 +837,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests | |||
516 | UUID uuid = UUID.Zero; | 837 | UUID uuid = UUID.Zero; |
517 | string name = null; | 838 | string name = null; |
518 | UUID creatorId = UUID.Zero; | 839 | UUID creatorId = UUID.Zero; |
840 | DAMap daMap = null; | ||
519 | 841 | ||
520 | while (xtr.Read() && xtr.Name != "SceneObjectPart") | 842 | while (xtr.Read() && xtr.Name != "SceneObjectPart") |
521 | { | 843 | { |
@@ -537,6 +859,10 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests | |||
537 | creatorId = UUID.Parse(xtr.ReadElementString("Guid")); | 859 | creatorId = UUID.Parse(xtr.ReadElementString("Guid")); |
538 | xtr.ReadEndElement(); | 860 | xtr.ReadEndElement(); |
539 | break; | 861 | break; |
862 | case "DynAttrs": | ||
863 | daMap = new DAMap(); | ||
864 | daMap.ReadXml(xtr); | ||
865 | break; | ||
540 | } | 866 | } |
541 | } | 867 | } |
542 | 868 | ||
@@ -549,6 +875,8 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests | |||
549 | Assert.That(uuid, Is.EqualTo(rpUuid)); | 875 | Assert.That(uuid, Is.EqualTo(rpUuid)); |
550 | Assert.That(name, Is.EqualTo(rpName)); | 876 | Assert.That(name, Is.EqualTo(rpName)); |
551 | Assert.That(creatorId, Is.EqualTo(rpCreatorId)); | 877 | Assert.That(creatorId, Is.EqualTo(rpCreatorId)); |
878 | Assert.NotNull(daMap); | ||
879 | Assert.AreEqual(daValue, daMap.GetStore(daNamespace, daStoreName)[daKey].AsString()); | ||
552 | } | 880 | } |
553 | } | 881 | } |
554 | } \ No newline at end of file | 882 | } \ No newline at end of file |