aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-12-03 19:10:32 +0000
committerJustin Clark-Casey (justincc)2011-12-03 19:10:32 +0000
commit3852f05e6e03425e06eec1faa19929146901c92e (patch)
tree8e7e6d56907766c986f829480b83d08547ea2265 /OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs
parentAdd beginning of ScenePresenceAgentTests.TestCreateChildScenePresence() (diff)
downloadopensim-SC-3852f05e6e03425e06eec1faa19929146901c92e.zip
opensim-SC-3852f05e6e03425e06eec1faa19929146901c92e.tar.gz
opensim-SC-3852f05e6e03425e06eec1faa19929146901c92e.tar.bz2
opensim-SC-3852f05e6e03425e06eec1faa19929146901c92e.tar.xz
Extend TestCreateChildScenePresence to make assertions both at CreateAgent stage and then at Scene.AddClient()
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs16
1 files changed, 16 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs
index f479e12..df2dacb 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs
@@ -131,13 +131,29 @@ namespace OpenSim.Region.Framework.Scenes.Tests
131 131
132 UUID agentId = TestHelpers.ParseTail(0x01); 132 UUID agentId = TestHelpers.ParseTail(0x01);
133 AgentCircuitData acd = SceneHelpers.GenerateAgentData(agentId); 133 AgentCircuitData acd = SceneHelpers.GenerateAgentData(agentId);
134 acd.child = true;
134 135
135 GridRegion region = scene.GridService.GetRegionByName(UUID.Zero, scene.RegionInfo.RegionName); 136 GridRegion region = scene.GridService.GetRegionByName(UUID.Zero, scene.RegionInfo.RegionName);
136 string reason; 137 string reason;
138 // XXX: ViaLogin may not be correct here.
137 scene.SimulationService.CreateAgent(region, acd, (uint)TeleportFlags.ViaLogin, out reason); 139 scene.SimulationService.CreateAgent(region, acd, (uint)TeleportFlags.ViaLogin, out reason);
138 140
139 Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(agentId), Is.Not.Null); 141 Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(agentId), Is.Not.Null);
140 Assert.That(scene.AuthenticateHandler.GetAgentCircuits().Count, Is.EqualTo(1)); 142 Assert.That(scene.AuthenticateHandler.GetAgentCircuits().Count, Is.EqualTo(1));
143
144 // There's no scene presence yet since only an agent circuit has been established.
145 Assert.That(scene.GetScenePresence(agentId), Is.Null);
146
147 TestClient client = new TestClient(acd, scene);
148 scene.AddNewClient(client, PresenceType.User);
149
150 Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(agentId), Is.Not.Null);
151 Assert.That(scene.AuthenticateHandler.GetAgentCircuits().Count, Is.EqualTo(1));
152
153 ScenePresence sp = scene.GetScenePresence(agentId);
154 Assert.That(sp, Is.Not.Null);
155 Assert.That(sp.UUID, Is.EqualTo(agentId));
156 Assert.That(sp.IsChildAgent, Is.True);
141 } 157 }
142 158
143 /// <summary> 159 /// <summary>