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().
0.7.1-dev
Justin Clark-Casey (justincc) 2011-02-18 22:49:19 +00:00
parent 023f953f39
commit eb699df5f6
2 changed files with 44 additions and 24 deletions

View File

@ -173,25 +173,6 @@ namespace OpenSim.Region.Framework.Scenes.Tests
Assert.That(neighbours.Count, Is.EqualTo(2)); 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] [Test]
public void T013_TestRemoveNeighbourRegion() public void T013_TestRemoveNeighbourRegion()
{ {
@ -209,6 +190,28 @@ namespace OpenSim.Region.Framework.Scenes.Tests
*/ */
} }
/// <summary>
/// Test that if a root agent logs into a region, a child agent is also established in the neighbouring region
/// </summary>
/// <remarks>
/// Please note that unlike the other tests here, this doesn't rely on structures
/// </remarks>
[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 // I'm commenting this test, because this is not supposed to happen here
//[Test] //[Test]
public void T020_TestMakeRootAgent() public void T020_TestMakeRootAgent()
@ -331,6 +334,25 @@ namespace OpenSim.Region.Framework.Scenes.Tests
Assert.That(presence.IsChildAgent, Is.False, "Presence was not made root in old region again."); 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() public static string GetRandomCapsObjectPath()
{ {
UUID caps = UUID.Random(); UUID caps = UUID.Random();

View File

@ -504,12 +504,10 @@ namespace OpenSim.Tests.Common.Setup
TestClient client = new TestClient(agentData, scene); TestClient client = new TestClient(agentData, scene);
scene.AddNewClient(client); scene.AddNewClient(client);
// Stage 3: Invoke agent crossing, which converts the child agent into a root agent (with appearance, // Stage 3: Complete the entrance into the region. This converts the child agent into a root agent.
// inventory, etc.)
//scene.AgentCrossing(agentData.AgentID, new Vector3(90, 90, 90), false); OBSOLETE
ScenePresence scp = scene.GetScenePresence(agentData.AgentID); ScenePresence scp = scene.GetScenePresence(agentData.AgentID);
scp.MakeRootAgent(new Vector3(90, 90, 90), true); scp.CompleteMovement(client);
//scp.MakeRootAgent(new Vector3(90, 90, 90), true);
return client; return client;
} }