From e37f8cf90270ba6e1605bdb528ca205a35cfe049 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 6 Aug 2011 02:27:25 +0100 Subject: Add a test to check that ScenePresence and circuit go away when a root agent is closed down --- .../Scenes/Tests/ScenePresenceAgentTests.cs | 27 ++++++++++++++-------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs index 73acf28..6cf905a 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs @@ -93,15 +93,22 @@ namespace OpenSim.Region.Framework.Scenes.Tests region3 = scene3.RegionInfo.RegionHandle; } -// [Test] -// public void TestLogout() -// { -// TestHelpers.InMethod(); -//// log4net.Config.XmlConfigurator.Configure(); -// -// TestScene scene = SceneHelpers.SetupScene(); -// SceneHelpers. -// } + [Test] + public void TestCloseAgent() + { + TestHelpers.InMethod(); +// log4net.Config.XmlConfigurator.Configure(); + + TestScene scene = SceneHelpers.SetupScene(); + ScenePresence sp = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseTail(0x1)); + + Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(sp.UUID), Is.Not.Null); + + scene.IncomingCloseAgent(sp.UUID); + + Assert.That(scene.GetScenePresence(sp.UUID), Is.Null); + Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(sp.UUID), Is.Null); + } /// /// Test that if a root agent logs into a region, a child agent is also established in the neighbouring region @@ -118,7 +125,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests UUID agent1Id = UUID.Parse("00000000-0000-0000-0000-000000000001"); TestScene myScene1 = SceneHelpers.SetupScene("Neighbour y", UUID.Random(), 1000, 1000); -// TestScene myScene2 = SceneHelpers.SetupScene("Neighbour y + 1", UUID.Random(), 1001, 1000); +// TestScene myScene2 = SceneHelpers.SetupScene("Neighbour y + 1", UUID.Random(), 1001, 1000); IConfigSource configSource = new IniConfigSource(); configSource.AddConfig("Modules").Set("EntityTransferModule", "BasicEntityTransferModule"); -- cgit v1.1