From 1a16a92a62069a50efd618b8fd6cbc0d530c7654 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 11 Jun 2010 21:18:09 +0100
Subject: create inactive test for iar folders/items merged with existing paths
add various helper functions for simplifying test readability
---
OpenSim/Tests/Common/Setup/AssetHelpers.cs | 46 ++++++++++++++++++++++--------
1 file changed, 34 insertions(+), 12 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 6dc993f..f9a80b0 100644
--- a/OpenSim/Tests/Common/Setup/AssetHelpers.cs
+++ b/OpenSim/Tests/Common/Setup/AssetHelpers.cs
@@ -36,25 +36,29 @@ namespace OpenSim.Tests.Common
public class AssetHelpers
{
///
- /// Create an asset from the given data
+ /// Create a notecard asset with a random uuid and dummy text.
///
- public static AssetBase CreateAsset(UUID assetUuid, AssetType assetType, byte[] data, UUID creatorID)
+ /// /param>
+ ///
+ public static AssetBase CreateAsset(UUID creatorId)
{
- AssetBase asset = new AssetBase(assetUuid, assetUuid.ToString(), (sbyte)assetType, creatorID.ToString());
- asset.Data = data;
- return asset;
+ return CreateAsset(UUID.Random(), AssetType.Notecard, "hello", creatorId);
}
-
+
///
- /// Create an asset from the given data
+ /// Create and store a notecard asset with a random uuid and dummy text.
///
- public static AssetBase CreateAsset(UUID assetUuid, AssetType assetType, string data, UUID creatorID)
+ /// /param>
+ ///
+ public static AssetBase CreateAsset(Scene scene, UUID creatorId)
{
- return CreateAsset(assetUuid, assetType, Encoding.ASCII.GetBytes(data), creatorID);
- }
-
+ AssetBase asset = CreateAsset(UUID.Random(), AssetType.Notecard, "hello", creatorId);
+ scene.AssetService.Store(asset);
+ return asset;
+ }
+
///
- /// Create an asset from the given scene object
+ /// Create an asset from the given scene object.
///
///
///
@@ -67,5 +71,23 @@ namespace OpenSim.Tests.Common
Encoding.ASCII.GetBytes(SceneObjectSerializer.ToXml2Format(sog)),
sog.OwnerID);
}
+
+ ///
+ /// Create an asset from the given data.
+ ///
+ public static AssetBase CreateAsset(UUID assetUuid, AssetType assetType, string data, UUID creatorID)
+ {
+ return CreateAsset(assetUuid, assetType, Encoding.ASCII.GetBytes(data), creatorID);
+ }
+
+ ///
+ /// Create an asset from the given data.
+ ///
+ public static AssetBase CreateAsset(UUID assetUuid, AssetType assetType, byte[] data, UUID creatorID)
+ {
+ AssetBase asset = new AssetBase(assetUuid, assetUuid.ToString(), (sbyte)assetType, creatorID.ToString());
+ asset.Data = data;
+ return asset;
+ }
}
}
--
cgit v1.1