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.
slimupdates
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

@ -51,15 +51,6 @@ namespace OpenSim.Data.Null
Instance = this;
//Console.WriteLine("[XXX] NullRegionData constructor");
// 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);
*/
}
}

View File

@ -1,11 +1,15 @@
using System;
using System.Collections.Generic;
using System.Reflection;
using log4net;
using OpenMetaverse;
namespace OpenSim.Framework
{
public static class SLUtil
{
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
#region SL / file extension / content-type conversions
public static string SLAssetTypeToContentType(int assetType)
@ -190,7 +194,12 @@ namespace OpenSim.Framework
/// <returns></returns>
public static string ParseNotecardToString(string rawInput)
{
return string.Join("\n", ParseNotecardToList(rawInput).ToArray());
string[] output = ParseNotecardToList(rawInput).ToArray();
// foreach (string line in output)
// m_log.DebugFormat("[PARSE NOTECARD]: ParseNotecardToString got line {0}", line);
return string.Join("\n", output);
}
/// <summary>
@ -254,6 +263,7 @@ namespace OpenSim.Framework
if (ln.Length > need)
ln = ln.Substring(0, need);
// m_log.DebugFormat("[PARSE NOTECARD]: Adding line {0}", ln);
output.Add(ln);
count += ln.Length + 1;
idx++;

View File

@ -42,6 +42,8 @@ namespace OpenSim
/// </summary>
public class ConfigurationLoader
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
/// <summary>
/// Various Config settings the region needs to start
/// Physics Engine, Mesh Engine, GridMode, PhysicsPrim allowed, Neighbor,
@ -60,17 +62,6 @@ namespace OpenSim
/// </summary>
protected NetworkServersInfo m_networkServersInfo;
/// <summary>
/// Console logger
/// </summary>
private static readonly ILog m_log =
LogManager.GetLogger(
MethodBase.GetCurrentMethod().DeclaringType);
public ConfigurationLoader()
{
}
/// <summary>
/// Loads the region configuration
/// </summary>
@ -188,7 +179,6 @@ namespace OpenSim
}
// Make sure command line options take precedence
//
m_config.Source.Merge(argvSource);
ReadConfigSettings();

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;

View File

@ -52,7 +52,6 @@ using OpenSim.Region.ScriptEngine.Shared.ScriptBase;
using OpenSim.Region.ScriptEngine.Interfaces;
using OpenSim.Region.ScriptEngine.Shared.Api.Interfaces;
using OpenSim.Services.Interfaces;
using OpenSim.Services.Interfaces;
using GridRegion = OpenSim.Services.Interfaces.GridRegion;
using PresenceInfo = OpenSim.Services.Interfaces.PresenceInfo;
using PrimType = OpenSim.Region.Framework.Scenes.PrimType;