aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-08-06 02:17:41 +0100
committerJustin Clark-Casey (justincc)2011-08-06 02:17:41 +0100
commit85e07c78fbed9e85c142c0f565c27015ad95769d (patch)
treefbf8db8ef6c3084343ca83b8901f232755b3fcfc /OpenSim
parentrip out sog generation methods in ScenePresenceAgentTests and use SceneHelper... (diff)
downloadopensim-SC-85e07c78fbed9e85c142c0f565c27015ad95769d.zip
opensim-SC-85e07c78fbed9e85c142c0f565c27015ad95769d.tar.gz
opensim-SC-85e07c78fbed9e85c142c0f565c27015ad95769d.tar.bz2
opensim-SC-85e07c78fbed9e85c142c0f565c27015ad95769d.tar.xz
refactor: Change SceneHelpers.AddClient() to AddScenePresence().
This seems to make more sense as we can get SP.ControllingClient
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/AvatarFactory/Tests/AvatarFactoryModuleTests.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/AttachmentTests.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs72
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs2
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs4
-rw-r--r--OpenSim/Tests/Common/Helpers/SceneHelpers.cs8
9 files changed, 54 insertions, 44 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/Tests/AvatarFactoryModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/Tests/AvatarFactoryModuleTests.cs
index 4e83fa7..1bd3b6e 100644
--- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/Tests/AvatarFactoryModuleTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/Tests/AvatarFactoryModuleTests.cs
@@ -52,7 +52,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
52 AvatarFactoryModule afm = new AvatarFactoryModule(); 52 AvatarFactoryModule afm = new AvatarFactoryModule();
53 TestScene scene = SceneHelpers.SetupScene(); 53 TestScene scene = SceneHelpers.SetupScene();
54 SceneHelpers.SetupSceneModules(scene, afm); 54 SceneHelpers.SetupSceneModules(scene, afm);
55 TestClient tc = SceneHelpers.AddClient(scene, userId); 55 IClientAPI tc = SceneHelpers.AddScenePresence(scene, userId).ControllingClient;
56 56
57 byte[] visualParams = new byte[AvatarAppearance.VISUALPARAM_COUNT]; 57 byte[] visualParams = new byte[AvatarAppearance.VISUALPARAM_COUNT];
58 for (byte i = 0; i < visualParams.Length; i++) 58 for (byte i = 0; i < visualParams.Length; i++)
diff --git a/OpenSim/Region/Framework/Scenes/Tests/AttachmentTests.cs b/OpenSim/Region/Framework/Scenes/Tests/AttachmentTests.cs
index fb28397..07b30f4 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/AttachmentTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/AttachmentTests.cs
@@ -83,7 +83,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
83 region1 = scene.RegionInfo.RegionHandle; 83 region1 = scene.RegionInfo.RegionHandle;
84 region2 = scene2.RegionInfo.RegionHandle; 84 region2 = scene2.RegionInfo.RegionHandle;
85 85
86 SceneHelpers.AddClient(scene, agent1); 86 SceneHelpers.AddScenePresence(scene, agent1);
87 } 87 }
88 88
89 [Test] 89 [Test]
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs
index ff55680..1ea2329 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs
@@ -139,7 +139,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
139 139
140 SceneObjectPart part = SceneHelpers.AddSceneObject(scene); 140 SceneObjectPart part = SceneHelpers.AddSceneObject(scene);
141 141
142 IClientAPI client = SceneHelpers.AddClient(scene, agentId); 142 IClientAPI client = SceneHelpers.AddScenePresence(scene, agentId).ControllingClient;
143 scene.DeRezObjects(client, new System.Collections.Generic.List<uint>() { part.LocalId }, UUID.Zero, DeRezAction.Delete, UUID.Zero); 143 scene.DeRezObjects(client, new System.Collections.Generic.List<uint>() { part.LocalId }, UUID.Zero, DeRezAction.Delete, UUID.Zero);
144 144
145 SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); 145 SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId);
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs
index c8a9ca3..654b1a2 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs
@@ -66,7 +66,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
66 IConfig config = configSource.AddConfig("Startup"); 66 IConfig config = configSource.AddConfig("Startup");
67 config.Set("serverside_object_permissions", true); 67 config.Set("serverside_object_permissions", true);
68 SceneHelpers.SetupSceneModules(scene, configSource, new object[] { new PermissionsModule() }); 68 SceneHelpers.SetupSceneModules(scene, configSource, new object[] { new PermissionsModule() });
69 TestClient client = SceneHelpers.AddClient(scene, userId); 69 IClientAPI client = SceneHelpers.AddScenePresence(scene, userId).ControllingClient;
70 70
71 // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. 71 // Turn off the timer on the async sog deleter - we'll crank it by hand for this test.
72 AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; 72 AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter;
@@ -105,7 +105,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
105 IConfig config = configSource.AddConfig("Startup"); 105 IConfig config = configSource.AddConfig("Startup");
106 config.Set("serverside_object_permissions", true); 106 config.Set("serverside_object_permissions", true);
107 SceneHelpers.SetupSceneModules(scene, configSource, new object[] { new PermissionsModule() }); 107 SceneHelpers.SetupSceneModules(scene, configSource, new object[] { new PermissionsModule() });
108 TestClient client = SceneHelpers.AddClient(scene, userId); 108 IClientAPI client = SceneHelpers.AddScenePresence(scene, userId).ControllingClient;
109 109
110 // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. 110 // Turn off the timer on the async sog deleter - we'll crank it by hand for this test.
111 AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; 111 AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter;
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs
index e604885..c13d82e 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs
@@ -75,7 +75,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
75 new GroupsModule(), 75 new GroupsModule(),
76 new MockGroupsServicesConnector() }); 76 new MockGroupsServicesConnector() });
77 77
78 TestClient client = SceneHelpers.AddClient(scene, userId); 78 IClientAPI client = SceneHelpers.AddScenePresence(scene, userId).ControllingClient;
79 79
80 IGroupsModule groupsModule = scene.RequestModuleInterface<IGroupsModule>(); 80 IGroupsModule groupsModule = scene.RequestModuleInterface<IGroupsModule>();
81 81
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs
index 04f5817..73acf28 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs
@@ -93,6 +93,47 @@ namespace OpenSim.Region.Framework.Scenes.Tests
93 region3 = scene3.RegionInfo.RegionHandle; 93 region3 = scene3.RegionInfo.RegionHandle;
94 } 94 }
95 95
96// [Test]
97// public void TestLogout()
98// {
99// TestHelpers.InMethod();
100//// log4net.Config.XmlConfigurator.Configure();
101//
102// TestScene scene = SceneHelpers.SetupScene();
103// SceneHelpers.
104// }
105
106 /// <summary>
107 /// Test that if a root agent logs into a region, a child agent is also established in the neighbouring region
108 /// </summary>
109 /// <remarks>
110 /// Please note that unlike the other tests here, this doesn't rely on structures
111 /// </remarks>
112 [Test]
113 public void TestChildAgentEstablished()
114 {
115 TestHelpers.InMethod();
116// log4net.Config.XmlConfigurator.Configure();
117
118 UUID agent1Id = UUID.Parse("00000000-0000-0000-0000-000000000001");
119
120 TestScene myScene1 = SceneHelpers.SetupScene("Neighbour y", UUID.Random(), 1000, 1000);
121// TestScene myScene2 = SceneHelpers.SetupScene("Neighbour y + 1", UUID.Random(), 1001, 1000);
122
123 IConfigSource configSource = new IniConfigSource();
124 configSource.AddConfig("Modules").Set("EntityTransferModule", "BasicEntityTransferModule");
125 EntityTransferModule etm = new EntityTransferModule();
126
127 SceneHelpers.SetupSceneModules(myScene1, configSource, etm);
128
129 SceneHelpers.AddScenePresence(myScene1, agent1Id);
130// ScenePresence childPresence = myScene2.GetScenePresence(agent1);
131
132 // TODO: Need to do a fair amount of work to allow synchronous establishment of child agents
133// Assert.That(childPresence, Is.Not.Null);
134// Assert.That(childPresence.IsChildAgent, Is.True);
135 }
136
96 /// <summary> 137 /// <summary>
97 /// Test adding a root agent to a scene. Doesn't yet actually complete crossing the agent into the scene. 138 /// Test adding a root agent to a scene. Doesn't yet actually complete crossing the agent into the scene.
98 /// </summary> 139 /// </summary>
@@ -190,37 +231,6 @@ namespace OpenSim.Region.Framework.Scenes.Tests
190 CompleteAvatarMovement 231 CompleteAvatarMovement
191 */ 232 */
192 } 233 }
193
194 /// <summary>
195 /// Test that if a root agent logs into a region, a child agent is also established in the neighbouring region
196 /// </summary>
197 /// <remarks>
198 /// Please note that unlike the other tests here, this doesn't rely on structures
199 /// </remarks>
200 [Test]
201 public void TestChildAgentEstablished()
202 {
203 TestHelpers.InMethod();
204// log4net.Config.XmlConfigurator.Configure();
205
206 UUID agent1Id = UUID.Parse("00000000-0000-0000-0000-000000000001");
207
208 TestScene myScene1 = SceneHelpers.SetupScene("Neighbour y", UUID.Random(), 1000, 1000);
209 TestScene myScene2 = SceneHelpers.SetupScene("Neighbour y + 1", UUID.Random(), 1001, 1000);
210
211 IConfigSource configSource = new IniConfigSource();
212 configSource.AddConfig("Modules").Set("EntityTransferModule", "BasicEntityTransferModule");
213 EntityTransferModule etm = new EntityTransferModule();
214
215 SceneHelpers.SetupSceneModules(myScene1, configSource, etm);
216
217 SceneHelpers.AddClient(myScene1, agent1Id);
218 ScenePresence childPresence = myScene2.GetScenePresence(agent1);
219
220 // TODO: Need to do a fair amount of work to allow synchronous establishment of child agents
221// Assert.That(childPresence, Is.Not.Null);
222// Assert.That(childPresence.IsChildAgent, Is.True);
223 }
224 234
225 // I'm commenting this test because it does not represent 235 // I'm commenting this test because it does not represent
226 // crossings. The Thread.Sleep's in here are not meaningful mocks, 236 // crossings. The Thread.Sleep's in here are not meaningful mocks,
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs
index 4765a86..39bb43a 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs
@@ -125,7 +125,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
125 sceneA.RegisterRegionWithGrid(); 125 sceneA.RegisterRegionWithGrid();
126 126
127 UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000041"); 127 UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000041");
128 TestClient client = SceneHelpers.AddClient(sceneA, agentId); 128 TestClient client = (TestClient)SceneHelpers.AddScenePresence(sceneA, agentId).ControllingClient;
129 129
130 ICapabilitiesModule sceneACapsModule = sceneA.RequestModuleInterface<ICapabilitiesModule>(); 130 ICapabilitiesModule sceneACapsModule = sceneA.RequestModuleInterface<ICapabilitiesModule>();
131 131
diff --git a/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs b/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs
index 28fa8a2..a0260a5 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs
@@ -59,7 +59,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests
59 AvatarFactoryModule afm = new AvatarFactoryModule(); 59 AvatarFactoryModule afm = new AvatarFactoryModule();
60 TestScene scene = SceneHelpers.SetupScene(); 60 TestScene scene = SceneHelpers.SetupScene();
61 SceneHelpers.SetupSceneModules(scene, config, afm, new NPCModule()); 61 SceneHelpers.SetupSceneModules(scene, config, afm, new NPCModule());
62 TestClient originalClient = SceneHelpers.AddClient(scene, TestHelpers.ParseTail(0x1)); 62 IClientAPI originalClient = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseTail(0x1)).ControllingClient;
63// ScenePresence originalAvatar = scene.GetScenePresence(originalClient.AgentId); 63// ScenePresence originalAvatar = scene.GetScenePresence(originalClient.AgentId);
64 64
65 // 8 is the index of the first baked texture in AvatarAppearance 65 // 8 is the index of the first baked texture in AvatarAppearance
@@ -96,7 +96,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests
96 96
97 TestScene scene = SceneHelpers.SetupScene(); 97 TestScene scene = SceneHelpers.SetupScene();
98 SceneHelpers.SetupSceneModules(scene, config, new NPCModule()); 98 SceneHelpers.SetupSceneModules(scene, config, new NPCModule());
99 TestClient originalClient = SceneHelpers.AddClient(scene, TestHelpers.ParseTail(0x1)); 99 IClientAPI originalClient = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseTail(0x1)).ControllingClient;
100// ScenePresence originalAvatar = scene.GetScenePresence(originalClient.AgentId); 100// ScenePresence originalAvatar = scene.GetScenePresence(originalClient.AgentId);
101 101
102 Vector3 startPos = new Vector3(128, 128, 30); 102 Vector3 startPos = new Vector3(128, 128, 30);
diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs
index 55b638b..070e390 100644
--- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs
+++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs
@@ -341,9 +341,9 @@ namespace OpenSim.Tests.Common
341 /// <param name="scene"></param> 341 /// <param name="scene"></param>
342 /// <param name="agentId"></param> 342 /// <param name="agentId"></param>
343 /// <returns></returns> 343 /// <returns></returns>
344 public static TestClient AddClient(Scene scene, UUID agentId) 344 public static ScenePresence AddScenePresence(Scene scene, UUID agentId)
345 { 345 {
346 return AddClient(scene, GenerateAgentData(agentId)); 346 return AddScenePresence(scene, GenerateAgentData(agentId));
347 } 347 }
348 348
349 /// <summary> 349 /// <summary>
@@ -364,7 +364,7 @@ namespace OpenSim.Tests.Common
364 /// <param name="scene"></param> 364 /// <param name="scene"></param>
365 /// <param name="agentData"></param> 365 /// <param name="agentData"></param>
366 /// <returns></returns> 366 /// <returns></returns>
367 public static TestClient AddClient(Scene scene, AgentCircuitData agentData) 367 public static ScenePresence AddScenePresence(Scene scene, AgentCircuitData agentData)
368 { 368 {
369 string reason; 369 string reason;
370 370
@@ -386,7 +386,7 @@ namespace OpenSim.Tests.Common
386 scp.CompleteMovement(client); 386 scp.CompleteMovement(client);
387 //scp.MakeRootAgent(new Vector3(90, 90, 90), true); 387 //scp.MakeRootAgent(new Vector3(90, 90, 90), true);
388 388
389 return client; 389 return scp;
390 } 390 }
391 391
392 /// <summary> 392 /// <summary>