diff options
author | Justin Clark-Casey (justincc) | 2011-12-03 18:59:54 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-12-03 18:59:54 +0000 |
commit | 4919c6056022053f8632b030a06fd8f48ac02a8e (patch) | |
tree | 098bfeaf1aa751f20e2bc4791f26302e74417d05 /OpenSim/Region | |
parent | Improve locking in AgentCircuitManager (diff) | |
download | opensim-SC_OLD-4919c6056022053f8632b030a06fd8f48ac02a8e.zip opensim-SC_OLD-4919c6056022053f8632b030a06fd8f48ac02a8e.tar.gz opensim-SC_OLD-4919c6056022053f8632b030a06fd8f48ac02a8e.tar.bz2 opensim-SC_OLD-4919c6056022053f8632b030a06fd8f48ac02a8e.tar.xz |
Add beginning of ScenePresenceAgentTests.TestCreateChildScenePresence()
This required an option to be added to NullRegionData via ConnectionString for it to act as a non-static instance, so that regression tests (which only load this class once) don't get hopeless confused and complex to compensate.
Normal standalone operation unaffected.
Diffstat (limited to 'OpenSim/Region')
3 files changed, 51 insertions, 16 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 99064c8..2f947fd 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -1341,7 +1341,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1341 | 1341 | ||
1342 | string reason = String.Empty; | 1342 | string reason = String.Empty; |
1343 | 1343 | ||
1344 | |||
1345 | bool regionAccepted = m_scene.SimulationService.CreateAgent(reg, a, (uint)TeleportFlags.Default, out reason); | 1344 | bool regionAccepted = m_scene.SimulationService.CreateAgent(reg, a, (uint)TeleportFlags.Default, out reason); |
1346 | 1345 | ||
1347 | if (regionAccepted && newAgent) | 1346 | if (regionAccepted && newAgent) |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs index cd7d6bc..b286d17 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs | |||
@@ -31,11 +31,10 @@ using System.IO; | |||
31 | using System.Reflection; | 31 | using System.Reflection; |
32 | using System.Threading; | 32 | using System.Threading; |
33 | using log4net.Config; | 33 | using log4net.Config; |
34 | using Nini.Config; | ||
34 | using NUnit.Framework; | 35 | using NUnit.Framework; |
35 | using OpenMetaverse; | 36 | using OpenMetaverse; |
36 | using OpenSim.Framework; | 37 | using OpenSim.Framework; |
37 | using Nini.Config; | ||
38 | |||
39 | using OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid; | 38 | using OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid; |
40 | using OpenSim.Region.Framework.Scenes; | 39 | using OpenSim.Region.Framework.Scenes; |
41 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; | 40 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; |
@@ -69,6 +68,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests | |||
69 | [Test] | 68 | [Test] |
70 | public void TestRegisterRegion() | 69 | public void TestRegisterRegion() |
71 | { | 70 | { |
71 | TestHelpers.InMethod(); | ||
72 | // log4net.Config.XmlConfigurator.Configure(); | ||
73 | |||
72 | SetUp(); | 74 | SetUp(); |
73 | 75 | ||
74 | // Create 4 regions | 76 | // Create 4 regions |
@@ -191,7 +193,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests | |||
191 | results = m_LocalConnector.GetHyperlinks(UUID.Zero); | 193 | results = m_LocalConnector.GetHyperlinks(UUID.Zero); |
192 | Assert.IsNotNull(results, "Retrieved GetHyperlinks list is null"); | 194 | Assert.IsNotNull(results, "Retrieved GetHyperlinks list is null"); |
193 | Assert.That(results.Count, Is.EqualTo(0), "Retrieved linked regions collection is not the number expected"); | 195 | Assert.That(results.Count, Is.EqualTo(0), "Retrieved linked regions collection is not the number expected"); |
194 | |||
195 | } | 196 | } |
196 | } | 197 | } |
197 | } | 198 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs index 57d22bd..f479e12 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs | |||
@@ -31,7 +31,7 @@ using System.Reflection; | |||
31 | using System.Text; | 31 | using System.Text; |
32 | using System.Threading; | 32 | using System.Threading; |
33 | using System.Timers; | 33 | using System.Timers; |
34 | using Timer=System.Timers.Timer; | 34 | using Timer = System.Timers.Timer; |
35 | using Nini.Config; | 35 | using Nini.Config; |
36 | using NUnit.Framework; | 36 | using NUnit.Framework; |
37 | using OpenMetaverse; | 37 | using OpenMetaverse; |
@@ -39,11 +39,13 @@ using OpenSim.Framework; | |||
39 | using OpenSim.Framework.Communications; | 39 | using OpenSim.Framework.Communications; |
40 | using OpenSim.Region.Framework.Scenes; | 40 | using OpenSim.Region.Framework.Scenes; |
41 | using OpenSim.Region.Framework.Interfaces; | 41 | using OpenSim.Region.Framework.Interfaces; |
42 | using OpenSim.Region.ClientStack.Linden; | ||
42 | using OpenSim.Region.CoreModules.Framework.EntityTransfer; | 43 | using OpenSim.Region.CoreModules.Framework.EntityTransfer; |
43 | using OpenSim.Region.CoreModules.World.Serialiser; | 44 | using OpenSim.Region.CoreModules.World.Serialiser; |
44 | using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation; | 45 | using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation; |
45 | using OpenSim.Tests.Common; | 46 | using OpenSim.Tests.Common; |
46 | using OpenSim.Tests.Common.Mock; | 47 | using OpenSim.Tests.Common.Mock; |
48 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; | ||
47 | 49 | ||
48 | namespace OpenSim.Region.Framework.Scenes.Tests | 50 | namespace OpenSim.Region.Framework.Scenes.Tests |
49 | { | 51 | { |
@@ -112,14 +114,40 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
112 | Assert.That(scene.AuthenticateHandler.GetAgentCircuits().Count, Is.EqualTo(0)); | 114 | Assert.That(scene.AuthenticateHandler.GetAgentCircuits().Count, Is.EqualTo(0)); |
113 | } | 115 | } |
114 | 116 | ||
117 | [Test] | ||
118 | public void TestCreateChildScenePresence() | ||
119 | { | ||
120 | TestHelpers.InMethod(); | ||
121 | // log4net.Config.XmlConfigurator.Configure(); | ||
122 | |||
123 | LocalSimulationConnectorModule lsc = new LocalSimulationConnectorModule(); | ||
124 | |||
125 | IConfigSource configSource = new IniConfigSource(); | ||
126 | IConfig config = configSource.AddConfig("Modules"); | ||
127 | config.Set("SimulationServices", "LocalSimulationConnectorModule"); | ||
128 | |||
129 | TestScene scene = SceneHelpers.SetupScene(); | ||
130 | SceneHelpers.SetupSceneModules(scene, configSource, lsc); | ||
131 | |||
132 | UUID agentId = TestHelpers.ParseTail(0x01); | ||
133 | AgentCircuitData acd = SceneHelpers.GenerateAgentData(agentId); | ||
134 | |||
135 | GridRegion region = scene.GridService.GetRegionByName(UUID.Zero, scene.RegionInfo.RegionName); | ||
136 | string reason; | ||
137 | scene.SimulationService.CreateAgent(region, acd, (uint)TeleportFlags.ViaLogin, out reason); | ||
138 | |||
139 | Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(agentId), Is.Not.Null); | ||
140 | Assert.That(scene.AuthenticateHandler.GetAgentCircuits().Count, Is.EqualTo(1)); | ||
141 | } | ||
142 | |||
115 | /// <summary> | 143 | /// <summary> |
116 | /// Test that if a root agent logs into a region, a child agent is also established in the neighbouring region | 144 | /// Test that if a root agent logs into a region, a child agent is also established in the neighbouring region |
117 | /// </summary> | 145 | /// </summary> |
118 | /// <remarks> | 146 | /// <remarks> |
119 | /// Please note that unlike the other tests here, this doesn't rely on structures | 147 | /// Please note that unlike the other tests here, this doesn't rely on anything set up in the instance fields. |
120 | /// </remarks> | 148 | /// </remarks> |
121 | [Test] | 149 | [Test] |
122 | public void TestChildAgentEstablished() | 150 | public void TestChildAgentEstablishedInNeighbour() |
123 | { | 151 | { |
124 | TestHelpers.InMethod(); | 152 | TestHelpers.InMethod(); |
125 | // log4net.Config.XmlConfigurator.Configure(); | 153 | // log4net.Config.XmlConfigurator.Configure(); |
@@ -127,18 +155,25 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
127 | UUID agent1Id = UUID.Parse("00000000-0000-0000-0000-000000000001"); | 155 | UUID agent1Id = UUID.Parse("00000000-0000-0000-0000-000000000001"); |
128 | 156 | ||
129 | TestScene myScene1 = SceneHelpers.SetupScene("Neighbour y", UUID.Random(), 1000, 1000); | 157 | TestScene myScene1 = SceneHelpers.SetupScene("Neighbour y", UUID.Random(), 1000, 1000); |
130 | // TestScene myScene2 = SceneHelpers.SetupScene("Neighbour y + 1", UUID.Random(), 1001, 1000); | 158 | TestScene myScene2 = SceneHelpers.SetupScene("Neighbour y + 1", UUID.Random(), 1001, 1000); |
131 | 159 | ||
132 | IConfigSource configSource = new IniConfigSource(); | 160 | IConfigSource configSource = new IniConfigSource(); |
133 | configSource.AddConfig("Modules").Set("EntityTransferModule", "BasicEntityTransferModule"); | 161 | IConfig config = configSource.AddConfig("Startup"); |
162 | config.Set("serverside_object_permissions", true); | ||
163 | config.Set("EventQueue", true); | ||
164 | |||
134 | EntityTransferModule etm = new EntityTransferModule(); | 165 | EntityTransferModule etm = new EntityTransferModule(); |
166 | |||
167 | EventQueueGetModule eqgm1 = new EventQueueGetModule(); | ||
168 | SceneHelpers.SetupSceneModules(myScene1, configSource, etm, eqgm1); | ||
169 | |||
170 | EventQueueGetModule eqgm2 = new EventQueueGetModule(); | ||
171 | SceneHelpers.SetupSceneModules(myScene2, configSource, etm, eqgm2); | ||
135 | 172 | ||
136 | SceneHelpers.SetupSceneModules(myScene1, configSource, etm); | 173 | // SceneHelpers.AddScenePresence(myScene1, agent1Id); |
137 | |||
138 | SceneHelpers.AddScenePresence(myScene1, agent1Id); | ||
139 | // ScenePresence childPresence = myScene2.GetScenePresence(agent1); | 174 | // ScenePresence childPresence = myScene2.GetScenePresence(agent1); |
140 | 175 | // | |
141 | // TODO: Need to do a fair amount of work to allow synchronous establishment of child agents | 176 | // // TODO: Need to do a fair amount of work to allow synchronous establishment of child agents |
142 | // Assert.That(childPresence, Is.Not.Null); | 177 | // Assert.That(childPresence, Is.Not.Null); |
143 | // Assert.That(childPresence.IsChildAgent, Is.True); | 178 | // Assert.That(childPresence.IsChildAgent, Is.True); |
144 | } | 179 | } |