From 88da253c947c78e97f78119203e3c2f216a788e2 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 18 Feb 2011 21:54:44 +0000 Subject: Add very basic test which invokes the scene update loop once and checks the frame number. This makes Scene.Update() match its original description of performing a single update, which also matches the semantics of SOG and ScenePresence. --- .../Framework/Scenes/Tests/ScenePresenceTests.cs | 3 - .../Region/Framework/Scenes/Tests/SceneTests.cs | 71 ++++++++++++++++++++++ 2 files changed, 71 insertions(+), 3 deletions(-) create mode 100644 OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs (limited to 'OpenSim/Region/Framework/Scenes/Tests') diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs index ef52363..8286e4f 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs @@ -116,9 +116,6 @@ namespace OpenSim.Region.Framework.Scenes.Tests agent.ChildrenCapSeeds = new Dictionary(); agent.child = true; - if (scene.PresenceService == null) - Console.WriteLine("Presence Service is null"); - scene.PresenceService.LoginAgent(agent.AgentID.ToString(), agent.SessionID, agent.SecureSessionID); string reason; diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs new file mode 100644 index 0000000..9aba8a8 --- /dev/null +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs @@ -0,0 +1,71 @@ +/* + * 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 System; +using System.Collections.Generic; +using System.Reflection; +using System.Text; +using System.Threading; +using System.Timers; +using Timer=System.Timers.Timer; +using Nini.Config; +using NUnit.Framework; +using NUnit.Framework.SyntaxHelpers; +using OpenMetaverse; +using OpenSim.Framework; +using OpenSim.Framework.Communications; +using OpenSim.Region.Framework.Scenes; +using OpenSim.Region.Framework.Interfaces; +using OpenSim.Region.CoreModules.World.Serialiser; +using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation; +using OpenSim.Tests.Common; +using OpenSim.Tests.Common.Mock; +using OpenSim.Tests.Common.Setup; + +namespace OpenSim.Region.Framework.Scenes.Tests +{ + /// + /// Scene presence tests + /// + [TestFixture] + public class SceneTests + { + /// + /// Very basic scene update test. Should become more elaborate with time. + /// + [Test] + public void TestUpdateScene() + { + TestHelper.InMethod(); + + Scene scene = SceneSetupHelpers.SetupScene(); + scene.Update(); + + Assert.That(scene.Frame, Is.EqualTo(1)); + } + } +} \ No newline at end of file -- cgit v1.1 From c763edf56dab869982b5ba002d798f147112a361 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 18 Feb 2011 22:20:08 +0000 Subject: separate attachment tests out into their own class --- .../Framework/Scenes/Tests/AttachmentTests.cs | 180 +++++++++++++++++++++ .../Framework/Scenes/Tests/ScenePresenceTests.cs | 50 ------ 2 files changed, 180 insertions(+), 50 deletions(-) create mode 100644 OpenSim/Region/Framework/Scenes/Tests/AttachmentTests.cs (limited to 'OpenSim/Region/Framework/Scenes/Tests') diff --git a/OpenSim/Region/Framework/Scenes/Tests/AttachmentTests.cs b/OpenSim/Region/Framework/Scenes/Tests/AttachmentTests.cs new file mode 100644 index 0000000..60e47f6 --- /dev/null +++ b/OpenSim/Region/Framework/Scenes/Tests/AttachmentTests.cs @@ -0,0 +1,180 @@ +/* + * 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 System; +using System.Collections.Generic; +using System.Reflection; +using System.Text; +using System.Threading; +using System.Timers; +using Timer=System.Timers.Timer; +using Nini.Config; +using NUnit.Framework; +using NUnit.Framework.SyntaxHelpers; +using OpenMetaverse; +using OpenSim.Framework; +using OpenSim.Framework.Communications; +using OpenSim.Region.Framework.Scenes; +using OpenSim.Region.Framework.Interfaces; +using OpenSim.Region.CoreModules.World.Serialiser; +using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation; +using OpenSim.Tests.Common; +using OpenSim.Tests.Common.Mock; +using OpenSim.Tests.Common.Setup; + +namespace OpenSim.Region.Framework.Scenes.Tests +{ + /// + /// Scene presence tests + /// + [TestFixture] + public class AttachmentTests + { + public Scene scene, scene2; + public UUID agent1; + public static Random random; + public ulong region1, region2; + public AgentCircuitData acd1; + public SceneObjectGroup sog1, sog2, sog3; + + [TestFixtureSetUp] + public void Init() + { + TestHelper.InMethod(); + + scene = SceneSetupHelpers.SetupScene("Neighbour x", UUID.Random(), 1000, 1000); + scene2 = SceneSetupHelpers.SetupScene("Neighbour x+1", UUID.Random(), 1001, 1000); + + ISharedRegionModule interregionComms = new LocalSimulationConnectorModule(); + interregionComms.Initialise(new IniConfigSource()); + interregionComms.PostInitialise(); + SceneSetupHelpers.SetupSceneModules(scene, new IniConfigSource(), interregionComms); + SceneSetupHelpers.SetupSceneModules(scene2, new IniConfigSource(), interregionComms); + + agent1 = UUID.Random(); + random = new Random(); + sog1 = NewSOG(UUID.Random(), scene, agent1); + sog2 = NewSOG(UUID.Random(), scene, agent1); + sog3 = NewSOG(UUID.Random(), scene, agent1); + + //ulong neighbourHandle = Utils.UIntsToLong((uint)(neighbourx * Constants.RegionSize), (uint)(neighboury * Constants.RegionSize)); + region1 = scene.RegionInfo.RegionHandle; + region2 = scene2.RegionInfo.RegionHandle; + + SceneSetupHelpers.AddRootAgent(scene, agent1); + } + + [TearDown] + public void TearDown() + { + if (MainServer.Instance != null) MainServer.Instance.Stop(); + } + + [Test] + public void T030_TestAddAttachments() + { + TestHelper.InMethod(); + + ScenePresence presence = scene.GetScenePresence(agent1); + + presence.AddAttachment(sog1); + presence.AddAttachment(sog2); + presence.AddAttachment(sog3); + + Assert.That(presence.HasAttachments(), Is.True); + Assert.That(presence.ValidateAttachments(), Is.True); + } + + [Test] + public void T031_RemoveAttachments() + { + TestHelper.InMethod(); + + ScenePresence presence = scene.GetScenePresence(agent1); + presence.RemoveAttachment(sog1); + presence.RemoveAttachment(sog2); + presence.RemoveAttachment(sog3); + Assert.That(presence.HasAttachments(), Is.False); + } + + // I'm commenting this test because scene setup NEEDS InventoryService to + // be non-null + //[Test] + public void T032_CrossAttachments() + { + TestHelper.InMethod(); + + ScenePresence presence = scene.GetScenePresence(agent1); + ScenePresence presence2 = scene2.GetScenePresence(agent1); + presence2.AddAttachment(sog1); + presence2.AddAttachment(sog2); + + ISharedRegionModule serialiser = new SerialiserModule(); + SceneSetupHelpers.SetupSceneModules(scene, new IniConfigSource(), serialiser); + SceneSetupHelpers.SetupSceneModules(scene2, new IniConfigSource(), serialiser); + + Assert.That(presence.HasAttachments(), Is.False, "Presence has attachments before cross"); + + //Assert.That(presence2.CrossAttachmentsIntoNewRegion(region1, true), Is.True, "Cross was not successful"); + Assert.That(presence2.HasAttachments(), Is.False, "Presence2 objects were not deleted"); + Assert.That(presence.HasAttachments(), Is.True, "Presence has not received new objects"); + } + + private SceneObjectGroup NewSOG(UUID uuid, Scene scene, UUID agent) + { + SceneObjectPart sop = new SceneObjectPart(); + sop.Name = RandomName(); + sop.Description = RandomName(); + sop.Text = RandomName(); + sop.SitName = RandomName(); + sop.TouchName = RandomName(); + sop.UUID = uuid; + sop.Shape = PrimitiveBaseShape.Default; + sop.Shape.State = 1; + sop.OwnerID = agent; + + SceneObjectGroup sog = new SceneObjectGroup(sop); + sog.SetScene(scene); + + return sog; + } + + private static string RandomName() + { + StringBuilder name = new StringBuilder(); + int size = random.Next(5,12); + char ch; + for (int i = 0; i < size; i++) + { + ch = Convert.ToChar(Convert.ToInt32(Math.Floor(26 * random.NextDouble() + 65))) ; + name.Append(ch); + } + + return name.ToString(); + } + } +} \ No newline at end of file diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs index 8286e4f..d82760e 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs @@ -331,56 +331,6 @@ namespace OpenSim.Region.Framework.Scenes.Tests Assert.That(presence.IsChildAgent, Is.False, "Presence was not made root in old region again."); } - [Test] - public void T030_TestAddAttachments() - { - TestHelper.InMethod(); - - ScenePresence presence = scene.GetScenePresence(agent1); - - presence.AddAttachment(sog1); - presence.AddAttachment(sog2); - presence.AddAttachment(sog3); - - Assert.That(presence.HasAttachments(), Is.True); - Assert.That(presence.ValidateAttachments(), Is.True); - } - - [Test] - public void T031_RemoveAttachments() - { - TestHelper.InMethod(); - - ScenePresence presence = scene.GetScenePresence(agent1); - presence.RemoveAttachment(sog1); - presence.RemoveAttachment(sog2); - presence.RemoveAttachment(sog3); - Assert.That(presence.HasAttachments(), Is.False); - } - - // I'm commenting this test because scene setup NEEDS InventoryService to - // be non-null - //[Test] - public void T032_CrossAttachments() - { - TestHelper.InMethod(); - - ScenePresence presence = scene.GetScenePresence(agent1); - ScenePresence presence2 = scene2.GetScenePresence(agent1); - presence2.AddAttachment(sog1); - presence2.AddAttachment(sog2); - - ISharedRegionModule serialiser = new SerialiserModule(); - SceneSetupHelpers.SetupSceneModules(scene, new IniConfigSource(), serialiser); - SceneSetupHelpers.SetupSceneModules(scene2, new IniConfigSource(), serialiser); - - Assert.That(presence.HasAttachments(), Is.False, "Presence has attachments before cross"); - - //Assert.That(presence2.CrossAttachmentsIntoNewRegion(region1, true), Is.True, "Cross was not successful"); - Assert.That(presence2.HasAttachments(), Is.False, "Presence2 objects were not deleted"); - Assert.That(presence.HasAttachments(), Is.True, "Presence has not received new objects"); - } - [TearDown] public void TearDown() { -- cgit v1.1 From c155f57dbe6b36697d2e1e50d4de43f7af2b97d1 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 18 Feb 2011 22:22:51 +0000 Subject: remove unused test teardown method --- OpenSim/Region/Framework/Scenes/Tests/AttachmentTests.cs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Tests') diff --git a/OpenSim/Region/Framework/Scenes/Tests/AttachmentTests.cs b/OpenSim/Region/Framework/Scenes/Tests/AttachmentTests.cs index 60e47f6..af44640 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/AttachmentTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/AttachmentTests.cs @@ -49,7 +49,7 @@ using OpenSim.Tests.Common.Setup; namespace OpenSim.Region.Framework.Scenes.Tests { /// - /// Scene presence tests + /// Attachment tests /// [TestFixture] public class AttachmentTests @@ -86,13 +86,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests region2 = scene2.RegionInfo.RegionHandle; SceneSetupHelpers.AddRootAgent(scene, agent1); - } - - [TearDown] - public void TearDown() - { - if (MainServer.Instance != null) MainServer.Instance.Stop(); - } + } [Test] public void T030_TestAddAttachments() -- cgit v1.1 From 023f953f39709e90c8eb31bc332dc2c01346cbd9 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 18 Feb 2011 22:25:45 +0000 Subject: remove another unused test teardown method --- OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs | 6 ------ 1 file changed, 6 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Tests') diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs index d82760e..ddff896 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs @@ -331,12 +331,6 @@ namespace OpenSim.Region.Framework.Scenes.Tests Assert.That(presence.IsChildAgent, Is.False, "Presence was not made root in old region again."); } - [TearDown] - public void TearDown() - { - if (MainServer.Instance != null) MainServer.Instance.Stop(); - } - public static string GetRandomCapsObjectPath() { UUID caps = UUID.Random(); -- cgit v1.1 From eb699df5f6c7a68a500e38dc994ed7c2f2aa89d9 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 18 Feb 2011 22:49:19 +0000 Subject: On SceneSetupHelpers, go back to calling ScenePresence.CompleteMovement() for the last stage of AddRootAgent() instead of SP.MakeRootAgent() Going this extra step doesn't appear to cause any test failures. This is arguably better for test purposes, though at some stage another method may arise which does just call AddRootAgent(). --- .../Framework/Scenes/Tests/ScenePresenceTests.cs | 60 +++++++++++++++------- 1 file changed, 41 insertions(+), 19 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Tests') diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs index ddff896..92c73be 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs @@ -172,25 +172,6 @@ namespace OpenSim.Region.Framework.Scenes.Tests Assert.That(neighbours.Count, Is.EqualTo(2)); } - - public void fixNullPresence() - { - string firstName = "testfirstname"; - - AgentCircuitData agent = new AgentCircuitData(); - agent.AgentID = agent1; - agent.firstname = firstName; - agent.lastname = "testlastname"; - agent.SessionID = UUID.Zero; - agent.SecureSessionID = UUID.Zero; - agent.circuitcode = 123; - agent.BaseFolder = UUID.Zero; - agent.InventoryFolder = UUID.Zero; - agent.startpos = Vector3.Zero; - agent.CapsPath = GetRandomCapsObjectPath(); - - acd1 = agent; - } [Test] public void T013_TestRemoveNeighbourRegion() @@ -208,6 +189,28 @@ namespace OpenSim.Region.Framework.Scenes.Tests CompleteAvatarMovement */ } + + /// + /// Test that if a root agent logs into a region, a child agent is also established in the neighbouring region + /// + /// + /// Please note that unlike the other tests here, this doesn't rely on structures + /// + [Test] + public void TestChildAgentEstablished() + { + UUID agent1Id = UUID.Parse("00000000-0000-0000-0000-000000000001"); + + TestScene myScene1 = SceneSetupHelpers.SetupScene("Neighbour x", UUID.Random(), 1000, 1000); + TestScene myScene2 = SceneSetupHelpers.SetupScene("Neighbour x+1", UUID.Random(), 1001, 1000); + + SceneSetupHelpers.AddRootAgent(myScene1, agent1Id); + ScenePresence childPresence = myScene2.GetScenePresence(agent1); + + // TODO: Need to do a fair amount of work to allow synchronous establishment of child agents +// Assert.That(childPresence, Is.Not.Null); +// Assert.That(childPresence.IsChildAgent, Is.True); + } // I'm commenting this test, because this is not supposed to happen here //[Test] @@ -330,7 +333,26 @@ namespace OpenSim.Region.Framework.Scenes.Tests Assert.That(presence2.IsChildAgent, Is.True, "Did not return from region as expected."); Assert.That(presence.IsChildAgent, Is.False, "Presence was not made root in old region again."); } + + public void fixNullPresence() + { + string firstName = "testfirstname"; + AgentCircuitData agent = new AgentCircuitData(); + agent.AgentID = agent1; + agent.firstname = firstName; + agent.lastname = "testlastname"; + agent.SessionID = UUID.Zero; + agent.SecureSessionID = UUID.Zero; + agent.circuitcode = 123; + agent.BaseFolder = UUID.Zero; + agent.InventoryFolder = UUID.Zero; + agent.startpos = Vector3.Zero; + agent.CapsPath = GetRandomCapsObjectPath(); + + acd1 = agent; + } + public static string GetRandomCapsObjectPath() { UUID caps = UUID.Random(); -- cgit v1.1 From dd9efc183812a66b1654aaeb419945cf57650b08 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 18 Feb 2011 23:05:56 +0000 Subject: extend TestChildAgentEstablished() test slightly to put in EntityTransferModule. Not yet enabled. --- OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Tests') diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs index 92c73be..60bc86c 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs @@ -40,6 +40,7 @@ using OpenSim.Framework; using OpenSim.Framework.Communications; using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Framework.Interfaces; +using OpenSim.Region.CoreModules.Framework.EntityTransfer; using OpenSim.Region.CoreModules.World.Serialiser; using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation; using OpenSim.Tests.Common; @@ -199,10 +200,16 @@ namespace OpenSim.Region.Framework.Scenes.Tests [Test] public void TestChildAgentEstablished() { + TestHelper.InMethod(); + log4net.Config.XmlConfigurator.Configure(); + UUID agent1Id = UUID.Parse("00000000-0000-0000-0000-000000000001"); - TestScene myScene1 = SceneSetupHelpers.SetupScene("Neighbour x", UUID.Random(), 1000, 1000); - TestScene myScene2 = SceneSetupHelpers.SetupScene("Neighbour x+1", UUID.Random(), 1001, 1000); + TestScene myScene1 = SceneSetupHelpers.SetupScene("Neighbour y", UUID.Random(), 1000, 1000); + TestScene myScene2 = SceneSetupHelpers.SetupScene("Neighbour y + 1", UUID.Random(), 1001, 1000); + + EntityTransferModule etm = new EntityTransferModule(); + SceneSetupHelpers.SetupSceneModules(myScene1, etm); SceneSetupHelpers.AddRootAgent(myScene1, agent1Id); ScenePresence childPresence = myScene2.GetScenePresence(agent1); -- cgit v1.1 From 8249d77991352697b4972f7109c014db0ebd5f68 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 18 Feb 2011 23:25:59 +0000 Subject: If GridService.GetNeighbours() could not find the region then log a warning rather than causing a null reference on the normal log line This also extends the TestChildAgentEstablished() test to actually activate the EntityTransferModule, though the test is not yet viable --- OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Tests') diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs index 60bc86c..5e1ff79 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs @@ -201,15 +201,18 @@ namespace OpenSim.Region.Framework.Scenes.Tests public void TestChildAgentEstablished() { TestHelper.InMethod(); - log4net.Config.XmlConfigurator.Configure(); +// log4net.Config.XmlConfigurator.Configure(); UUID agent1Id = UUID.Parse("00000000-0000-0000-0000-000000000001"); TestScene myScene1 = SceneSetupHelpers.SetupScene("Neighbour y", UUID.Random(), 1000, 1000); TestScene myScene2 = SceneSetupHelpers.SetupScene("Neighbour y + 1", UUID.Random(), 1001, 1000); + IConfigSource configSource = new IniConfigSource(); + configSource.AddConfig("Modules").Set("EntityTransferModule", "BasicEntityTransferModule"); EntityTransferModule etm = new EntityTransferModule(); - SceneSetupHelpers.SetupSceneModules(myScene1, etm); + + SceneSetupHelpers.SetupSceneModules(myScene1, configSource, etm); SceneSetupHelpers.AddRootAgent(myScene1, agent1Id); ScenePresence childPresence = myScene2.GetScenePresence(agent1); -- cgit v1.1 From 9e47018cfb42cc67a1d414e73396861b3a6b99ea Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 19 Feb 2011 00:14:13 +0000 Subject: Remove test T020_TestMakeRootAgent() which hasn't been active for ages anyway This test was non-viable. Keeping inactive T021_TestCrossToNewRegion() around for now since it's still useful for reference purposes in constructing a future working test. --- .../Framework/Scenes/Tests/ScenePresenceTests.cs | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Tests') diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs index 5e1ff79..fd2d6fa 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs @@ -222,25 +222,6 @@ namespace OpenSim.Region.Framework.Scenes.Tests // Assert.That(childPresence.IsChildAgent, Is.True); } - // I'm commenting this test, because this is not supposed to happen here - //[Test] - public void T020_TestMakeRootAgent() - { - TestHelper.InMethod(); - - ScenePresence presence = scene.GetScenePresence(agent1); - Assert.That(presence.IsChildAgent, Is.False, "Starts out as a root agent"); - - presence.MakeChildAgent(); - Assert.That(presence.IsChildAgent, Is.True, "Did not change to child agent after MakeChildAgent"); - - // Accepts 0 but rejects Constants.RegionSize - Vector3 pos = new Vector3(0,unchecked(Constants.RegionSize-1),0); - presence.MakeRootAgent(pos,true); - Assert.That(presence.IsChildAgent, Is.False, "Did not go back to root agent"); - Assert.That(presence.AbsolutePosition, Is.EqualTo(pos), "Position is not the same one entered"); - } - // I'm commenting this test because it does not represent // crossings. The Thread.Sleep's in here are not meaningful mocks, // and they sometimes fail in panda. -- cgit v1.1 From 9456bb77fbf794bb6fc2808e6cfd69c9bb1d1326 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 9 Mar 2011 23:25:24 +0000 Subject: Upgrade nunit.framework.dll to version 2.5.9. Fix up tests appropriately. This version removes the NUnit.Framework.SyntaxHelpers namespace, so any modules with their own tests will need to delete this using statement. --- OpenSim/Region/Framework/Scenes/Tests/AttachmentTests.cs | 1 - OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs | 1 - OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs | 1 - OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs | 1 - OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs | 1 - OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs | 1 - OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs | 1 - OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs | 1 - OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs | 1 - OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs | 1 - OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs | 1 - OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs | 1 - 12 files changed, 12 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Tests') diff --git a/OpenSim/Region/Framework/Scenes/Tests/AttachmentTests.cs b/OpenSim/Region/Framework/Scenes/Tests/AttachmentTests.cs index af44640..855b589 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/AttachmentTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/AttachmentTests.cs @@ -34,7 +34,6 @@ using System.Timers; using Timer=System.Timers.Timer; using Nini.Config; using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; using OpenMetaverse; using OpenSim.Framework; using OpenSim.Framework.Communications; diff --git a/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs b/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs index b3c3e22..667b74e 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs @@ -32,7 +32,6 @@ using System.Text; using System.Collections.Generic; using Nini.Config; using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; using OpenMetaverse; using OpenSim.Framework; using OpenSim.Framework.Communications; diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs index 9244bc3..ca635d7 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs @@ -28,7 +28,6 @@ using System; using System.Reflection; using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; using OpenMetaverse; using OpenSim.Framework; using OpenSim.Framework.Communications; diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs index 4969b09..a6a95ef 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs @@ -28,7 +28,6 @@ using System; using System.Reflection; using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; using OpenMetaverse; using OpenSim.Framework; using OpenSim.Framework.Communications; diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs index 39116b6..0d26026 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs @@ -30,7 +30,6 @@ using System.Collections.Generic; using System.Reflection; using Nini.Config; using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; using OpenMetaverse; using OpenSim.Framework; using OpenSim.Framework.Communications; diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs index b84298f..bdfcd1d 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs @@ -29,7 +29,6 @@ using System; using System.Collections.Generic; using System.Reflection; using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; using OpenMetaverse; using OpenSim.Framework; using OpenSim.Framework.Communications; diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs index c78038f..8876a43 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs @@ -30,7 +30,6 @@ using System.Collections.Generic; using System.Reflection; using Nini.Config; using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; using OpenMetaverse; using OpenSim.Framework; using OpenSim.Framework.Communications; diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs index fd2d6fa..efb757f 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs @@ -34,7 +34,6 @@ using System.Timers; using Timer=System.Timers.Timer; using Nini.Config; using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; using OpenMetaverse; using OpenSim.Framework; using OpenSim.Framework.Communications; diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs index 9aba8a8..abcce66 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs @@ -34,7 +34,6 @@ using System.Timers; using Timer=System.Timers.Timer; using Nini.Config; using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; using OpenMetaverse; using OpenSim.Framework; using OpenSim.Framework.Communications; diff --git a/OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs b/OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs index cafe48a..8588f7f 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs @@ -29,7 +29,6 @@ using System; using System.Reflection; using Nini.Config; using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; using OpenMetaverse; using OpenSim.Framework; using OpenSim.Framework.Communications; diff --git a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs index fe59d4f..8138bcc 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs @@ -34,7 +34,6 @@ using System.Timers; using Timer=System.Timers.Timer; using Nini.Config; using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; using OpenMetaverse; using OpenMetaverse.Assets; using OpenSim.Framework; diff --git a/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs b/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs index 5e6124b..6b70865 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs @@ -28,7 +28,6 @@ using System.Collections.Generic; using System.Text; using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; using OpenMetaverse; using OpenSim.Framework; using OpenSim.Region.Framework.Scenes; -- cgit v1.1