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.
This commit is contained in:
Justin Clark-Casey (justincc)
2010-03-05 00:54:46 +00:00
parent 8bd114b4df
commit e39fc95659
6 changed files with 31 additions and 24 deletions

View File

@@ -47,7 +47,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence
private bool m_Enabled = false;
private PresenceDetector m_PresenceDetector;
private IPresenceService m_PresenceService;
/// <summary>
/// Underlying presence service. Do not use directly.
/// </summary>
public IPresenceService m_PresenceService;
public LocalPresenceServicesConnector()
{

View File

@@ -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);
}
/// <summary>
@@ -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<string, string>();
p.Data["Online"] = true.ToString();
m_presenceData.Add(UUID.Zero, p);
*/
string user1 = UUID.Zero.ToString();
UUID session1 = UUID.Zero;