From 038d1bf742ba4f95ca8a83b27f6fefb755485524 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 7 Feb 2012 17:44:37 +0000 Subject: Add a regression test to compile and start a script. Remove Path.GetDirectoryName when getting assembly loading path in Compiler.CompileFromDotNetText(). The Path.GetDirectoryName call in Compiler.CompileFromDotNetText is unnecessary since AppDomain.CurrentDomain.BaseDirectory is always a directory. Later path concatenation is already done by Path.Combine() which handles any trailing slash. Removing Path.GetDirectoryName() will not affect the runtime but allows NUnit to work since it doesn't add a trailing slash to AppDomain.CurrentDomain.BaseDirectory. --- OpenSim/Tests/Common/Helpers/SceneHelpers.cs | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'OpenSim/Tests/Common') diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs index a25eb66..aa904aa 100644 --- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs @@ -88,9 +88,27 @@ namespace OpenSim.Tests.Common /// ID of the region /// X co-ordinate of the region /// Y co-ordinate of the region - /// This should be the same if simulating two scenes within a standalone + /// /// - public static TestScene SetupScene(string name, UUID id, uint x, uint y, CoreAssetCache cache) + public static TestScene SetupScene( + string name, UUID id, uint x, uint y, CoreAssetCache cache) + { + return SetupScene(name, id, x, y, cache, new IniConfigSource()); + } + + /// + /// Set up a scene. If it's more then one scene, use the same CommunicationsManager to link regions + /// or a different, to get a brand new scene with new shared region modules. + /// + /// Name of the region + /// ID of the region + /// X co-ordinate of the region + /// Y co-ordinate of the region + /// + /// + /// + public static TestScene SetupScene( + string name, UUID id, uint x, uint y, CoreAssetCache cache, IConfigSource configSource) { Console.WriteLine("Setting up test scene {0}", name); @@ -106,7 +124,6 @@ namespace OpenSim.Tests.Common ISimulationDataService simDataService = OpenSim.Server.Base.ServerUtils.LoadPlugin("OpenSim.Tests.Common.dll", null); IEstateDataService estateDataService = null; - IConfigSource configSource = new IniConfigSource(); TestScene testScene = new TestScene( regInfo, acm, scs, simDataService, estateDataService, null, false, configSource, null); -- cgit v1.1 From bd928218dd0845bb0aef46749e8a393d0a9e4fbc Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 7 Feb 2012 21:00:47 +0000 Subject: Add TestAddTaskInventoryItem() --- OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'OpenSim/Tests/Common') diff --git a/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs b/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs index a8f0d59..7058d1e 100644 --- a/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs @@ -72,15 +72,21 @@ namespace OpenSim.Tests.Common /// /// /// - public static TaskInventoryItem AddSceneObject(Scene scene, SceneObjectPart sop, string itemName, UUID id) + /// + public static TaskInventoryItem AddSceneObject( + Scene scene, SceneObjectPart sop, string itemName, UUID id, UUID userId) { SceneObjectGroup taskSceneObject = SceneHelpers.CreateSceneObject(1, UUID.Zero); AssetBase taskSceneObjectAsset = AssetHelpers.CreateAsset(0x10, taskSceneObject); scene.AssetService.Store(taskSceneObjectAsset); TaskInventoryItem taskSceneObjectItem = new TaskInventoryItem - { Name = itemName, AssetID = taskSceneObjectAsset.FullID, ItemID = id, - Type = (int)AssetType.Object, InvType = (int)InventoryType.Object }; + { Name = itemName, + AssetID = taskSceneObjectAsset.FullID, + ItemID = id, + OwnerID = userId, + Type = (int)AssetType.Object, + InvType = (int)InventoryType.Object }; sop.Inventory.AddInventoryItem(taskSceneObjectItem, true); return taskSceneObjectItem; -- cgit v1.1