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