Merge branch 'master' into careminster

Conflicts:
	OpenSim/Region/Framework/Scenes/SceneManager.cs
This commit is contained in:
Melanie
2013-02-28 21:20:07 +00:00
36 changed files with 538 additions and 127 deletions

View File

@@ -40,6 +40,23 @@ namespace OpenSim.Tests.Common
///
public static class TaskInventoryHelpers
{
/// <summary>
/// Add a notecard item to the given part.
/// </summary>
/// <param name="scene"></param>
/// <param name="part"></param>
/// <param name="itemName"></param>
/// <param name="itemIDFrag">UUID or UUID stem</param>
/// <param name="assetIDFrag">UUID or UUID stem</param>
/// <param name="text">The tex to put in the notecard.</param>
/// <returns>The item that was added</returns>
public static TaskInventoryItem AddNotecard(
Scene scene, SceneObjectPart part, string itemName, string itemIDStem, string assetIDStem, string text)
{
return AddNotecard(
scene, part, itemName, TestHelpers.ParseStem(itemIDStem), TestHelpers.ParseStem(assetIDStem), text);
}
/// <summary>
/// Add a notecard item to the given part.
/// </summary>
@@ -48,11 +65,13 @@ namespace OpenSim.Tests.Common
/// <param name="itemName"></param>
/// <param name="itemID"></param>
/// <param name="assetID"></param>
/// <param name="text">The tex to put in the notecard.</param>
/// <returns>The item that was added</returns>
public static TaskInventoryItem AddNotecard(Scene scene, SceneObjectPart part, string itemName, UUID itemID, UUID assetID)
public static TaskInventoryItem AddNotecard(
Scene scene, SceneObjectPart part, string itemName, UUID itemID, UUID assetID, string text)
{
AssetNotecard nc = new AssetNotecard();
nc.BodyText = "Hello World!";
nc.BodyText = text;
nc.Encode();
AssetBase ncAsset
@@ -87,8 +106,8 @@ namespace OpenSim.Tests.Common
/// Add a simple script to the given part.
/// </summary>
/// <remarks>
/// TODO: Accept input for item and asset IDs to avoid mysterious script failures that try to use any of these
/// functions more than once in a test.
/// TODO: Accept input for item and asset IDs so that we have completely replicatable regression tests rather
/// than a random component.
/// </remarks>
/// <param name="scene"></param>
/// <param name="part"></param>
@@ -102,8 +121,9 @@ namespace OpenSim.Tests.Common
ast.Source = scriptSource;
ast.Encode();
UUID assetUuid = new UUID("00000000-0000-0000-1000-000000000000");
UUID itemUuid = new UUID("00000000-0000-0000-1100-000000000000");
UUID assetUuid = UUID.Random();
UUID itemUuid = UUID.Random();
AssetBase asset
= AssetHelpers.CreateAsset(assetUuid, AssetType.LSLText, ast.AssetData, UUID.Zero);
scene.AssetService.Store(asset);

View File

@@ -31,6 +31,7 @@ using System.Collections.Generic;
using System.Reflection;
using Nini.Config;
using OpenMetaverse;
using OpenSim.Framework;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Region.ScriptEngine.Interfaces;
@@ -110,8 +111,11 @@ namespace OpenSim.Tests.Common
{
// Console.WriteLine("Posting event {0} for {1}", name, itemID);
EventParams evParams = new EventParams(name, args, null);
return PostScriptEvent(itemID, new EventParams(name, args, null));
}
public bool PostScriptEvent(UUID itemID, EventParams evParams)
{
List<EventParams> eventsForItem;
if (!PostedEvents.ContainsKey(itemID))
@@ -132,9 +136,22 @@ namespace OpenSim.Tests.Common
return true;
}
public bool PostObjectEvent(uint localID, EventParams evParams)
{
return PostObjectEvent(m_scene.GetSceneObjectPart(localID), evParams);
}
public bool PostObjectEvent(UUID itemID, string name, object[] args)
{
throw new System.NotImplementedException ();
return PostObjectEvent(m_scene.GetSceneObjectPart(itemID), new EventParams(name, args, null));
}
private bool PostObjectEvent(SceneObjectPart part, EventParams evParams)
{
foreach (TaskInventoryItem item in part.Inventory.GetInventoryItems(InventoryType.LSL))
PostScriptEvent(item.ItemID, evParams);
return true;
}
public void SuspendScript(UUID itemID)
@@ -187,16 +204,6 @@ namespace OpenSim.Tests.Common
throw new System.NotImplementedException ();
}
public bool PostScriptEvent(UUID itemID,EventParams parms)
{
throw new System.NotImplementedException ();
}
public bool PostObjectEvent (uint localID, EventParams parms)
{
throw new System.NotImplementedException ();
}
public DetectParams GetDetectParams(UUID item, int number)
{
throw new System.NotImplementedException ();

View File

@@ -113,6 +113,27 @@ namespace OpenSim.Tests.Common
DisableLoggingConfigStream.Position = 0;
}
/// <summary>
/// Parse a UUID stem into a full UUID.
/// </summary>
/// <remarks>
/// Yes, this is completely inconsistent with ParseTail but this is probably a better way to do it,
/// UUIDs are conceptually not hexadecmial numbers.
/// The fragment will come at the start of the UUID. The rest will be 0s
/// </remarks>
/// <returns></returns>
/// <param name='frag'>
/// A UUID fragment that will be parsed into a full UUID. Therefore, it can only contain
/// cahracters which are valid in a UUID, except for "-" which is currently only allowed if a full UUID is
/// given as the 'fragment'.
/// </param>
public static UUID ParseStem(string stem)
{
string rawUuid = stem.PadRight(32, '0');
return UUID.Parse(rawUuid);
}
/// <summary>
/// Parse tail section into full UUID.
/// </summary>

View File

@@ -45,7 +45,7 @@ namespace OpenSim.Tests
/// Set up a test directory.
/// </summary>
[SetUp]
public void SetUp()
public override void SetUp()
{
base.SetUp();