diff options
author | Jeff Ames | 2009-10-01 01:00:09 +0900 |
---|---|---|
committer | Jeff Ames | 2009-10-01 01:17:47 +0900 |
commit | ee205e7e812e170f670e690a4e0fa9caa652f226 (patch) | |
tree | df407e66d9aa47a884e39d5d86b877d6ef468a1a /OpenSim/Region/ClientStack/LindenUDP/Tests/BasicCircuitTests.cs | |
parent | adding LandDataSerializer (not connected anywhere, work-in-progress) (diff) | |
download | opensim-SC-ee205e7e812e170f670e690a4e0fa9caa652f226.zip opensim-SC-ee205e7e812e170f670e690a4e0fa9caa652f226.tar.gz opensim-SC-ee205e7e812e170f670e690a4e0fa9caa652f226.tar.bz2 opensim-SC-ee205e7e812e170f670e690a4e0fa9caa652f226.tar.xz |
Formatting cleanup.
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/Tests/BasicCircuitTests.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/Tests/BasicCircuitTests.cs | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/Tests/BasicCircuitTests.cs b/OpenSim/Region/ClientStack/LindenUDP/Tests/BasicCircuitTests.cs index 9fb1041..32c0397 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/Tests/BasicCircuitTests.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/Tests/BasicCircuitTests.cs | |||
@@ -54,7 +54,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
54 | catch | 54 | catch |
55 | { | 55 | { |
56 | // I don't care, just leave log4net off | 56 | // I don't care, just leave log4net off |
57 | } | 57 | } |
58 | } | 58 | } |
59 | 59 | ||
60 | /// <summary> | 60 | /// <summary> |
@@ -63,20 +63,20 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
63 | /// <param name="scene"></param> | 63 | /// <param name="scene"></param> |
64 | /// <param name="testLLUDPServer"></param> | 64 | /// <param name="testLLUDPServer"></param> |
65 | /// <param name="testPacketServer"></param> | 65 | /// <param name="testPacketServer"></param> |
66 | /// <param name="acm">Agent circuit manager used in setting up the stack</param> | 66 | /// <param name="acm">Agent circuit manager used in setting up the stack</param> |
67 | protected void SetupStack( | 67 | protected void SetupStack( |
68 | IScene scene, out TestLLUDPServer testLLUDPServer, out TestLLPacketServer testPacketServer, | 68 | IScene scene, out TestLLUDPServer testLLUDPServer, out TestLLPacketServer testPacketServer, |
69 | out AgentCircuitManager acm) | 69 | out AgentCircuitManager acm) |
70 | { | 70 | { |
71 | IConfigSource configSource = new IniConfigSource(); | 71 | IConfigSource configSource = new IniConfigSource(); |
72 | ClientStackUserSettings userSettings = new ClientStackUserSettings(); | 72 | ClientStackUserSettings userSettings = new ClientStackUserSettings(); |
73 | testLLUDPServer = new TestLLUDPServer(); | 73 | testLLUDPServer = new TestLLUDPServer(); |
74 | acm = new AgentCircuitManager(); | 74 | acm = new AgentCircuitManager(); |
75 | 75 | ||
76 | uint port = 666; | 76 | uint port = 666; |
77 | testLLUDPServer.Initialise(null, ref port, 0, false, configSource, acm); | 77 | testLLUDPServer.Initialise(null, ref port, 0, false, configSource, acm); |
78 | testPacketServer = new TestLLPacketServer(testLLUDPServer, userSettings); | 78 | testPacketServer = new TestLLPacketServer(testLLUDPServer, userSettings); |
79 | testLLUDPServer.LocalScene = scene; | 79 | testLLUDPServer.LocalScene = scene; |
80 | } | 80 | } |
81 | 81 | ||
82 | /// <summary> | 82 | /// <summary> |
@@ -124,7 +124,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
124 | 124 | ||
125 | acm.AddNewCircuit(circuitCode, acd); | 125 | acm.AddNewCircuit(circuitCode, acd); |
126 | 126 | ||
127 | testLLUDPServer.LoadReceive(uccp, epSender); | 127 | testLLUDPServer.LoadReceive(uccp, epSender); |
128 | testLLUDPServer.ReceiveData(null); | 128 | testLLUDPServer.ReceiveData(null); |
129 | } | 129 | } |
130 | 130 | ||
@@ -142,15 +142,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
142 | onp.ObjectData = new ObjectNamePacket.ObjectDataBlock[] { odb }; | 142 | onp.ObjectData = new ObjectNamePacket.ObjectDataBlock[] { odb }; |
143 | onp.Header.Zerocoded = false; | 143 | onp.Header.Zerocoded = false; |
144 | 144 | ||
145 | return onp; | 145 | return onp; |
146 | } | 146 | } |
147 | 147 | ||
148 | /// <summary> | 148 | /// <summary> |
149 | /// Test adding a client to the stack | 149 | /// Test adding a client to the stack |
150 | /// </summary> | 150 | /// </summary> |
151 | [Test, LongRunning] | 151 | [Test, LongRunning] |
152 | public void TestAddClient() | 152 | public void TestAddClient() |
153 | { | 153 | { |
154 | TestHelper.InMethod(); | 154 | TestHelper.InMethod(); |
155 | 155 | ||
156 | uint myCircuitCode = 123456; | 156 | uint myCircuitCode = 123456; |
@@ -177,7 +177,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
177 | 177 | ||
178 | EndPoint testEp = new IPEndPoint(IPAddress.Loopback, 999); | 178 | EndPoint testEp = new IPEndPoint(IPAddress.Loopback, 999); |
179 | 179 | ||
180 | testLLUDPServer.LoadReceive(uccp, testEp); | 180 | testLLUDPServer.LoadReceive(uccp, testEp); |
181 | testLLUDPServer.ReceiveData(null); | 181 | testLLUDPServer.ReceiveData(null); |
182 | 182 | ||
183 | // Circuit shouildn't exist since the circuit manager doesn't know about this circuit for authentication yet | 183 | // Circuit shouildn't exist since the circuit manager doesn't know about this circuit for authentication yet |
@@ -185,8 +185,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
185 | 185 | ||
186 | acm.AddNewCircuit(myCircuitCode, acd); | 186 | acm.AddNewCircuit(myCircuitCode, acd); |
187 | 187 | ||
188 | testLLUDPServer.LoadReceive(uccp, testEp); | 188 | testLLUDPServer.LoadReceive(uccp, testEp); |
189 | testLLUDPServer.ReceiveData(null); | 189 | testLLUDPServer.ReceiveData(null); |
190 | 190 | ||
191 | // Should succeed now | 191 | // Should succeed now |
192 | Assert.IsTrue(testLLUDPServer.HasCircuit(myCircuitCode)); | 192 | Assert.IsTrue(testLLUDPServer.HasCircuit(myCircuitCode)); |
@@ -196,24 +196,24 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
196 | /// <summary> | 196 | /// <summary> |
197 | /// Test removing a client from the stack | 197 | /// Test removing a client from the stack |
198 | /// </summary> | 198 | /// </summary> |
199 | [Test] | 199 | [Test] |
200 | public void TestRemoveClient() | 200 | public void TestRemoveClient() |
201 | { | 201 | { |
202 | TestHelper.InMethod(); | 202 | TestHelper.InMethod(); |
203 | 203 | ||
204 | uint myCircuitCode = 123457; | 204 | uint myCircuitCode = 123457; |
205 | 205 | ||
206 | TestLLUDPServer testLLUDPServer; | 206 | TestLLUDPServer testLLUDPServer; |
207 | TestLLPacketServer testLLPacketServer; | 207 | TestLLPacketServer testLLPacketServer; |
208 | AgentCircuitManager acm; | 208 | AgentCircuitManager acm; |
209 | SetupStack(new MockScene(), out testLLUDPServer, out testLLPacketServer, out acm); | 209 | SetupStack(new MockScene(), out testLLUDPServer, out testLLPacketServer, out acm); |
210 | AddClient(myCircuitCode, new IPEndPoint(IPAddress.Loopback, 1000), testLLUDPServer, acm); | 210 | AddClient(myCircuitCode, new IPEndPoint(IPAddress.Loopback, 1000), testLLUDPServer, acm); |
211 | 211 | ||
212 | testLLUDPServer.RemoveClientCircuit(myCircuitCode); | 212 | testLLUDPServer.RemoveClientCircuit(myCircuitCode); |
213 | Assert.IsFalse(testLLUDPServer.HasCircuit(myCircuitCode)); | 213 | Assert.IsFalse(testLLUDPServer.HasCircuit(myCircuitCode)); |
214 | 214 | ||
215 | // Check that removing a non-existant circuit doesn't have any bad effects | 215 | // Check that removing a non-existant circuit doesn't have any bad effects |
216 | testLLUDPServer.RemoveClientCircuit(101); | 216 | testLLUDPServer.RemoveClientCircuit(101); |
217 | Assert.IsFalse(testLLUDPServer.HasCircuit(101)); | 217 | Assert.IsFalse(testLLUDPServer.HasCircuit(101)); |
218 | } | 218 | } |
219 | 219 | ||
@@ -232,7 +232,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
232 | TestLLUDPServer testLLUDPServer; | 232 | TestLLUDPServer testLLUDPServer; |
233 | TestLLPacketServer testLLPacketServer; | 233 | TestLLPacketServer testLLPacketServer; |
234 | AgentCircuitManager acm; | 234 | AgentCircuitManager acm; |
235 | SetupStack(scene, out testLLUDPServer, out testLLPacketServer, out acm); | 235 | SetupStack(scene, out testLLUDPServer, out testLLPacketServer, out acm); |
236 | AddClient(myCircuitCode, testEp, testLLUDPServer, acm); | 236 | AddClient(myCircuitCode, testEp, testLLUDPServer, acm); |
237 | 237 | ||
238 | byte[] data = new byte[] { 0x01, 0x02, 0x03, 0x04 }; | 238 | byte[] data = new byte[] { 0x01, 0x02, 0x03, 0x04 }; |
@@ -270,17 +270,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
270 | uint circuitCodeA = 130000; | 270 | uint circuitCodeA = 130000; |
271 | EndPoint epA = new IPEndPoint(IPAddress.Loopback, 1300); | 271 | EndPoint epA = new IPEndPoint(IPAddress.Loopback, 1300); |
272 | UUID agentIdA = UUID.Parse("00000000-0000-0000-0000-000000001300"); | 272 | UUID agentIdA = UUID.Parse("00000000-0000-0000-0000-000000001300"); |
273 | UUID sessionIdA = UUID.Parse("00000000-0000-0000-0000-000000002300"); | 273 | UUID sessionIdA = UUID.Parse("00000000-0000-0000-0000-000000002300"); |
274 | 274 | ||
275 | uint circuitCodeB = 130001; | 275 | uint circuitCodeB = 130001; |
276 | EndPoint epB = new IPEndPoint(IPAddress.Loopback, 1301); | 276 | EndPoint epB = new IPEndPoint(IPAddress.Loopback, 1301); |
277 | UUID agentIdB = UUID.Parse("00000000-0000-0000-0000-000000001301"); | 277 | UUID agentIdB = UUID.Parse("00000000-0000-0000-0000-000000001301"); |
278 | UUID sessionIdB = UUID.Parse("00000000-0000-0000-0000-000000002301"); | 278 | UUID sessionIdB = UUID.Parse("00000000-0000-0000-0000-000000002301"); |
279 | 279 | ||
280 | TestLLUDPServer testLLUDPServer; | 280 | TestLLUDPServer testLLUDPServer; |
281 | TestLLPacketServer testLLPacketServer; | 281 | TestLLPacketServer testLLPacketServer; |
282 | AgentCircuitManager acm; | 282 | AgentCircuitManager acm; |
283 | SetupStack(scene, out testLLUDPServer, out testLLPacketServer, out acm); | 283 | SetupStack(scene, out testLLUDPServer, out testLLPacketServer, out acm); |
284 | AddClient(circuitCodeA, epA, agentIdA, sessionIdA, testLLUDPServer, acm); | 284 | AddClient(circuitCodeA, epA, agentIdA, sessionIdA, testLLUDPServer, acm); |
285 | AddClient(circuitCodeB, epB, agentIdB, sessionIdB, testLLUDPServer, acm); | 285 | AddClient(circuitCodeB, epB, agentIdB, sessionIdB, testLLUDPServer, acm); |
286 | 286 | ||
@@ -293,7 +293,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
293 | Assert.IsFalse(testLLUDPServer.HasCircuit(circuitCodeA)); | 293 | Assert.IsFalse(testLLUDPServer.HasCircuit(circuitCodeA)); |
294 | 294 | ||
295 | Assert.That(testLLPacketServer.GetTotalPacketsReceived(), Is.EqualTo(3)); | 295 | Assert.That(testLLPacketServer.GetTotalPacketsReceived(), Is.EqualTo(3)); |
296 | Assert.That(testLLPacketServer.GetPacketsReceivedFor(PacketType.ObjectName), Is.EqualTo(3)); | 296 | Assert.That(testLLPacketServer.GetPacketsReceivedFor(PacketType.ObjectName), Is.EqualTo(3)); |
297 | } | 297 | } |
298 | } | 298 | } |
299 | } | 299 | } |