From 001d3695683d9511446d194feeb763c437170028 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 11 Jan 2010 07:45:47 -0800 Subject: CommunicationsManager deleted. --- .../Tests/Common/Mock/TestCommunicationsManager.cs | 62 --------------------- OpenSim/Tests/Common/Mock/TestScene.cs | 4 +- OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs | 64 +++++++++++----------- 3 files changed, 35 insertions(+), 95 deletions(-) delete mode 100644 OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs (limited to 'OpenSim/Tests/Common') diff --git a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs deleted file mode 100644 index 8e193c1..0000000 --- a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using OpenSim.Framework; -using OpenSim.Framework.Communications; -using OpenSim.Framework.Communications.Cache; -using OpenSim.Framework.Servers; -using OpenSim.Framework.Servers.HttpServer; -using OpenSim.Data; - -namespace OpenSim.Tests.Common.Mock -{ - public class TestCommunicationsManager : CommunicationsManager - { - public IUserDataPlugin UserDataPlugin - { - get { return m_userDataPlugin; } - } - private IUserDataPlugin m_userDataPlugin; - - // public IInventoryDataPlugin InventoryDataPlugin - // { - // get { return m_inventoryDataPlugin; } - // } - // private IInventoryDataPlugin m_inventoryDataPlugin; - - public TestCommunicationsManager() - : this(null) - { - } - - public TestCommunicationsManager(NetworkServersInfo serversInfo) - : base(serversInfo, null) - { - - } - } -} diff --git a/OpenSim/Tests/Common/Mock/TestScene.cs b/OpenSim/Tests/Common/Mock/TestScene.cs index 22cfa2c..bf3825b 100644 --- a/OpenSim/Tests/Common/Mock/TestScene.cs +++ b/OpenSim/Tests/Common/Mock/TestScene.cs @@ -40,10 +40,10 @@ namespace OpenSim.Tests.Common.Mock { public TestScene( RegionInfo regInfo, AgentCircuitManager authen, - CommunicationsManager commsMan, SceneCommunicationService sceneGridService, StorageManager storeManager, + SceneCommunicationService sceneGridService, StorageManager storeManager, ModuleLoader moduleLoader, bool dumpAssetsToFile, bool physicalPrim, bool SeeIntoRegionFromNeighbor, IConfigSource config, string simulatorVersion) - : base(regInfo, authen, commsMan, sceneGridService, storeManager, moduleLoader, + : base(regInfo, authen, sceneGridService, storeManager, moduleLoader, dumpAssetsToFile, physicalPrim, SeeIntoRegionFromNeighbor, config, simulatorVersion) { } diff --git a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs index dbb8fd4..f6c9f3b 100644 --- a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs +++ b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs @@ -60,7 +60,6 @@ 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 TestCommunicationsManager commsManager = null; /// /// Set up a test scene @@ -83,21 +82,23 @@ namespace OpenSim.Tests.Common.Setup public static TestScene SetupScene(String realServices) { return SetupScene( - "Unit test region", UUID.Random(), 1000, 1000, new TestCommunicationsManager(), realServices); + "Unit test region", UUID.Random(), 1000, 1000, realServices); } - /// - /// 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 - /// - public static TestScene SetupScene(TestCommunicationsManager cm, String realServices) - { - return SetupScene( - "Unit test region", UUID.Random(), 1000, 1000, cm, ""); - } + // REFACTORING PROBLEM. No idea what the difference is with the previous one + ///// + ///// 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 + ///// + //public static TestScene SetupScene(String realServices) + //{ + // return SetupScene( + // "Unit test region", UUID.Random(), 1000, 1000, ""); + //} + /// /// Set up a test scene /// @@ -107,9 +108,9 @@ namespace OpenSim.Tests.Common.Setup /// 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, TestCommunicationsManager cm) + public static TestScene SetupScene(string name, UUID id, uint x, uint y) { - return SetupScene(name, id, x, y, cm, ""); + return SetupScene(name, id, x, y,""); } @@ -125,23 +126,24 @@ namespace OpenSim.Tests.Common.Setup /// Starts real inventory and asset services, as opposed to mock ones, if true /// public static TestScene SetupScene( - string name, UUID id, uint x, uint y, TestCommunicationsManager cm, String realServices) + string name, UUID id, uint x, uint y, String realServices) { bool newScene = false; Console.WriteLine("Setting up test scene {0}", name); - - // If cm is the same as our last commsManager used, this means the tester wants to link - // regions. In this case, don't use the sameshared region modules and dont initialize them again. - // Also, no need to start another MainServer and MainConsole instance. - if (cm == null || cm != commsManager) - { - System.Console.WriteLine("Starting a brand new scene"); - newScene = true; - MainConsole.Instance = new LocalConsole("TEST PROMPT"); - MainServer.Instance = new BaseHttpServer(980); - commsManager = cm; - } + + // REFACTORING PROBLEM! + //// If cm is the same as our last commsManager used, this means the tester wants to link + //// regions. In this case, don't use the sameshared region modules and dont initialize them again. + //// Also, no need to start another MainServer and MainConsole instance. + //if (cm == null || cm != commsManager) + //{ + // System.Console.WriteLine("Starting a brand new scene"); + // newScene = true; + // MainConsole.Instance = new LocalConsole("TEST PROMPT"); + // MainServer.Instance = new BaseHttpServer(980); + // commsManager = cm; + //} // We must set up a console otherwise setup of some modules may fail RegionInfo regInfo = new RegionInfo(x, y, new IPEndPoint(IPAddress.Loopback, 9000), "127.0.0.1"); @@ -149,13 +151,13 @@ namespace OpenSim.Tests.Common.Setup regInfo.RegionID = id; AgentCircuitManager acm = new AgentCircuitManager(); - SceneCommunicationService scs = new SceneCommunicationService(cm); + SceneCommunicationService scs = new SceneCommunicationService(); StorageManager sm = new StorageManager("OpenSim.Data.Null.dll", "", ""); IConfigSource configSource = new IniConfigSource(); TestScene testScene = new TestScene( - regInfo, acm, cm, scs, sm, null, false, false, false, configSource, null); + regInfo, acm, scs, sm, null, false, false, false, configSource, null); INonSharedRegionModule capsModule = new CapabilitiesModule(); capsModule.Initialise(new IniConfigSource()); -- cgit v1.1