From 109b51758398d24a96a16900e8feb24361aee29d Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Sat, 11 Sep 2010 20:43:06 -0700 Subject: Fixed the naming mess around data connectors for simulation data --- OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs index 2a055cc..e95d26a 100644 --- a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs @@ -39,7 +39,7 @@ namespace OpenSim.Data.Null /// Mock region data plugin. This obeys the api contract for persistence but stores everything in memory, so that /// tests can check correct persistence. /// - public class NullDataStore : IRegionDataStore + public class NullDataStore : ISimulationDataStore { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); -- cgit v1.1 From e2544584ad57a30def4f6b13eeaafe90eb81fe9e Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Sat, 11 Sep 2010 22:02:34 -0700 Subject: Changed all string references of "IRegionDataStore" to "ISimulationDataStore" --- OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs | 1 - 1 file changed, 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs index e95d26a..315d405 100644 --- a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs @@ -114,7 +114,6 @@ namespace OpenSim.Data.Null } } - // see IRegionDatastore public void StorePrimInventory(UUID primID, ICollection items) { m_primItems[primID] = items; -- cgit v1.1 From f1f0bc23f4501ba99035283d3407ddad2b21b785 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Sun, 12 Sep 2010 13:43:49 -0400 Subject: Formatting cleanup. --- OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs | 6 ++-- OpenSim/Tests/Common/Mock/TestScene.cs | 2 +- OpenSim/Tests/Common/Setup/AssetHelpers.cs | 4 +-- OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs | 37 +++++++++++----------- .../Tests/Common/Setup/UserInventoryTestUtils.cs | 4 +-- OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs | 8 ++--- 6 files changed, 30 insertions(+), 31 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs index 315d405..f453a4b 100644 --- a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs @@ -99,7 +99,7 @@ namespace OpenSim.Data.Null } public void RemoveObject(UUID obj, UUID regionUUID) - { + { // All parts belonging to the object with the uuid are removed. List parts = new List(m_sceneObjectParts.Values); foreach (SceneObjectPart part in parts) @@ -108,7 +108,7 @@ namespace OpenSim.Data.Null { m_log.DebugFormat( "[MOCK REGION DATA PLUGIN]: Removing part {0} {1} as part of object {2} from {3}", - part.Name, part.UUID, obj, regionUUID); + part.Name, part.UUID, obj, regionUUID); m_sceneObjectParts.Remove(part.UUID); } } @@ -129,7 +129,7 @@ namespace OpenSim.Data.Null if (prim.IsRoot) { m_log.DebugFormat( - "[MOCK REGION DATA PLUGIN]: Loading root part {0} {1} in {2}", prim.Name, prim.UUID, regionUUID); + "[MOCK REGION DATA PLUGIN]: Loading root part {0} {1} in {2}", prim.Name, prim.UUID, regionUUID); objects[prim.UUID] = new SceneObjectGroup(prim); } } diff --git a/OpenSim/Tests/Common/Mock/TestScene.cs b/OpenSim/Tests/Common/Mock/TestScene.cs index 615e519..13f364b 100644 --- a/OpenSim/Tests/Common/Mock/TestScene.cs +++ b/OpenSim/Tests/Common/Mock/TestScene.cs @@ -69,6 +69,6 @@ namespace OpenSim.Tests.Common.Mock public AsyncSceneObjectGroupDeleter SceneObjectGroupDeleter { get { return m_asyncSceneObjectDeleter; } - } + } } } \ No newline at end of file diff --git a/OpenSim/Tests/Common/Setup/AssetHelpers.cs b/OpenSim/Tests/Common/Setup/AssetHelpers.cs index f9a80b0..8647cfe 100644 --- a/OpenSim/Tests/Common/Setup/AssetHelpers.cs +++ b/OpenSim/Tests/Common/Setup/AssetHelpers.cs @@ -54,8 +54,8 @@ namespace OpenSim.Tests.Common { AssetBase asset = CreateAsset(UUID.Random(), AssetType.Notecard, "hello", creatorId); scene.AssetService.Store(asset); - return asset; - } + return asset; + } /// /// Create an asset from the given scene object. diff --git a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs index 9318a27..889389b 100644 --- a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs +++ b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs @@ -58,7 +58,7 @@ namespace OpenSim.Tests.Common.Setup public class SceneSetupHelpers { // These static variables in order to allow regions to be linked by shared modules and same - // CommunicationsManager. + // CommunicationsManager. private static ISharedRegionModule m_assetService = null; // private static ISharedRegionModule m_authenticationService = null; private static ISharedRegionModule m_inventoryService = null; @@ -69,19 +69,19 @@ namespace OpenSim.Tests.Common.Setup /// /// Set up a test scene /// - /// + /// /// Automatically starts service threads, as would the normal runtime. - /// + /// /// public static TestScene SetupScene() { return SetupScene(""); } - + /// /// Set up a test scene /// - /// + /// /// Starts real inventory and asset services, as opposed to mock ones, if true /// public static TestScene SetupScene(String realServices) @@ -94,7 +94,7 @@ namespace OpenSim.Tests.Common.Setup ///// ///// Set up a test scene ///// - ///// + ///// ///// Starts real inventory and asset services, as opposed to mock ones, if true ///// This should be the same if simulating two scenes within a standalone ///// @@ -167,13 +167,13 @@ namespace OpenSim.Tests.Common.Setup capsModule.Initialise(new IniConfigSource()); testScene.AddRegionModule(capsModule.Name, capsModule); capsModule.AddRegion(testScene); - + IRegionModule godsModule = new GodsModule(); godsModule.Initialise(testScene, new IniConfigSource()); testScene.AddModule(godsModule.Name, godsModule); realServices = realServices.ToLower(); // IConfigSource config = new IniConfigSource(); - + // If we have a brand new scene, need to initialize shared region modules if ((m_assetService == null && m_inventoryService == null) || newScene) { @@ -184,13 +184,13 @@ namespace OpenSim.Tests.Common.Setup // For now, always started a 'real' authentication service StartAuthenticationService(testScene, true); - + if (realServices.Contains("inventory")) StartInventoryService(testScene, true); else StartInventoryService(testScene, false); - - StartGridService(testScene, true); + + StartGridService(testScene, true); StartUserAccountService(testScene); StartPresenceService(testScene); } @@ -207,7 +207,7 @@ namespace OpenSim.Tests.Common.Setup m_presenceService.RegionLoaded(testScene); } - + m_inventoryService.PostInitialise(); m_assetService.PostInitialise(); m_userAccountService.PostInitialise(); @@ -250,7 +250,7 @@ namespace OpenSim.Tests.Common.Setup else config.Configs["AssetService"].Set("LocalServiceModule", "OpenSim.Tests.Common.dll:MockAssetService"); config.Configs["AssetService"].Set("StorageProvider", "OpenSim.Tests.Common.dll"); - assetService.Initialise(config); + assetService.Initialise(config); assetService.AddRegion(testScene); assetService.RegionLoaded(testScene); testScene.AddRegionModule(assetService.Name, assetService); @@ -277,7 +277,7 @@ namespace OpenSim.Tests.Common.Setup testScene.AddRegionModule(service.Name, service); //m_authenticationService = service; } - + private static void StartInventoryService(Scene testScene, bool real) { ISharedRegionModule inventoryService = new LocalInventoryServicesConnector(); @@ -285,7 +285,7 @@ namespace OpenSim.Tests.Common.Setup config.AddConfig("Modules"); config.AddConfig("InventoryService"); config.Configs["Modules"].Set("InventoryServices", "LocalInventoryServicesConnector"); - + if (real) { config.Configs["InventoryService"].Set("LocalServiceModule", "OpenSim.Services.InventoryService.dll:InventoryService"); @@ -294,7 +294,7 @@ namespace OpenSim.Tests.Common.Setup { config.Configs["InventoryService"].Set("LocalServiceModule", "OpenSim.Tests.Common.dll:MockInventoryService"); } - + config.Configs["InventoryService"].Set("StorageProvider", "OpenSim.Tests.Common.dll"); inventoryService.Initialise(config); inventoryService.AddRegion(testScene); @@ -338,14 +338,14 @@ namespace OpenSim.Tests.Common.Setup config.Configs["UserAccountService"].Set("StorageProvider", "OpenSim.Data.Null.dll"); config.Configs["UserAccountService"].Set( "LocalServiceModule", "OpenSim.Services.UserAccountService.dll:UserAccountService"); - + if (m_userAccountService == null) { ISharedRegionModule userAccountService = new LocalUserAccountServicesConnector(); userAccountService.Initialise(config); m_userAccountService = userAccountService; } - + m_userAccountService.AddRegion(testScene); m_userAccountService.RegionLoaded(testScene); testScene.AddRegionModule(m_userAccountService.Name, m_userAccountService); @@ -559,5 +559,4 @@ namespace OpenSim.Tests.Common.Setup sogd.InventoryDeQueueAndDelete(); } } - } diff --git a/OpenSim/Tests/Common/Setup/UserInventoryTestUtils.cs b/OpenSim/Tests/Common/Setup/UserInventoryTestUtils.cs index 915af7e..135c50e 100644 --- a/OpenSim/Tests/Common/Setup/UserInventoryTestUtils.cs +++ b/OpenSim/Tests/Common/Setup/UserInventoryTestUtils.cs @@ -42,7 +42,7 @@ namespace OpenSim.Tests.Common public static InventoryItemBase CreateInventoryItem( Scene scene, string itemName, UUID itemId, string folderPath, UUID userId) - { + { InventoryItemBase item = new InventoryItemBase(); item.Name = itemName; item.AssetID = AssetHelpers.CreateAsset(scene, userId).FullID; @@ -52,7 +52,7 @@ namespace OpenSim.Tests.Common InventoryFolderBase objsFolder = scene.InventoryService.GetFolderForType(userId, AssetType.Object); item.Folder = objsFolder.ID; - scene.AddInventoryItem(item); + scene.AddInventoryItem(item); return item; } diff --git a/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs b/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs index 26156f3..d01521d 100644 --- a/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs +++ b/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs @@ -53,7 +53,7 @@ namespace OpenSim.Tests.Common.Setup // UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000099"); // return CreateUserWithInventory(commsManager, userId, callback); // } -// +// // /// // /// Create a test user with a standard inventory // /// @@ -108,11 +108,11 @@ namespace OpenSim.Tests.Common.Setup // { // LocalUserServices lus = (LocalUserServices)commsManager.UserService; // lus.AddUser(firstName, lastName, password, "bill@bailey.com", 1000, 1000, userId); -// +// // CachedUserInfo userInfo = commsManager.UserProfileCacheService.GetUserDetails(userId); // userInfo.OnInventoryReceived += callback; // userInfo.FetchInventory(); -// +// // return userInfo; // } @@ -140,6 +140,6 @@ namespace OpenSim.Tests.Common.Setup scene.UserAccountService.StoreUserAccount(ua); scene.InventoryService.CreateUserInventory(ua.PrincipalID); scene.AuthenticationService.SetPassword(ua.PrincipalID, pw); - } + } } } \ No newline at end of file -- cgit v1.1 From 0db1ed0b5a6f5bd104c6008f142d173c84263ce5 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Sun, 12 Sep 2010 14:20:26 -0700 Subject: * Added ISimulationDataService and IEstateDataService * Removed StorageManager * CONFIG CHANGE: There are no more database settings in OpenSim.ini. Check the config-include configuration files for region store and estate store database settings --- OpenSim/Tests/Common/Mock/TestScene.cs | 10 +++------- OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs | 5 +++-- 2 files changed, 6 insertions(+), 9 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestScene.cs b/OpenSim/Tests/Common/Mock/TestScene.cs index 615e519..4511228 100644 --- a/OpenSim/Tests/Common/Mock/TestScene.cs +++ b/OpenSim/Tests/Common/Mock/TestScene.cs @@ -31,6 +31,7 @@ using OpenSim.Framework; using OpenSim.Framework.Communications; using OpenSim.Framework.Servers; using OpenSim.Region.Framework; +using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; namespace OpenSim.Tests.Common.Mock @@ -39,20 +40,15 @@ namespace OpenSim.Tests.Common.Mock { public TestScene( RegionInfo regInfo, AgentCircuitManager authen, - SceneCommunicationService sceneGridService, StorageManager storeManager, + SceneCommunicationService sceneGridService, ISimulationDataService simDataService, IEstateDataService estateDataService, ModuleLoader moduleLoader, bool dumpAssetsToFile, bool physicalPrim, bool SeeIntoRegionFromNeighbor, IConfigSource config, string simulatorVersion) - : base(regInfo, authen, sceneGridService, storeManager, moduleLoader, + : base(regInfo, authen, sceneGridService, simDataService, estateDataService, moduleLoader, dumpAssetsToFile, physicalPrim, SeeIntoRegionFromNeighbor, config, simulatorVersion) { } /// - /// Allow retrieval for test check purposes - /// - public StorageManager StorageManager { get { return m_storageManager; } } - - /// /// Temporarily override session authentication for tests (namely teleport). /// /// diff --git a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs index 9318a27..ffd0078 100644 --- a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs +++ b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs @@ -157,11 +157,12 @@ namespace OpenSim.Tests.Common.Setup AgentCircuitManager acm = new AgentCircuitManager(); SceneCommunicationService scs = new SceneCommunicationService(); - StorageManager sm = new StorageManager("OpenSim.Tests.Common.dll", "", ""); + ISimulationDataService simDataService = null; + IEstateDataService estateDataService = null; IConfigSource configSource = new IniConfigSource(); TestScene testScene = new TestScene( - regInfo, acm, scs, sm, null, false, false, false, configSource, null); + regInfo, acm, scs, simDataService, estateDataService, null, false, false, false, configSource, null); INonSharedRegionModule capsModule = new CapabilitiesModule(); capsModule.Initialise(new IniConfigSource()); -- cgit v1.1 From 18a9ac6b39b91865c33eeffa1ef8ff3e8a847c1b Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Sun, 12 Sep 2010 15:04:51 -0700 Subject: Fix unit test SceneSetupHelpers to load the mock simulation data store --- OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs | 75 +++++++++++++++++++++++ OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs | 2 +- 2 files changed, 76 insertions(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs index f453a4b..de6e815 100644 --- a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs @@ -35,6 +35,81 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Data.Null { + public class NullDataService : ISimulationDataService + { + private NullDataStore m_store; + + public NullDataService() + { + m_store = new NullDataStore(); + } + + public void StoreObject(SceneObjectGroup obj, UUID regionUUID) + { + m_store.StoreObject(obj, regionUUID); + } + + public void RemoveObject(UUID uuid, UUID regionUUID) + { + m_store.RemoveObject(uuid, regionUUID); + } + + public void StorePrimInventory(UUID primID, ICollection items) + { + m_store.StorePrimInventory(primID, items); + } + + public List LoadObjects(UUID regionUUID) + { + return m_store.LoadObjects(regionUUID); + } + + public void StoreTerrain(double[,] terrain, UUID regionID) + { + m_store.StoreTerrain(terrain, regionID); + } + + public double[,] LoadTerrain(UUID regionID) + { + return m_store.LoadTerrain(regionID); + } + + public void StoreLandObject(ILandObject Parcel) + { + m_store.StoreLandObject(Parcel); + } + + public void RemoveLandObject(UUID globalID) + { + m_store.RemoveLandObject(globalID); + } + + public List LoadLandObjects(UUID regionUUID) + { + return m_store.LoadLandObjects(regionUUID); + } + + public void StoreRegionSettings(RegionSettings rs) + { + m_store.StoreRegionSettings(rs); + } + + public RegionSettings LoadRegionSettings(UUID regionUUID) + { + return m_store.LoadRegionSettings(regionUUID); + } + + public RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID) + { + return m_store.LoadRegionWindlightSettings(regionUUID); + } + + public void StoreRegionWindlightSettings(RegionLightShareData wl) + { + m_store.StoreRegionWindlightSettings(wl); + } + } + /// /// Mock region data plugin. This obeys the api contract for persistence but stores everything in memory, so that /// tests can check correct persistence. diff --git a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs index ee76db4..fc9db03 100644 --- a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs +++ b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs @@ -157,7 +157,7 @@ namespace OpenSim.Tests.Common.Setup AgentCircuitManager acm = new AgentCircuitManager(); SceneCommunicationService scs = new SceneCommunicationService(); - ISimulationDataService simDataService = null; + ISimulationDataService simDataService = OpenSim.Server.Base.ServerUtils.LoadPlugin("OpenSim.Tests.Common.dll", null); IEstateDataService estateDataService = null; IConfigSource configSource = new IniConfigSource(); -- cgit v1.1