From e39fc95659a405a8500c9014d2ac31c5d85741d7 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 5 Mar 2010 00:54:46 +0000
Subject: Fix LocalPresenceServiceConnector test now that the hardcoded test
data has been removed from Data.Null.NullPresenceData Unfortunately, this
meant publicly exposing the underlying service for the connector. The other
solution would be to create alternative initializers for services and
connectors where objects could be given directly rather than loaded
indirectly through config. Unfortunately, this would require a lot of work in
this case but might be the better way forward.
---
.../Presence/LocalPresenceServiceConnector.cs | 6 +++++-
.../Presence/Tests/PresenceConnectorsTests.cs | 13 +++++++++++++
2 files changed, 18 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region/CoreModules')
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/LocalPresenceServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/LocalPresenceServiceConnector.cs
index d78daf9..c402a3f 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/LocalPresenceServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/LocalPresenceServiceConnector.cs
@@ -47,7 +47,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence
private bool m_Enabled = false;
private PresenceDetector m_PresenceDetector;
- private IPresenceService m_PresenceService;
+
+ ///
+ /// Underlying presence service. Do not use directly.
+ ///
+ public IPresenceService m_PresenceService;
public LocalPresenceServicesConnector()
{
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/Tests/PresenceConnectorsTests.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/Tests/PresenceConnectorsTests.cs
index ca42461..292ff8e 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/Tests/PresenceConnectorsTests.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/Tests/PresenceConnectorsTests.cs
@@ -59,6 +59,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence.Tests
config.Configs["PresenceService"].Set("StorageProvider", "OpenSim.Data.Null.dll");
m_LocalConnector = new LocalPresenceServicesConnector(config);
+
+ // Let's stick in a test presence
+ m_LocalConnector.m_PresenceService.LoginAgent(UUID.Zero.ToString(), UUID.Zero, UUID.Zero);
}
///
@@ -68,6 +71,16 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence.Tests
public void TestPresenceV0_1()
{
SetUp();
+
+ // Let's stick in a test presence
+ /*
+ PresenceData p = new PresenceData();
+ p.SessionID = UUID.Zero;
+ p.UserID = UUID.Zero.ToString();
+ p.Data = new Dictionary();
+ p.Data["Online"] = true.ToString();
+ m_presenceData.Add(UUID.Zero, p);
+ */
string user1 = UUID.Zero.ToString();
UUID session1 = UUID.Zero;
--
cgit v1.1