public void TestRemoveConnection() { UUID agentId = UUID.Random(); UUID sessionId = UUID.Random(); uint circuitCode = 5; OpenSim.Region.Framework.AvatarTransit.AvatarTransitController transitCont = new Framework.AvatarTransit.AvatarTransitController(null); AvatarConnectionManager mgr = new AvatarConnectionManager(new MockCapsModule(), transitCont); var conn = mgr.NewConnection(new AgentCircuitData { AgentID = agentId, SessionID = sessionId, CircuitCode = circuitCode }, EstablishedBy.Login); var clientApi = new MockClientAPI(); clientApi.SessionId = sessionId; clientApi.AgentId = agentId; clientApi.CircuitCode = circuitCode; conn.AttachUdpCircuit(clientApi); conn.Terminate(false); Assert.IsNull(mgr.GetConnection(agentId)); }
public void TestConnectionManagerAllowsSingleUserInstance() { UUID agentId = UUID.Random(); OpenSim.Region.Framework.AvatarTransit.AvatarTransitController transitCont = new Framework.AvatarTransit.AvatarTransitController(null); AvatarConnectionManager mgr = new AvatarConnectionManager(new MockCapsModule(), transitCont); mgr.NewConnection(new AgentCircuitData { AgentID = agentId }, EstablishedBy.Login); Assert.Throws<ConnectionAlreadyEstablishedException>(() => mgr.NewConnection(new AgentCircuitData { AgentID = agentId }, EstablishedBy.Login)); }
public void TestAuthorized() { UUID agentId = UUID.Random(); UUID sessionId = UUID.Random(); uint circuitCode = 5; OpenSim.Region.Framework.AvatarTransit.AvatarTransitController transitCont = new Framework.AvatarTransit.AvatarTransitController(null); AvatarConnectionManager mgr = new AvatarConnectionManager(new MockCapsModule(), transitCont); mgr.NewConnection(new AgentCircuitData { AgentID = agentId, SessionID = sessionId, CircuitCode = circuitCode }, EstablishedBy.Login); Assert.IsTrue(mgr.IsAuthorized(agentId, sessionId, circuitCode)); }
public void TestAuthorized() { UUID agentId = UUID.Random(); UUID sessionId = UUID.Random(); uint circuitCode = 5; OpenSim.Region.Framework.AvatarTransit.AvatarTransitController transitCont = new Framework.AvatarTransit.AvatarTransitController(null); AvatarConnectionManager mgr = new AvatarConnectionManager(new MockCapsModule(), transitCont); mgr.NewConnection(new AgentCircuitData { AgentID = agentId, SessionID = sessionId, CircuitCode = circuitCode }, EstablishedBy.Login); Assert.IsTrue(mgr.IsAuthorized(agentId, sessionId, circuitCode)); }
public void TestConnectionManagerAllowsSingleUserInstance() { UUID agentId = UUID.Random(); OpenSim.Region.Framework.AvatarTransit.AvatarTransitController transitCont = new Framework.AvatarTransit.AvatarTransitController(null); AvatarConnectionManager mgr = new AvatarConnectionManager(new MockCapsModule(), transitCont); mgr.NewConnection(new AgentCircuitData { AgentID = agentId }, EstablishedBy.Login); Assert.Throws <ConnectionAlreadyEstablishedException>(() => mgr.NewConnection(new AgentCircuitData { AgentID = agentId }, EstablishedBy.Login)); }
public void TestRemoveConnection() { UUID agentId = UUID.Random(); UUID sessionId = UUID.Random(); uint circuitCode = 5; OpenSim.Region.Framework.AvatarTransit.AvatarTransitController transitCont = new Framework.AvatarTransit.AvatarTransitController(null); AvatarConnectionManager mgr = new AvatarConnectionManager(new MockCapsModule(), transitCont); var conn = mgr.NewConnection(new AgentCircuitData { AgentID = agentId, SessionID = sessionId, CircuitCode = circuitCode }, EstablishedBy.Login); var clientApi = new MockClientAPI(); clientApi.SessionId = sessionId; clientApi.AgentId = agentId; clientApi.CircuitCode = circuitCode; conn.AttachUdpCircuit(clientApi); conn.Terminate(false); Assert.IsNull(mgr.GetConnection(agentId)); }