diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs index d986274577..18f77fdaf8 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs @@ -63,7 +63,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests SerialiserModule serialiserModule = new SerialiserModule(); TerrainModule terrainModule = new TerrainModule(); - m_scene = SceneSetupHelpers.SetupScene("scene1"); + m_scene = SceneSetupHelpers.SetupScene("useraccounts"); SceneSetupHelpers.SetupSceneModules(m_scene, m_archiverModule, serialiserModule, terrainModule); } diff --git a/OpenSim/Services/UserAccountService/UserAccountService.cs b/OpenSim/Services/UserAccountService/UserAccountService.cs index ffb9cca607..e498bd5e70 100644 --- a/OpenSim/Services/UserAccountService/UserAccountService.cs +++ b/OpenSim/Services/UserAccountService/UserAccountService.cs @@ -77,13 +77,16 @@ namespace OpenSim.Services.UserAccountService if (invServiceDll != string.Empty) m_InventoryService = LoadPlugin(invServiceDll, new Object[] { config }); - MainConsole.Instance.Commands.AddCommand("UserService", false, - "create user", - "create user [ [ [ []]]]", - "Create a new user", HandleCreateUser); - MainConsole.Instance.Commands.AddCommand("UserService", false, "reset user password", - "reset user password [ [ []]]", - "Reset a user password", HandleResetUserPassword); + if (MainConsole.Instance != null) + { + MainConsole.Instance.Commands.AddCommand("UserService", false, + "create user", + "create user [ [ [ []]]]", + "Create a new user", HandleCreateUser); + MainConsole.Instance.Commands.AddCommand("UserService", false, "reset user password", + "reset user password [ [ []]]", + "Reset a user password", HandleResetUserPassword); + } } diff --git a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs index e37e137178..9e718f6a1c 100644 --- a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs +++ b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs @@ -45,6 +45,7 @@ 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.Region.CoreModules.ServiceConnectorsOut.UserAccounts; using OpenSim.Services.Interfaces; using OpenSim.Tests.Common.Mock; @@ -60,6 +61,7 @@ namespace OpenSim.Tests.Common.Setup private static ISharedRegionModule m_assetService = null; private static ISharedRegionModule m_inventoryService = null; private static ISharedRegionModule m_gridService = null; + private static ISharedRegionModule m_userAccountService = null; /// /// Set up a test scene @@ -183,6 +185,8 @@ namespace OpenSim.Tests.Common.Setup StartInventoryService(testScene, false); if (realServices.Contains("grid")) StartGridService(testScene, true); + if (realServices.Contains("useraccounts")) + StartUserAccountService(testScene, true); } // If not, make sure the shared module gets references to this new scene @@ -269,6 +273,28 @@ namespace OpenSim.Tests.Common.Setup //testScene.AddRegionModule(m_gridService.Name, m_gridService); } + private static void StartUserAccountService(Scene testScene, bool real) + { + IConfigSource config = new IniConfigSource(); + config.AddConfig("Modules"); + config.AddConfig("UserAccountService"); + config.Configs["Modules"].Set("UserAccountServices", "LocalUserAccountServicesConnector"); + config.Configs["UserAccountService"].Set("StorageProvider", "OpenSim.Data.Null.dll"); + if (real) + config.Configs["UserAccountService"].Set("LocalServiceModule", "OpenSim.Services.UserAccountService.dll:UserAccountService"); + if (m_userAccountService == null) + { + ISharedRegionModule userAccountService = new LocalUserAccountServicesConnector(); + userAccountService.Initialise(config); + m_userAccountService = userAccountService; + } + //else + // config.Configs["GridService"].Set("LocalServiceModule", "OpenSim.Tests.Common.dll:TestGridService"); + m_userAccountService.AddRegion(testScene); + m_userAccountService.RegionLoaded(testScene); + //testScene.AddRegionModule(m_gridService.Name, m_gridService); + } + /// /// Setup modules for a scene using their default settings.