diff options
author | Mic Bowman | 2011-04-18 11:29:43 -0700 |
---|---|---|
committer | Mic Bowman | 2011-04-18 11:29:43 -0700 |
commit | 452ae375f0fdd62ba16fb170869ea470c6906cfe (patch) | |
tree | b5a7d364e509f2ff7f1b9086e2ba5658f4ee99ac /OpenSim/Tests/Common/Setup/AssetHelpers.cs | |
parent | Remove the call to remove tokens from the parent. Under heavy load (diff) | |
parent | Mantis #5442: Add admin_save_heightmap (diff) | |
download | opensim-SC_OLD-452ae375f0fdd62ba16fb170869ea470c6906cfe.zip opensim-SC_OLD-452ae375f0fdd62ba16fb170869ea470c6906cfe.tar.gz opensim-SC_OLD-452ae375f0fdd62ba16fb170869ea470c6906cfe.tar.bz2 opensim-SC_OLD-452ae375f0fdd62ba16fb170869ea470c6906cfe.tar.xz |
Merge branch 'master' into test-merge0418
Diffstat (limited to 'OpenSim/Tests/Common/Setup/AssetHelpers.cs')
-rw-r--r-- | OpenSim/Tests/Common/Setup/AssetHelpers.cs | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/OpenSim/Tests/Common/Setup/AssetHelpers.cs b/OpenSim/Tests/Common/Setup/AssetHelpers.cs index af66d7f..d572249 100644 --- a/OpenSim/Tests/Common/Setup/AssetHelpers.cs +++ b/OpenSim/Tests/Common/Setup/AssetHelpers.cs | |||
@@ -30,6 +30,7 @@ using OpenMetaverse; | |||
30 | using OpenSim.Framework; | 30 | using OpenSim.Framework; |
31 | using OpenSim.Region.Framework.Scenes; | 31 | using OpenSim.Region.Framework.Scenes; |
32 | using OpenSim.Region.Framework.Scenes.Serialization; | 32 | using OpenSim.Region.Framework.Scenes.Serialization; |
33 | using OpenSim.Services.Interfaces; | ||
33 | 34 | ||
34 | namespace OpenSim.Tests.Common | 35 | namespace OpenSim.Tests.Common |
35 | { | 36 | { |
@@ -55,7 +56,7 @@ namespace OpenSim.Tests.Common | |||
55 | AssetBase asset = CreateAsset(UUID.Random(), AssetType.Notecard, "hello", creatorId); | 56 | AssetBase asset = CreateAsset(UUID.Random(), AssetType.Notecard, "hello", creatorId); |
56 | scene.AssetService.Store(asset); | 57 | scene.AssetService.Store(asset); |
57 | return asset; | 58 | return asset; |
58 | } | 59 | } |
59 | 60 | ||
60 | /// <summary> | 61 | /// <summary> |
61 | /// Create an asset from the given scene object. | 62 | /// Create an asset from the given scene object. |
@@ -75,6 +76,20 @@ namespace OpenSim.Tests.Common | |||
75 | /// <summary> | 76 | /// <summary> |
76 | /// Create an asset from the given scene object. | 77 | /// Create an asset from the given scene object. |
77 | /// </summary> | 78 | /// </summary> |
79 | /// <param name="assetUuidTailZ"> | ||
80 | /// The hexadecimal last part of the UUID for the asset created. A UUID of the form "00000000-0000-0000-0000-{0:XD12}" | ||
81 | /// will be used. | ||
82 | /// </param> | ||
83 | /// <param name="coa"></param> | ||
84 | /// <returns></returns> | ||
85 | public static AssetBase CreateAsset(int assetUuidTail, CoalescedSceneObjects coa) | ||
86 | { | ||
87 | return CreateAsset(new UUID(string.Format("00000000-0000-0000-0000-{0:X12}", assetUuidTail)), coa); | ||
88 | } | ||
89 | |||
90 | /// <summary> | ||
91 | /// Create an asset from the given scene object. | ||
92 | /// </summary> | ||
78 | /// <param name="assetUuid"></param> | 93 | /// <param name="assetUuid"></param> |
79 | /// <param name="coa"></param> | 94 | /// <param name="coa"></param> |
80 | /// <returns></returns> | 95 | /// <returns></returns> |
@@ -85,7 +100,7 @@ namespace OpenSim.Tests.Common | |||
85 | AssetType.Object, | 100 | AssetType.Object, |
86 | Encoding.ASCII.GetBytes(CoalescedSceneObjectsSerializer.ToXml(coa)), | 101 | Encoding.ASCII.GetBytes(CoalescedSceneObjectsSerializer.ToXml(coa)), |
87 | coa.CreatorId); | 102 | coa.CreatorId); |
88 | } | 103 | } |
89 | 104 | ||
90 | /// <summary> | 105 | /// <summary> |
91 | /// Create an asset from the given data. | 106 | /// Create an asset from the given data. |
@@ -104,5 +119,11 @@ namespace OpenSim.Tests.Common | |||
104 | asset.Data = data; | 119 | asset.Data = data; |
105 | return asset; | 120 | return asset; |
106 | } | 121 | } |
122 | |||
123 | public static string ReadAssetAsString(IAssetService assetService, UUID uuid) | ||
124 | { | ||
125 | byte[] assetData = assetService.GetData(uuid.ToString()); | ||
126 | return Encoding.ASCII.GetString(assetData); | ||
127 | } | ||
107 | } | 128 | } |
108 | } | 129 | } |