diff options
author | Justin Clark-Casey (justincc) | 2013-06-27 23:14:28 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-06-27 23:14:28 +0100 |
commit | f7d09b898ad6df32b3f07cb64657623980178c2f (patch) | |
tree | f7f2b1117e9843267dab89993ad6d5492c1b3cc8 /OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs | |
parent | Update temporary "Unknown UserUMMTGUN2" name to "Unknown UserUMMTGUN3" to see... (diff) | |
download | opensim-SC_OLD-f7d09b898ad6df32b3f07cb64657623980178c2f.zip opensim-SC_OLD-f7d09b898ad6df32b3f07cb64657623980178c2f.tar.gz opensim-SC_OLD-f7d09b898ad6df32b3f07cb64657623980178c2f.tar.bz2 opensim-SC_OLD-f7d09b898ad6df32b3f07cb64657623980178c2f.tar.xz |
Make the concept of namespaces explicit in dynamic attributes
This is in order to reduce the likelihood of naming clashes, make it easier to filter in/out attributes, ensure uniformity, etc.
All dynattrs in the opensim distro itself or likely future ones should be in the "OpenSim" namespace.
This does alter the underlying dynattrs data structure. All data in previous structures may not be available, though old structures should not cause errors.
This is done without notice since this feature has been explicitly labelled as experimental, subject to change and has not been in a release.
However, existing materials data is being preserved by moving it to the "Materials" store in the "OpenSim" namespace.
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs | 44 |
1 files changed, 36 insertions, 8 deletions
diff --git a/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs b/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs index b4348c9..66059fb 100644 --- a/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs +++ b/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs | |||
@@ -144,7 +144,20 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests | |||
144 | <Flags>None</Flags> | 144 | <Flags>None</Flags> |
145 | <CollisionSound><Guid>00000000-0000-0000-0000-000000000000</Guid></CollisionSound> | 145 | <CollisionSound><Guid>00000000-0000-0000-0000-000000000000</Guid></CollisionSound> |
146 | <CollisionSoundVolume>0</CollisionSoundVolume> | 146 | <CollisionSoundVolume>0</CollisionSoundVolume> |
147 | <DynAttrs><llsd><map><key>MyStore</key><map><key>the answer</key><integer>42</integer></map></map></llsd></DynAttrs> | 147 | <DynAttrs> |
148 | <llsd> | ||
149 | <map> | ||
150 | <key>MyNamespace</key> | ||
151 | <map> | ||
152 | <key>MyStore</key> | ||
153 | <map> | ||
154 | <key>the answer</key> | ||
155 | <integer>42</integer> | ||
156 | </map> | ||
157 | </map> | ||
158 | </map> | ||
159 | </llsd> | ||
160 | </DynAttrs> | ||
148 | </SceneObjectPart> | 161 | </SceneObjectPart> |
149 | </RootPart> | 162 | </RootPart> |
150 | <OtherParts /> | 163 | <OtherParts /> |
@@ -333,7 +346,20 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests | |||
333 | <EveryoneMask>0</EveryoneMask> | 346 | <EveryoneMask>0</EveryoneMask> |
334 | <NextOwnerMask>2147483647</NextOwnerMask> | 347 | <NextOwnerMask>2147483647</NextOwnerMask> |
335 | <Flags>None</Flags> | 348 | <Flags>None</Flags> |
336 | <DynAttrs><llsd><map><key>MyStore</key><map><key>last words</key><string>Rosebud</string></map></map></llsd></DynAttrs> | 349 | <DynAttrs> |
350 | <llsd> | ||
351 | <map> | ||
352 | <key>MyNamespace</key> | ||
353 | <map> | ||
354 | <key>MyStore</key> | ||
355 | <map> | ||
356 | <key>last words</key> | ||
357 | <string>Rosebud</string> | ||
358 | </map> | ||
359 | </map> | ||
360 | </map> | ||
361 | </llsd> | ||
362 | </DynAttrs> | ||
337 | <SitTargetAvatar><UUID>00000000-0000-0000-0000-000000000000</UUID></SitTargetAvatar> | 363 | <SitTargetAvatar><UUID>00000000-0000-0000-0000-000000000000</UUID></SitTargetAvatar> |
338 | </SceneObjectPart> | 364 | </SceneObjectPart> |
339 | <OtherParts /> | 365 | <OtherParts /> |
@@ -362,7 +388,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests | |||
362 | Assert.That(rootPart.UUID, Is.EqualTo(new UUID("e6a5a05e-e8cc-4816-8701-04165e335790"))); | 388 | Assert.That(rootPart.UUID, Is.EqualTo(new UUID("e6a5a05e-e8cc-4816-8701-04165e335790"))); |
363 | Assert.That(rootPart.CreatorID, Is.EqualTo(new UUID("a6dacf01-4636-4bb9-8a97-30609438af9d"))); | 389 | Assert.That(rootPart.CreatorID, Is.EqualTo(new UUID("a6dacf01-4636-4bb9-8a97-30609438af9d"))); |
364 | Assert.That(rootPart.Name, Is.EqualTo("PrimMyRide")); | 390 | Assert.That(rootPart.Name, Is.EqualTo("PrimMyRide")); |
365 | OSDMap store = rootPart.DynAttrs["MyStore"]; | 391 | OSDMap store = rootPart.DynAttrs.GetStore("MyNamespace", "MyStore"); |
366 | Assert.AreEqual(42, store["the answer"].AsInteger()); | 392 | Assert.AreEqual(42, store["the answer"].AsInteger()); |
367 | 393 | ||
368 | // TODO: Check other properties | 394 | // TODO: Check other properties |
@@ -414,13 +440,14 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests | |||
414 | rp.CreatorID = rpCreatorId; | 440 | rp.CreatorID = rpCreatorId; |
415 | rp.Shape = shape; | 441 | rp.Shape = shape; |
416 | 442 | ||
443 | string daNamespace = "MyNamespace"; | ||
417 | string daStoreName = "MyStore"; | 444 | string daStoreName = "MyStore"; |
418 | string daKey = "foo"; | 445 | string daKey = "foo"; |
419 | string daValue = "bar"; | 446 | string daValue = "bar"; |
420 | OSDMap myStore = new OSDMap(); | 447 | OSDMap myStore = new OSDMap(); |
421 | myStore.Add(daKey, daValue); | 448 | myStore.Add(daKey, daValue); |
422 | rp.DynAttrs = new DAMap(); | 449 | rp.DynAttrs = new DAMap(); |
423 | rp.DynAttrs[daStoreName] = myStore; | 450 | rp.DynAttrs.SetStore(daNamespace, daStoreName, myStore); |
424 | 451 | ||
425 | SceneObjectGroup so = new SceneObjectGroup(rp); | 452 | SceneObjectGroup so = new SceneObjectGroup(rp); |
426 | 453 | ||
@@ -481,7 +508,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests | |||
481 | Assert.That(name, Is.EqualTo(rpName)); | 508 | Assert.That(name, Is.EqualTo(rpName)); |
482 | Assert.That(creatorId, Is.EqualTo(rpCreatorId)); | 509 | Assert.That(creatorId, Is.EqualTo(rpCreatorId)); |
483 | Assert.NotNull(daMap); | 510 | Assert.NotNull(daMap); |
484 | Assert.AreEqual(daValue, daMap[daStoreName][daKey].AsString()); | 511 | Assert.AreEqual(daValue, daMap.GetStore(daNamespace, daStoreName)[daKey].AsString()); |
485 | } | 512 | } |
486 | 513 | ||
487 | [Test] | 514 | [Test] |
@@ -496,7 +523,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests | |||
496 | Assert.That(rootPart.UUID, Is.EqualTo(new UUID("9be68fdd-f740-4a0f-9675-dfbbb536b946"))); | 523 | Assert.That(rootPart.UUID, Is.EqualTo(new UUID("9be68fdd-f740-4a0f-9675-dfbbb536b946"))); |
497 | Assert.That(rootPart.CreatorID, Is.EqualTo(new UUID("b46ef588-411e-4a8b-a284-d7dcfe8e74ef"))); | 524 | Assert.That(rootPart.CreatorID, Is.EqualTo(new UUID("b46ef588-411e-4a8b-a284-d7dcfe8e74ef"))); |
498 | Assert.That(rootPart.Name, Is.EqualTo("PrimFun")); | 525 | Assert.That(rootPart.Name, Is.EqualTo("PrimFun")); |
499 | OSDMap store = rootPart.DynAttrs["MyStore"]; | 526 | OSDMap store = rootPart.DynAttrs.GetStore("MyNamespace", "MyStore"); |
500 | Assert.AreEqual("Rosebud", store["last words"].AsString()); | 527 | Assert.AreEqual("Rosebud", store["last words"].AsString()); |
501 | 528 | ||
502 | // TODO: Check other properties | 529 | // TODO: Check other properties |
@@ -522,13 +549,14 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests | |||
522 | rp.CreatorID = rpCreatorId; | 549 | rp.CreatorID = rpCreatorId; |
523 | rp.Shape = shape; | 550 | rp.Shape = shape; |
524 | 551 | ||
552 | string daNamespace = "MyNamespace"; | ||
525 | string daStoreName = "MyStore"; | 553 | string daStoreName = "MyStore"; |
526 | string daKey = "foo"; | 554 | string daKey = "foo"; |
527 | string daValue = "bar"; | 555 | string daValue = "bar"; |
528 | OSDMap myStore = new OSDMap(); | 556 | OSDMap myStore = new OSDMap(); |
529 | myStore.Add(daKey, daValue); | 557 | myStore.Add(daKey, daValue); |
530 | rp.DynAttrs = new DAMap(); | 558 | rp.DynAttrs = new DAMap(); |
531 | rp.DynAttrs[daStoreName] = myStore; | 559 | rp.DynAttrs.SetStore(daNamespace, daStoreName, myStore); |
532 | 560 | ||
533 | SceneObjectGroup so = new SceneObjectGroup(rp); | 561 | SceneObjectGroup so = new SceneObjectGroup(rp); |
534 | 562 | ||
@@ -585,7 +613,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests | |||
585 | Assert.That(name, Is.EqualTo(rpName)); | 613 | Assert.That(name, Is.EqualTo(rpName)); |
586 | Assert.That(creatorId, Is.EqualTo(rpCreatorId)); | 614 | Assert.That(creatorId, Is.EqualTo(rpCreatorId)); |
587 | Assert.NotNull(daMap); | 615 | Assert.NotNull(daMap); |
588 | Assert.AreEqual(daValue, daMap[daStoreName][daKey].AsString()); | 616 | Assert.AreEqual(daValue, daMap.GetStore(daNamespace, daStoreName)[daKey].AsString()); |
589 | } | 617 | } |
590 | } | 618 | } |
591 | } \ No newline at end of file | 619 | } \ No newline at end of file |