Intermediate commit. Sill errors.

Merge branch 'master' into careminster

Conflicts:
	OpenSim/Data/SQLite/SQLiteUserProfilesData.cs
	OpenSim/Framework/RegionInfo.cs
	OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs
	OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
	OpenSim/Services/UserProfilesService/UserProfilesService.cs
This commit is contained in:
Melanie
2014-01-05 20:12:32 +00:00
36 changed files with 11432 additions and 9480 deletions

View File

@@ -26,13 +26,23 @@
*/
using System;
using System.Collections;
using System.Net;
using System.Reflection;
using Nini.Config;
using NUnit.Framework;
using OpenMetaverse;
using OpenMetaverse.Messages.Linden;
using OpenMetaverse.Packets;
using OpenMetaverse.StructuredData;
using OpenSim.Framework;
using OpenSim.Framework.Communications;
using OpenSim.Framework.Servers;
using OpenSim.Framework.Servers.HttpServer;
using OpenSim.Region.ClientStack.Linden;
using OpenSim.Region.CoreModules.Framework;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups;
using OpenSim.Tests.Common;
using OpenSim.Tests.Common.Mock;
@@ -44,11 +54,28 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups.Tests
[TestFixture]
public class GroupsModuleTests : OpenSimTestCase
{
[SetUp]
public override void SetUp()
{
base.SetUp();
uint port = 9999;
uint sslPort = 9998;
// This is an unfortunate bit of clean up we have to do because MainServer manages things through static
// variables and the VM is not restarted between tests.
MainServer.RemoveHttpServer(port);
BaseHttpServer server = new BaseHttpServer(port, false, sslPort, "");
MainServer.AddHttpServer(server);
MainServer.Instance = server;
}
[Test]
public void TestBasic()
public void TestSendAgentGroupDataUpdate()
{
TestHelpers.InMethod();
// log4net.Config.XmlConfigurator.Configure();
// TestHelpers.EnableLogging();
TestScene scene = new SceneHelpers().SetupScene();
IConfigSource configSource = new IniConfigSource();
@@ -56,8 +83,40 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups.Tests
config.Set("Enabled", true);
config.Set("Module", "GroupsModule");
config.Set("DebugEnabled", true);
GroupsModule gm = new GroupsModule();
EventQueueGetModule eqgm = new EventQueueGetModule();
// We need a capabilities module active so that adding the scene presence creates an event queue in the
// EventQueueGetModule
SceneHelpers.SetupSceneModules(
scene, configSource, new object[] { new MockGroupsServicesConnector() });
scene, configSource, gm, new MockGroupsServicesConnector(), new CapabilitiesModule(), eqgm);
ScenePresence sp = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseStem("1"));
gm.SendAgentGroupDataUpdate(sp.ControllingClient);
Hashtable eventsResponse = eqgm.GetEvents(UUID.Zero, sp.UUID);
Assert.That((int)eventsResponse["int_response_code"], Is.EqualTo((int)HttpStatusCode.OK));
// Console.WriteLine("Response [{0}]", (string)eventsResponse["str_response_string"]);
OSDMap rawOsd = (OSDMap)OSDParser.DeserializeLLSDXml((string)eventsResponse["str_response_string"]);
OSDArray eventsOsd = (OSDArray)rawOsd["events"];
bool foundUpdate = false;
foreach (OSD osd in eventsOsd)
{
OSDMap eventOsd = (OSDMap)osd;
if (eventOsd["message"] == "AgentGroupDataUpdate")
foundUpdate = true;
}
Assert.That(foundUpdate, Is.True, "Did not find AgentGroupDataUpdate in response");
// TODO: More checking of more actual event data.
}
}
}

View File

@@ -216,9 +216,11 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
// m_log.InfoFormat("[RegionReady]: Logins enabled for {0}, Oar {1}",
// m_scene.RegionInfo.RegionName, m_oarFileLoading.ToString());
// Warn level because the region cannot be used while logins are disabled
m_log.WarnFormat(
"[RegionReady]: INITIALIZATION COMPLETE FOR {0} - LOGINS ENABLED", m_scene.Name);
// Putting this out to console to make it eye-catching for people who are running OpenSimulator
// without info log messages enabled. Making this a warning is arguably misleading since it isn't a
// warning, and monitor scripts looking for warn/error/fatal messages will received false positives.
// Arguably, log4net needs a status log level (like Apache).
MainConsole.Instance.OutputFormat("INITIALIZATION COMPLETE FOR {0} - LOGINS ENABLED", m_scene.Name);
}
m_scene.SceneGridService.InformNeighborsThatRegionisUp(

View File

@@ -321,9 +321,9 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests
Assert.That(part.SitTargetAvatar, Is.EqualTo(npcId));
Assert.That(npc.ParentID, Is.EqualTo(part.LocalId));
Assert.That(
npc.AbsolutePosition,
Is.EqualTo(part.AbsolutePosition + part.SitTargetPosition + ScenePresence.SIT_TARGET_ADJUSTMENT));
// Assert.That(
// npc.AbsolutePosition,
// Is.EqualTo(part.AbsolutePosition + part.SitTargetPosition + ScenePresence.SIT_TARGET_ADJUSTMENT));
m_npcMod.Stand(npc.UUID, m_scene);
@@ -335,7 +335,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests
public void TestSitAndStandWithNoSitTarget()
{
TestHelpers.InMethod();
// log4net.Config.XmlConfigurator.Configure();
// TestHelpers.EnableLogging();
ScenePresence sp = SceneHelpers.AddScenePresence(m_scene, TestHelpers.ParseTail(0x1));
@@ -353,13 +353,11 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests
Assert.That(part.SitTargetAvatar, Is.EqualTo(UUID.Zero));
Assert.That(npc.ParentID, Is.EqualTo(part.LocalId));
// FIXME: This is different for live avatars - z position is adjusted. This is half the height of the
// default avatar.
// Curiously, Vector3.ToString() will not display the last two places of the float. For example,
// printing out npc.AbsolutePosition will give <0, 0, 0.8454993> not <0, 0, 0.845499337>
// We should really be using the NPC size but this would mean preserving the physics actor since it is
// removed on sit.
Assert.That(
npc.AbsolutePosition,
Is.EqualTo(part.AbsolutePosition + new Vector3(0, 0, 0.845499337f)));
Is.EqualTo(part.AbsolutePosition + new Vector3(0, 0, sp.PhysicsActor.Size.Z / 2)));
m_npcMod.Stand(npc.UUID, m_scene);