29 using System.Collections.Generic;
31 using System.Reflection;
32 using System.Threading;
34 using NUnit.Framework;
36 using OpenSim.Framework;
38 using OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence;
39 using OpenSim.Region.Framework.Scenes;
41 using OpenSim.Tests.Common;
43 namespace OpenSim.
Region.CoreModules.ServiceConnectorsOut.Presence.Tests
54 IConfigSource config =
new IniConfigSource();
55 config.AddConfig(
"Modules");
56 config.AddConfig(
"PresenceService");
57 config.Configs[
"Modules"].Set(
"PresenceServices",
"LocalPresenceServicesConnector");
58 config.Configs[
"PresenceService"].Set(
"LocalServiceModule",
"OpenSim.Services.PresenceService.dll:PresenceService");
59 config.Configs[
"PresenceService"].Set(
"StorageProvider",
"OpenSim.Data.Null.dll");
62 m_LocalConnector.Initialise(config);
65 m_LocalConnector.m_PresenceService.LoginAgent(UUID.Zero.ToString(), UUID.Zero, UUID.Zero);
86 string user1 = UUID.Zero.ToString();
87 UUID session1 = UUID.Zero;
91 PresenceInfo result = m_LocalConnector.GetAgent(session1);
92 Assert.IsNotNull(result,
"Retrieved GetAgent is null");
93 Assert.That(result.UserID, Is.EqualTo(user1),
"Retrieved userID does not match");
95 UUID region1 = UUID.Random();
96 bool r = m_LocalConnector.ReportAgent(session1, region1);
97 Assert.IsTrue(r,
"First ReportAgent returned false");
98 result = m_LocalConnector.GetAgent(session1);
99 Assert.That(result.RegionID, Is.EqualTo(region1),
"Agent is not in the right region (region1)");
101 UUID region2 = UUID.Random();
102 r = m_LocalConnector.ReportAgent(session1, region2);
103 Assert.IsTrue(r,
"Second ReportAgent returned false");
104 result = m_LocalConnector.GetAgent(session1);
105 Assert.That(result.RegionID, Is.EqualTo(region2),
"Agent is not in the right region (region2)");
107 r = m_LocalConnector.LogoutAgent(session1);
108 Assert.IsTrue(r,
"LogoutAgent returned false");
109 result = m_LocalConnector.GetAgent(session1);
110 Assert.IsNull(result,
"Agent session is still stored after logout");
112 r = m_LocalConnector.ReportAgent(session1, region1);
113 Assert.IsFalse(r,
"ReportAgent of non-logged in user returned true");
void TestPresenceV0_1()
Test OpenSim Presence.
Interactive OpenSim region server
OpenSim.Services.Interfaces.PresenceInfo PresenceInfo
OpenSim.Services.Interfaces.PresenceInfo PresenceInfo