diff options
author | Justin Clark-Casey (justincc) | 2011-08-06 02:17:41 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-08-06 02:17:41 +0100 |
commit | 85e07c78fbed9e85c142c0f565c27015ad95769d (patch) | |
tree | fbf8db8ef6c3084343ca83b8901f232755b3fcfc /OpenSim/Region/Framework | |
parent | rip out sog generation methods in ScenePresenceAgentTests and use SceneHelper... (diff) | |
download | opensim-SC_OLD-85e07c78fbed9e85c142c0f565c27015ad95769d.zip opensim-SC_OLD-85e07c78fbed9e85c142c0f565c27015ad95769d.tar.gz opensim-SC_OLD-85e07c78fbed9e85c142c0f565c27015ad95769d.tar.bz2 opensim-SC_OLD-85e07c78fbed9e85c142c0f565c27015ad95769d.tar.xz |
refactor: Change SceneHelpers.AddClient() to AddScenePresence().
This seems to make more sense as we can get SP.ControllingClient
Diffstat (limited to 'OpenSim/Region/Framework')
6 files changed, 47 insertions, 37 deletions
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 | ||