29 using System.Collections.Generic;
31 using NUnit.Framework;
33 using OpenSim.Data.Null;
34 using OpenSim.Framework;
35 using OpenSim.Region.CoreModules.Avatar.Friends;
36 using OpenSim.Region.Framework.Scenes;
37 using OpenSim.Tests.Common;
51 Util.FireAndForgetMethod = FireAndForgetMethod.RegressionTest;
60 Util.FireAndForgetMethod = Util.DefaultFireAndForgetMethod;
69 NullFriendsData.Clear();
71 IConfigSource config =
new IniConfigSource();
72 config.AddConfig(
"Modules");
74 config.Configs[
"Modules"].Set(
"FriendsModule",
"FriendsModule");
75 config.AddConfig(
"Friends");
76 config.Configs[
"Friends"].Set(
"Connector",
"OpenSim.Services.FriendsService.dll");
77 config.AddConfig(
"FriendsService");
78 config.Configs[
"FriendsService"].Set(
"StorageProvider",
"OpenSim.Data.Null.dll");
82 SceneHelpers.SetupSceneModules(m_scene, config, m_fm);
88 TestHelpers.InMethod();
91 UUID userId = TestHelpers.ParseTail(0x1);
93 ScenePresence sp = SceneHelpers.AddScenePresence(m_scene, userId);
95 Assert.That(((
TestClient)sp.ControllingClient).ReceivedOfflineNotifications.Count, Is.EqualTo(0));
96 Assert.That(((
TestClient)sp.ControllingClient).ReceivedOnlineNotifications.Count, Is.EqualTo(0));
102 TestHelpers.InMethod();
105 UUID user1Id = TestHelpers.ParseTail(0x1);
106 UUID user2Id = TestHelpers.ParseTail(0x2);
113 ScenePresence sp1 = SceneHelpers.AddScenePresence(m_scene, user1Id);
114 ScenePresence sp2 = SceneHelpers.AddScenePresence(m_scene, user2Id);
116 m_fm.AddFriendship(sp1.ControllingClient, user2Id);
128 ScenePresence sp1Redux = SceneHelpers.AddScenePresence(m_scene, user1Id);
131 Assert.That(((
TestClient)sp1Redux.ControllingClient).ReceivedOfflineNotifications.Count, Is.EqualTo(0));
132 Assert.That(((
TestClient)sp1Redux.ControllingClient).ReceivedOnlineNotifications.Count, Is.EqualTo(0));
138 TestHelpers.InMethod();
141 UUID user1Id = TestHelpers.ParseTail(0x1);
142 UUID user2Id = TestHelpers.ParseTail(0x2);
149 ScenePresence sp1 = SceneHelpers.AddScenePresence(m_scene, user1Id);
150 ScenePresence sp2 = SceneHelpers.AddScenePresence(m_scene, user2Id);
152 m_fm.AddFriendship(sp1.ControllingClient, user2Id);
163 ScenePresence sp2Redux = SceneHelpers.AddScenePresence(m_scene, user2Id);
165 Assert.That(((
TestClient)sp2Redux.ControllingClient).ReceivedOfflineNotifications.Count, Is.EqualTo(0));
166 Assert.That(((
TestClient)sp2Redux.ControllingClient).ReceivedOnlineNotifications.Count, Is.EqualTo(1));
172 TestHelpers.InMethod();
175 UUID userId = TestHelpers.ParseTail(0x1);
176 UUID user2Id = TestHelpers.ParseTail(0x2);
178 ScenePresence sp = SceneHelpers.AddScenePresence(m_scene, userId);
179 SceneHelpers.AddScenePresence(m_scene, user2Id);
183 m_fm.AddFriendship(sp.ControllingClient, user2Id);
185 Assert.That(((
TestClient)sp.ControllingClient).ReceivedOfflineNotifications.Count, Is.EqualTo(0));
186 Assert.That(((
TestClient)sp.ControllingClient).ReceivedOnlineNotifications.Count, Is.EqualTo(1));
192 TestHelpers.InMethod();
195 UUID user1Id = TestHelpers.ParseTail(0x1);
196 UUID user2Id = TestHelpers.ParseTail(0x2);
198 ScenePresence sp = SceneHelpers.AddScenePresence(m_scene, user1Id);
199 SceneHelpers.AddScenePresence(m_scene, user2Id);
201 m_fm.AddFriendship(sp.ControllingClient, user2Id);
202 m_fm.RemoveFriendship(sp.ControllingClient, user2Id);
205 Assert.That(user1Client.ReceivedFriendshipTerminations.Count, Is.EqualTo(1));
206 Assert.That(user1Client.ReceivedFriendshipTerminations[0], Is.EqualTo(user2Id));
void TestLoginWithNoFriends()
void TestLoginWithOnlineFriends()
void TestAddFriendshipWhileOnline()
void TestRemoveFriendshipWhileOnline()
Helpers for setting up scenes.
Interactive OpenSim region server
void TestLoginWithOfflineFriends()