From 269303d97d96b1deeabd610389ca2bdb17c2b7d9 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Fri, 31 Oct 2008 18:39:51 +0000 Subject: * test: Add basic scene test which merely instantiates the scene right now * set debug scene name on scene registration, rather than within the Scene constructor --- OpenSim/Region/Application/OpenSimBase.cs | 2 - OpenSim/Region/Environment/Scenes/Scene.cs | 1 - .../Scenes/SceneCommunicationService.cs | 13 ++--- .../Region/Environment/Scenes/Tests/SceneTests.cs | 61 ++++++++++++++++++++++ 4 files changed, 64 insertions(+), 13 deletions(-) create mode 100644 OpenSim/Region/Environment/Scenes/Tests/SceneTests.cs (limited to 'OpenSim') diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 16cf5f3..4f1eed8 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs @@ -111,8 +111,6 @@ namespace OpenSim protected List m_plugins = new List(); protected IConfigSource m_finalConfig = null; - - //protected IniConfigSource m_config; protected OpenSimConfigSource m_config; public OpenSimConfigSource ConfigSource diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 0dd89ae..f411a7f 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -273,7 +273,6 @@ namespace OpenSim.Region.Environment.Scenes m_authenticateHandler = authen; CommsManager = commsMan; m_sceneGridService = sceneGridService; - m_sceneGridService.debugRegionName = regInfo.RegionName; m_storageManager = storeManager; AssetCache = assetCach; m_regInfo = regInfo; diff --git a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs index 447cd6f..b716980 100644 --- a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs @@ -76,19 +76,10 @@ namespace OpenSim.Region.Environment.Scenes private GetLandData handlerGetLandData = null; // OnGetLandData public KiPrimitiveDelegate KiPrimitive; - public string _debugRegionName = String.Empty; - - public string debugRegionName - { - get { return _debugRegionName; } - set { _debugRegionName = value; } - } public SceneCommunicationService(CommunicationsManager commsMan) { m_commsProvider = commsMan; - m_commsProvider.GridService.gdebugRegionName = _debugRegionName; - m_commsProvider.InterRegion.rdebugRegionName = _debugRegionName; } /// @@ -99,13 +90,15 @@ namespace OpenSim.Region.Environment.Scenes public void RegisterRegion(RegionInfo regionInfos) { m_regionInfo = regionInfos; + m_commsProvider.GridService.gdebugRegionName = regionInfos.RegionName; + m_commsProvider.InterRegion.rdebugRegionName = regionInfos.RegionName; regionCommsHost = m_commsProvider.GridService.RegisterRegion(m_regionInfo); if (regionCommsHost != null) { //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: registered with gridservice and got" + regionCommsHost.ToString()); - regionCommsHost.debugRegionName = _debugRegionName; + regionCommsHost.debugRegionName = regionInfos.RegionName; regionCommsHost.OnExpectPrim += IncomingPrimCrossing; regionCommsHost.OnExpectUser += NewUserConnection; regionCommsHost.OnAvatarCrossingIntoRegion += AgentCrossing; diff --git a/OpenSim/Region/Environment/Scenes/Tests/SceneTests.cs b/OpenSim/Region/Environment/Scenes/Tests/SceneTests.cs new file mode 100644 index 0000000..94dfd75 --- /dev/null +++ b/OpenSim/Region/Environment/Scenes/Tests/SceneTests.cs @@ -0,0 +1,61 @@ +/* + * 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 OpenSim 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 System; +using Nini.Config; +using NUnit.Framework; +using OpenSim.Framework; +using OpenSim.Framework.Communications; +using OpenSim.Region.Environment.Scenes; + +namespace OpenSim.Region.Environment.Scenes.Tests +{ + /// + /// Scene oriented tests + /// + [TestFixture] + public class SceneTests + { + [Test] + public void TestAddSceneObject() + { + //System.Console.WriteLine("Hello mum!"); + + RegionInfo regInfo = new RegionInfo(1000, 1000, null, null); + regInfo.RegionName = "Unit test region"; + AgentCircuitManager acm = new AgentCircuitManager(); + //CommunicationsManager cm = new CommunicationsManager(null, null, null, false, null); + CommunicationsManager cm = null; + //SceneCommunicationService scs = new SceneCommunicationService(cm); + SceneCommunicationService scs = null; + StorageManager sm = new OpenSim.Region.Environment.StorageManager("OpenSim.Data.Null.dll", "", ""); + IConfigSource configSource = new IniConfigSource(); + + new Scene(regInfo, acm, cm, scs, null, sm, null, null, false, false, false, configSource, null); + } + } +} \ No newline at end of file -- cgit v1.1