From 58efd761d13bd4f2617fcb3f94bbe265880589e3 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 13 Apr 2011 21:17:43 +0100
Subject: Add coalesced scene objects class and serializer. This is currently
only used by the TestRezCoalescedObject() regression test.
This structure matches the existing one for SceneObjects and will allow code to be reused by the uuid gatherer, other tests, etc.
Test is not yet fully implemented due to a bug in rezzing coalesced objects where they all get the same name as the item.
Only one object should get the same name as the item, which appears to be the one selected last when the the objects were coalesced in the first place.
This bug will be addressed shortly.
---
OpenSim/Tests/Common/Setup/AssetHelpers.cs | 15 +++++++++++++++
1 file changed, 15 insertions(+)
(limited to 'OpenSim/Tests/Common/Setup/AssetHelpers.cs')
diff --git a/OpenSim/Tests/Common/Setup/AssetHelpers.cs b/OpenSim/Tests/Common/Setup/AssetHelpers.cs
index ff4423f..af66d7f 100644
--- a/OpenSim/Tests/Common/Setup/AssetHelpers.cs
+++ b/OpenSim/Tests/Common/Setup/AssetHelpers.cs
@@ -71,6 +71,21 @@ namespace OpenSim.Tests.Common
Encoding.ASCII.GetBytes(SceneObjectSerializer.ToOriginalXmlFormat(sog)),
sog.OwnerID);
}
+
+ ///
+ /// Create an asset from the given scene object.
+ ///
+ ///
+ ///
+ ///
+ public static AssetBase CreateAsset(UUID assetUuid, CoalescedSceneObjects coa)
+ {
+ return CreateAsset(
+ assetUuid,
+ AssetType.Object,
+ Encoding.ASCII.GetBytes(CoalescedSceneObjectsSerializer.ToXml(coa)),
+ coa.CreatorId);
+ }
///
/// Create an asset from the given data.
--
cgit v1.1
From 821e67fb950721c0bb8105318e41d7982cf986f2 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 14 Apr 2011 20:59:52 +0100
Subject: implement stub TestLoadCoalesecedItem(). Doesn't do what it's meant
to do yet.
---
OpenSim/Tests/Common/Setup/AssetHelpers.cs | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Tests/Common/Setup/AssetHelpers.cs')
diff --git a/OpenSim/Tests/Common/Setup/AssetHelpers.cs b/OpenSim/Tests/Common/Setup/AssetHelpers.cs
index af66d7f..971c6bc 100644
--- a/OpenSim/Tests/Common/Setup/AssetHelpers.cs
+++ b/OpenSim/Tests/Common/Setup/AssetHelpers.cs
@@ -55,7 +55,7 @@ namespace OpenSim.Tests.Common
AssetBase asset = CreateAsset(UUID.Random(), AssetType.Notecard, "hello", creatorId);
scene.AssetService.Store(asset);
return asset;
- }
+ }
///
/// Create an asset from the given scene object.
@@ -75,6 +75,20 @@ namespace OpenSim.Tests.Common
///
/// Create an asset from the given scene object.
///
+ ///
+ /// The hexadecimal last part of the UUID for the asset created. A UUID of the form "00000000-0000-0000-0000-{0:XD12}"
+ /// will be used.
+ ///
+ ///
+ ///
+ public static AssetBase CreateAsset(int assetUuidTail, CoalescedSceneObjects coa)
+ {
+ return CreateAsset(new UUID(string.Format("00000000-0000-0000-0000-{0:X12}", assetUuidTail)), coa);
+ }
+
+ ///
+ /// Create an asset from the given scene object.
+ ///
///
///
///
@@ -85,7 +99,7 @@ namespace OpenSim.Tests.Common
AssetType.Object,
Encoding.ASCII.GetBytes(CoalescedSceneObjectsSerializer.ToXml(coa)),
coa.CreatorId);
- }
+ }
///
/// Create an asset from the given data.
--
cgit v1.1
From a0d80140f2d0ad6dd63970a3a3d5c0da8320ae75 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 15 Apr 2011 00:42:06 +0100
Subject: Make all the objects in a coalescence reappears after being loaded
from an IAR. This still doesn't work proprerly since some required
textures/contained item assets might be missing.
From pure code inspection, it looks like the uuid gatherer may get most asset uuids because the scene object serializer naively pulls non-root parts from all contained scene objects into one mega-object. However, root part uuids may well still be missing, and there may be other odd artifacts from this bug.
It appears that storing the size of the coalescence and the offsets is redundant, since one can work out this information from the position data already in the scene object groups.
---
OpenSim/Tests/Common/Setup/AssetHelpers.cs | 7 +++++++
1 file changed, 7 insertions(+)
(limited to 'OpenSim/Tests/Common/Setup/AssetHelpers.cs')
diff --git a/OpenSim/Tests/Common/Setup/AssetHelpers.cs b/OpenSim/Tests/Common/Setup/AssetHelpers.cs
index 971c6bc..d572249 100644
--- a/OpenSim/Tests/Common/Setup/AssetHelpers.cs
+++ b/OpenSim/Tests/Common/Setup/AssetHelpers.cs
@@ -30,6 +30,7 @@ using OpenMetaverse;
using OpenSim.Framework;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Region.Framework.Scenes.Serialization;
+using OpenSim.Services.Interfaces;
namespace OpenSim.Tests.Common
{
@@ -118,5 +119,11 @@ namespace OpenSim.Tests.Common
asset.Data = data;
return asset;
}
+
+ public static string ReadAssetAsString(IAssetService assetService, UUID uuid)
+ {
+ byte[] assetData = assetService.GetData(uuid.ToString());
+ return Encoding.ASCII.GetString(assetData);
+ }
}
}
--
cgit v1.1