aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Tests/SceneObjectCrossingTests.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Tests/SceneObjectCrossingTests.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectCrossingTests.cs51
1 files changed, 35 insertions, 16 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectCrossingTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectCrossingTests.cs
index 5635c20..abf8c48 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectCrossingTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectCrossingTests.cs
@@ -37,6 +37,7 @@ using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation;
37using OpenSim.Region.CoreModules.World.Land; 37using OpenSim.Region.CoreModules.World.Land;
38using OpenSim.Region.OptionalModules; 38using OpenSim.Region.OptionalModules;
39using OpenSim.Tests.Common; 39using OpenSim.Tests.Common;
40using System.Threading;
40 41
41namespace OpenSim.Region.Framework.Scenes.Tests 42namespace OpenSim.Region.Framework.Scenes.Tests
42{ 43{
@@ -64,6 +65,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
64 [Test] 65 [Test]
65 public void TestCrossOnSameSimulator() 66 public void TestCrossOnSameSimulator()
66 { 67 {
68
67 TestHelpers.InMethod(); 69 TestHelpers.InMethod();
68// TestHelpers.EnableLogging(); 70// TestHelpers.EnableLogging();
69 71
@@ -94,6 +96,9 @@ namespace OpenSim.Region.Framework.Scenes.Tests
94 // Cross with a negative value 96 // Cross with a negative value
95 so1.AbsolutePosition = new Vector3(128, -10, 20); 97 so1.AbsolutePosition = new Vector3(128, -10, 20);
96 98
99 // crossing is async
100 Thread.Sleep(500);
101
97 Assert.IsNull(sceneA.GetSceneObjectGroup(so1Id)); 102 Assert.IsNull(sceneA.GetSceneObjectGroup(so1Id));
98 Assert.NotNull(sceneB.GetSceneObjectGroup(so1Id)); 103 Assert.NotNull(sceneB.GetSceneObjectGroup(so1Id));
99 } 104 }
@@ -152,26 +157,28 @@ namespace OpenSim.Region.Framework.Scenes.Tests
152 157
153 // Cross 158 // Cross
154 sceneA.SceneGraph.UpdatePrimGroupPosition( 159 sceneA.SceneGraph.UpdatePrimGroupPosition(
155 so1.LocalId, new Vector3(so1StartPos.X, so1StartPos.Y - 20, so1StartPos.Z), userId); 160 so1.LocalId, new Vector3(so1StartPos.X, so1StartPos.Y - 20, so1StartPos.Z), sp1SceneA.ControllingClient);
161
162 // crossing is async
163 Thread.Sleep(500);
156 164
157 SceneObjectGroup so1PostCross; 165 SceneObjectGroup so1PostCross;
158 166
159 { 167 ScenePresence sp1SceneAPostCross = sceneA.GetScenePresence(userId);
160 ScenePresence sp1SceneAPostCross = sceneA.GetScenePresence(userId); 168 Assert.IsTrue(sp1SceneAPostCross.IsChildAgent, "sp1SceneAPostCross.IsChildAgent unexpectedly false");
161 Assert.IsTrue(sp1SceneAPostCross.IsChildAgent, "sp1SceneAPostCross.IsChildAgent unexpectedly false");
162 169
163 ScenePresence sp1SceneBPostCross = sceneB.GetScenePresence(userId); 170 ScenePresence sp1SceneBPostCross = sceneB.GetScenePresence(userId);
164 TestClient sceneBTc = ((TestClient)sp1SceneBPostCross.ControllingClient); 171 TestClient sceneBTc = ((TestClient)sp1SceneBPostCross.ControllingClient);
165 sceneBTc.CompleteMovement(); 172 sceneBTc.CompleteMovement();
166 173
167 Assert.IsFalse(sp1SceneBPostCross.IsChildAgent, "sp1SceneAPostCross.IsChildAgent unexpectedly true"); 174 Assert.IsFalse(sp1SceneBPostCross.IsChildAgent, "sp1SceneAPostCross.IsChildAgent unexpectedly true");
168 Assert.IsTrue(sp1SceneBPostCross.IsSatOnObject); 175 Assert.IsTrue(sp1SceneBPostCross.IsSatOnObject);
176
177 Assert.IsNull(sceneA.GetSceneObjectGroup(so1Id), "uck");
178 so1PostCross = sceneB.GetSceneObjectGroup(so1Id);
179 Assert.NotNull(so1PostCross);
180 Assert.AreEqual(1, so1PostCross.GetSittingAvatarsCount());
169 181
170 Assert.IsNull(sceneA.GetSceneObjectGroup(so1Id), "uck");
171 so1PostCross = sceneB.GetSceneObjectGroup(so1Id);
172 Assert.NotNull(so1PostCross);
173 Assert.AreEqual(1, so1PostCross.GetSittingAvatarsCount());
174 }
175 182
176 Vector3 so1PostCrossPos = so1PostCross.AbsolutePosition; 183 Vector3 so1PostCrossPos = so1PostCross.AbsolutePosition;
177 184
@@ -179,7 +186,10 @@ namespace OpenSim.Region.Framework.Scenes.Tests
179 186
180 // Recross 187 // Recross
181 sceneB.SceneGraph.UpdatePrimGroupPosition( 188 sceneB.SceneGraph.UpdatePrimGroupPosition(
182 so1PostCross.LocalId, new Vector3(so1PostCrossPos.X, so1PostCrossPos.Y + 20, so1PostCrossPos.Z), userId); 189 so1PostCross.LocalId, new Vector3(so1PostCrossPos.X, so1PostCrossPos.Y + 20, so1PostCrossPos.Z), sp1SceneBPostCross.ControllingClient);
190
191 // crossing is async
192 Thread.Sleep(500);
183 193
184 { 194 {
185 ScenePresence sp1SceneBPostReCross = sceneB.GetScenePresence(userId); 195 ScenePresence sp1SceneBPostReCross = sceneB.GetScenePresence(userId);
@@ -244,13 +254,22 @@ namespace OpenSim.Region.Framework.Scenes.Tests
244 lmmA.EventManagerOnNoLandDataFromStorage(); 254 lmmA.EventManagerOnNoLandDataFromStorage();
245 lmmB.EventManagerOnNoLandDataFromStorage(); 255 lmmB.EventManagerOnNoLandDataFromStorage();
246 256
257 AgentCircuitData acd = SceneHelpers.GenerateAgentData(userId);
258 TestClient tc = new TestClient(acd, sceneA);
259 List<TestClient> destinationTestClients = new List<TestClient>();
260 EntityTransferHelpers.SetupInformClientOfNeighbourTriggersNeighbourClientCreate(tc, destinationTestClients);
261 ScenePresence sp1SceneA = SceneHelpers.AddScenePresence(sceneA, tc, acd);
262
247 SceneObjectGroup so1 = SceneHelpers.AddSceneObject(sceneA, 1, userId, "", sceneObjectIdTail); 263 SceneObjectGroup so1 = SceneHelpers.AddSceneObject(sceneA, 1, userId, "", sceneObjectIdTail);
248 UUID so1Id = so1.UUID; 264 UUID so1Id = so1.UUID;
249 so1.AbsolutePosition = new Vector3(128, 10, 20); 265 so1.AbsolutePosition = new Vector3(128, 10, 20);
250 266
251 // Cross with a negative value. We must make this call rather than setting AbsolutePosition directly 267 // Cross with a negative value. We must make this call rather than setting AbsolutePosition directly
252 // because only this will execute permission checks in the source region. 268 // because only this will execute permission checks in the source region.
253 sceneA.SceneGraph.UpdatePrimGroupPosition(so1.LocalId, new Vector3(128, -10, 20), userId); 269 sceneA.SceneGraph.UpdatePrimGroupPosition(so1.LocalId, new Vector3(128, -10, 20), sp1SceneA.ControllingClient);
270
271 // crossing is async
272 Thread.Sleep(500);
254 273
255 Assert.IsNull(sceneA.GetSceneObjectGroup(so1Id)); 274 Assert.IsNull(sceneA.GetSceneObjectGroup(so1Id));
256 Assert.NotNull(sceneB.GetSceneObjectGroup(so1Id)); 275 Assert.NotNull(sceneB.GetSceneObjectGroup(so1Id));