diff options
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/Tests')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/Tests/BasicCircuitTests.cs | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/Tests/BasicCircuitTests.cs b/OpenSim/Region/ClientStack/LindenUDP/Tests/BasicCircuitTests.cs index 29f0c20..c90aecf 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/Tests/BasicCircuitTests.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/Tests/BasicCircuitTests.cs | |||
@@ -28,6 +28,7 @@ | |||
28 | using System.Net; | 28 | using System.Net; |
29 | using log4net; | 29 | using log4net; |
30 | using NUnit.Framework; | 30 | using NUnit.Framework; |
31 | using OpenMetaverse; | ||
31 | using OpenMetaverse.Packets; | 32 | using OpenMetaverse.Packets; |
32 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
33 | using OpenSim.Framework.Communications; | 34 | using OpenSim.Framework.Communications; |
@@ -58,18 +59,31 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
58 | [Test] | 59 | [Test] |
59 | public void TestAddClient() | 60 | public void TestAddClient() |
60 | { | 61 | { |
62 | uint myCircuitCode = 123456; | ||
63 | UUID myAgentUuid = UUID.Parse("00000000-0000-0000-0000-000000000001"); | ||
64 | UUID mySessionUuid = UUID.Parse("00000000-0000-0000-0000-000000000002"); | ||
65 | |||
61 | TestLLUDPServer testLLUDPServer = new TestLLUDPServer(); | 66 | TestLLUDPServer testLLUDPServer = new TestLLUDPServer(); |
62 | ClientStackUserSettings userSettings = new ClientStackUserSettings(); | 67 | ClientStackUserSettings userSettings = new ClientStackUserSettings(); |
63 | 68 | ||
69 | AgentCircuitManager acm = new AgentCircuitManager(); | ||
70 | AgentCircuitData acd = new AgentCircuitData(); | ||
71 | acd.AgentID = myAgentUuid; | ||
72 | acd.SessionID = mySessionUuid; | ||
73 | acm.AddNewCircuit(myCircuitCode, acd); | ||
74 | |||
64 | uint port = 666; | 75 | uint port = 666; |
65 | testLLUDPServer.Initialise(null, ref port, 0, false, userSettings, null, new AgentCircuitManager()); | 76 | testLLUDPServer.Initialise(null, ref port, 0, false, userSettings, null, acm); |
66 | LLPacketServer packetServer = new LLPacketServer(testLLUDPServer, userSettings); | 77 | LLPacketServer packetServer = new LLPacketServer(testLLUDPServer, userSettings); |
67 | testLLUDPServer.LocalScene = new MockScene(); | 78 | testLLUDPServer.LocalScene = new MockScene(); |
68 | 79 | ||
69 | UseCircuitCodePacket uccp = new UseCircuitCodePacket(); | 80 | UseCircuitCodePacket uccp = new UseCircuitCodePacket(); |
81 | |||
70 | UseCircuitCodePacket.CircuitCodeBlock uccpCcBlock | 82 | UseCircuitCodePacket.CircuitCodeBlock uccpCcBlock |
71 | = new OpenMetaverse.Packets.UseCircuitCodePacket.CircuitCodeBlock(); | 83 | = new OpenMetaverse.Packets.UseCircuitCodePacket.CircuitCodeBlock(); |
72 | uccpCcBlock.Code = 123456; | 84 | uccpCcBlock.Code = myCircuitCode; |
85 | uccpCcBlock.ID = myAgentUuid; | ||
86 | uccpCcBlock.SessionID = mySessionUuid; | ||
73 | uccp.CircuitCode = uccpCcBlock; | 87 | uccp.CircuitCode = uccpCcBlock; |
74 | 88 | ||
75 | EndPoint testEp = new IPEndPoint(IPAddress.Loopback, 999); | 89 | EndPoint testEp = new IPEndPoint(IPAddress.Loopback, 999); |
@@ -78,7 +92,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
78 | testLLUDPServer.ReceiveData(null); | 92 | testLLUDPServer.ReceiveData(null); |
79 | 93 | ||
80 | Assert.IsFalse(testLLUDPServer.HasCircuit(101)); | 94 | Assert.IsFalse(testLLUDPServer.HasCircuit(101)); |
81 | Assert.IsTrue(testLLUDPServer.HasCircuit(123456)); | 95 | Assert.IsTrue(testLLUDPServer.HasCircuit(myCircuitCode)); |
82 | } | 96 | } |
83 | } | 97 | } |
84 | } | 98 | } |