From 46f5893d559f87982e510d02a37856951eb1e088 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 4 Jul 2011 21:35:15 +0100 Subject: Add basic flotsam asset cache test for retrieved cached asset. Disabled temporarily since file system caching disrupts subsequent test runs --- OpenSim/Tests/Common/Helpers/AssetHelpers.cs | 9 +++++++++ OpenSim/Tests/Common/TestHelper.cs | 11 +++++++++++ 2 files changed, 20 insertions(+) (limited to 'OpenSim/Tests/Common') diff --git a/OpenSim/Tests/Common/Helpers/AssetHelpers.cs b/OpenSim/Tests/Common/Helpers/AssetHelpers.cs index aa55bcd..9b68331 100644 --- a/OpenSim/Tests/Common/Helpers/AssetHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/AssetHelpers.cs @@ -37,6 +37,15 @@ namespace OpenSim.Tests.Common public class AssetHelpers { /// + /// Create a notecard asset with a random uuids and dummy text. + /// + /// + public static AssetBase CreateAsset() + { + return CreateAsset(UUID.Random(), AssetType.Notecard, "hello", UUID.Random()); + } + + /// /// Create a notecard asset with a random uuid and dummy text. /// /// /param> diff --git a/OpenSim/Tests/Common/TestHelper.cs b/OpenSim/Tests/Common/TestHelper.cs index 1722e59..86bd107 100644 --- a/OpenSim/Tests/Common/TestHelper.cs +++ b/OpenSim/Tests/Common/TestHelper.cs @@ -28,6 +28,7 @@ using System; using System.Diagnostics; using NUnit.Framework; +using OpenMetaverse; namespace OpenSim.Tests.Common { @@ -56,5 +57,15 @@ namespace OpenSim.Tests.Common Console.WriteLine(); Console.WriteLine("===> In Test Method : {0} <===", stackTrace.GetFrame(1).GetMethod().Name); } + + /// + /// Parse tail section into full UUID. + /// + /// + /// + public static UUID ParseTail(int tail) + { + return new UUID(string.Format("00000000-0000-0000-0000-{0:X12}", tail)); + } } } -- cgit v1.1