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/Scenes/Tests/ScenePresenceAgentTests.cs | |
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/Scenes/Tests/ScenePresenceAgentTests.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs | 72 |
1 files changed, 41 insertions, 31 deletions
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, |