27 using System.Collections.Generic;
29 using NUnit.Framework;
32 namespace OpenSim.Framework.Tests
39 private UUID AgentId1;
40 private UUID AgentId2;
41 private uint circuitcode1;
42 private uint circuitcode2;
44 private UUID SessionId1;
45 private UUID SessionId2;
46 private Random rnd =
new Random(Environment.TickCount);
52 AgentId1 = UUID.Random();
53 AgentId2 = UUID.Random();
54 circuitcode1 = (uint) rnd.Next((
int)uint.MinValue,
int.MaxValue);
55 circuitcode2 = (uint) rnd.Next((
int)uint.MinValue,
int.MaxValue);
56 SessionId1 = UUID.Random();
57 SessionId2 = UUID.Random();
58 UUID BaseFolder = UUID.Random();
59 string CapsPath =
"http://www.opensimulator.org/Caps/Foo";
60 Dictionary<ulong,string> ChildrenCapsPaths =
new Dictionary<ulong, string>();
61 ChildrenCapsPaths.Add(ulong.MaxValue,
"http://www.opensimulator.org/Caps/Foo2");
62 string firstname =
"CoolAvatarTest";
63 string lastname =
"test";
64 Vector3 StartPos =
new Vector3(5, 23, 125);
66 UUID SecureSessionId = UUID.Random();
70 m_agentCircuitData1.AgentID = AgentId1;
72 m_agentCircuitData1.BaseFolder = BaseFolder;
73 m_agentCircuitData1.CapsPath = CapsPath;
74 m_agentCircuitData1.child =
false;
75 m_agentCircuitData1.ChildrenCapSeeds = ChildrenCapsPaths;
76 m_agentCircuitData1.circuitcode = circuitcode1;
77 m_agentCircuitData1.firstname = firstname;
78 m_agentCircuitData1.InventoryFolder = BaseFolder;
79 m_agentCircuitData1.lastname = lastname;
80 m_agentCircuitData1.SecureSessionID = SecureSessionId;
81 m_agentCircuitData1.SessionID = SessionId1;
82 m_agentCircuitData1.startpos = StartPos;
85 m_agentCircuitData2.AgentID = AgentId2;
87 m_agentCircuitData2.BaseFolder = BaseFolder;
88 m_agentCircuitData2.CapsPath = CapsPath;
89 m_agentCircuitData2.child =
false;
90 m_agentCircuitData2.ChildrenCapSeeds = ChildrenCapsPaths;
91 m_agentCircuitData2.circuitcode = circuitcode2;
92 m_agentCircuitData2.firstname = firstname;
93 m_agentCircuitData2.InventoryFolder = BaseFolder;
94 m_agentCircuitData2.lastname = lastname;
95 m_agentCircuitData2.SecureSessionID = SecureSessionId;
96 m_agentCircuitData2.SessionID = SessionId2;
97 m_agentCircuitData2.startpos = StartPos;
107 agentCircuitManager.AddNewCircuit(circuitcode1,m_agentCircuitData1);
108 agentCircuitManager.AddNewCircuit(circuitcode2, m_agentCircuitData2);
109 AgentCircuitData agent = agentCircuitManager.GetAgentCircuitData(circuitcode1);
111 Assert.That((m_agentCircuitData1.AgentID == agent.AgentID));
112 Assert.That((m_agentCircuitData1.BaseFolder == agent.BaseFolder));
114 Assert.That((m_agentCircuitData1.CapsPath == agent.CapsPath));
115 Assert.That((m_agentCircuitData1.child == agent.child));
116 Assert.That((m_agentCircuitData1.ChildrenCapSeeds.Count == agent.ChildrenCapSeeds.Count));
117 Assert.That((m_agentCircuitData1.circuitcode == agent.circuitcode));
118 Assert.That((m_agentCircuitData1.firstname == agent.firstname));
119 Assert.That((m_agentCircuitData1.InventoryFolder == agent.InventoryFolder));
120 Assert.That((m_agentCircuitData1.lastname == agent.lastname));
121 Assert.That((m_agentCircuitData1.SecureSessionID == agent.SecureSessionID));
122 Assert.That((m_agentCircuitData1.SessionID == agent.SessionID));
123 Assert.That((m_agentCircuitData1.startpos == agent.startpos));
133 agentCircuitManager.AddNewCircuit(circuitcode1, m_agentCircuitData1);
134 agentCircuitManager.AddNewCircuit(circuitcode2, m_agentCircuitData2);
135 agentCircuitManager.RemoveCircuit(circuitcode2);
137 AgentCircuitData agent = agentCircuitManager.GetAgentCircuitData(circuitcode2);
138 Assert.That(agent == null);
149 agentCircuitManager.AddNewCircuit(circuitcode1, m_agentCircuitData1);
150 agentCircuitManager.AddNewCircuit(circuitcode2, m_agentCircuitData2);
153 result = agentCircuitManager.TryChangeCiruitCode(circuitcode1, 393930);
156 AgentCircuitData agent2 = agentCircuitManager.GetAgentCircuitData(circuitcode1);
157 Assert.That(agent != null);
158 Assert.That(agent2 == null);
172 agentCircuitManager.AddNewCircuit(circuitcode1, m_agentCircuitData1);
173 agentCircuitManager.AddNewCircuit(circuitcode2, m_agentCircuitData2);
176 AuthenticateResponse resp = agentCircuitManager.AuthenticateSession(SessionId1, AgentId1, circuitcode1);
177 Assert.That(resp.Authorised);
181 resp = agentCircuitManager.AuthenticateSession(SessionId1, UUID.Random(), circuitcode1);
182 Assert.That(!resp.Authorised);
184 resp = agentCircuitManager.AuthenticateSession(UUID.Random(), AgentId1, circuitcode1);
185 Assert.That(!resp.Authorised);
187 resp = agentCircuitManager.AuthenticateSession(SessionId1, AgentId1, circuitcode2);
188 Assert.That(!resp.Authorised);
190 resp = agentCircuitManager.AuthenticateSession(SessionId2, AgentId1, circuitcode2);
191 Assert.That(!resp.Authorised);
193 agentCircuitManager.RemoveCircuit(circuitcode2);
195 resp = agentCircuitManager.AuthenticateSession(SessionId2, AgentId2, circuitcode2);
196 Assert.That(!resp.Authorised);
Contains the Avatar's Appearance and methods to manipulate the appearance.
void ValidateLoginTest()
Validates that the login authentication scheme is working First one should be authorized Rest should ...
Circuit data for an agent. Connection information shared between regions that accept UDP connections ...
void RemoveAgentCircuitTest()
Validate that removing the circuit code removes it appropriately
void AddAgentCircuitTest()
Validate that adding the circuit works appropriately
void ChangeAgentCircuitCodeTest()
Validate that changing the circuit code works