From 4eca59ec13bb48309120fea24890341c65157c65 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 28 Sep 2009 17:33:34 -0700 Subject: Improved the Local grid connector to fetch data from the DB when it doesn't find it in the cache. Commented out the Standalone teleport test because it's failing, and the scene setup is very confusing. I suspect it may be wrong -- the connectors-as-ISharedRegionModules are being instantiated several times when there are several scenes. --- OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs | 26 +++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'OpenSim/Tests/Common/Setup') diff --git a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs index 0d8baad..95f5e3c 100644 --- a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs +++ b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs @@ -44,6 +44,7 @@ using OpenSim.Region.CoreModules.Agent.Capabilities; using OpenSim.Region.CoreModules.Avatar.Gods; using OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset; using OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory; +using OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid; using OpenSim.Services.Interfaces; using OpenSim.Tests.Common.Mock; @@ -58,6 +59,7 @@ namespace OpenSim.Tests.Common.Setup // CommunicationsManager. private static ISharedRegionModule m_assetService = null; private static ISharedRegionModule m_inventoryService = null; + private static ISharedRegionModule m_gridService = null; private static TestCommunicationsManager commsManager = null; /// @@ -110,6 +112,7 @@ namespace OpenSim.Tests.Common.Setup return SetupScene(name, id, x, y, cm, ""); } + /// /// 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. @@ -176,6 +179,9 @@ namespace OpenSim.Tests.Common.Setup StartInventoryService(testScene, true); else StartInventoryService(testScene, false); + if (realServices.Contains("grid")) + StartGridService(testScene, true); + } // If not, make sure the shared module gets references to this new scene else @@ -241,6 +247,26 @@ namespace OpenSim.Tests.Common.Setup m_inventoryService = inventoryService; } + private static void StartGridService(Scene testScene, bool real) + { + ISharedRegionModule gridService = new LocalGridServicesConnector(); + IConfigSource config = new IniConfigSource(); + config.AddConfig("Modules"); + config.AddConfig("GridService"); + config.Configs["Modules"].Set("GridServices", "LocalGridServicesConnector"); + if (real) + config.Configs["GridService"].Set("LocalServiceModule", "OpenSim.Services.GridService.dll:GridService"); + //else + // config.Configs["GridService"].Set("LocalServiceModule", "OpenSim.Tests.Common.dll:TestGridService"); + config.Configs["GridService"].Set("StorageProvider", "OpenSim.Data.Null.dll:NullRegionData"); + gridService.Initialise(config); + gridService.AddRegion(testScene); + gridService.RegionLoaded(testScene); + testScene.AddRegionModule(gridService.Name, gridService); + m_gridService = gridService; + } + + /// /// Setup modules for a scene using their default settings. /// -- cgit v1.1