aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorRobert Adams2013-12-20 06:52:28 -0800
committerRobert Adams2013-12-20 06:52:28 -0800
commita01862509ee3317dde34ffb5cdbaf98672b510c3 (patch)
tree335fe6b6be7e796b33f11f3e939605ba28af1df3
parentMerge branch 'master' into varregion (diff)
parentMerge branch 'justincc-master' (diff)
downloadopensim-SC_OLD-a01862509ee3317dde34ffb5cdbaf98672b510c3.zip
opensim-SC_OLD-a01862509ee3317dde34ffb5cdbaf98672b510c3.tar.gz
opensim-SC_OLD-a01862509ee3317dde34ffb5cdbaf98672b510c3.tar.bz2
opensim-SC_OLD-a01862509ee3317dde34ffb5cdbaf98672b510c3.tar.xz
Merge branch 'master' into varregion
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs6
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs65
-rw-r--r--OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs3
-rw-r--r--prebuild.xml5
4 files changed, 71 insertions, 8 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
index c28ba94..0dbdbaf 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
@@ -295,9 +295,9 @@ namespace OpenSim.Region.ClientStack.Linden
295 { 295 {
296 // Register an event queue for the client 296 // Register an event queue for the client
297 297
298 //m_log.DebugFormat( 298 m_log.DebugFormat(
299 // "[EVENTQUEUE]: OnRegisterCaps: agentID {0} caps {1} region {2}", 299 "[EVENTQUEUE]: OnRegisterCaps: agentID {0} caps {1} region {2}",
300 // agentID, caps, m_scene.RegionInfo.RegionName); 300 agentID, caps, m_scene.RegionInfo.RegionName);
301 301
302 // Let's instantiate a Queue for this agent right now 302 // Let's instantiate a Queue for this agent right now
303 TryGetQueue(agentID); 303 TryGetQueue(agentID);
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs
index c1bdacb..26d2597 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs
@@ -26,13 +26,23 @@
26 */ 26 */
27 27
28using System; 28using System;
29using System.Collections;
30using System.Net;
29using System.Reflection; 31using System.Reflection;
30using Nini.Config; 32using Nini.Config;
31using NUnit.Framework; 33using NUnit.Framework;
32using OpenMetaverse; 34using OpenMetaverse;
35using OpenMetaverse.Messages.Linden;
36using OpenMetaverse.Packets;
37using OpenMetaverse.StructuredData;
33using OpenSim.Framework; 38using OpenSim.Framework;
34using OpenSim.Framework.Communications; 39using OpenSim.Framework.Communications;
40using OpenSim.Framework.Servers;
41using OpenSim.Framework.Servers.HttpServer;
42using OpenSim.Region.ClientStack.Linden;
43using OpenSim.Region.CoreModules.Framework;
35using OpenSim.Region.Framework.Scenes; 44using OpenSim.Region.Framework.Scenes;
45using OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups;
36using OpenSim.Tests.Common; 46using OpenSim.Tests.Common;
37using OpenSim.Tests.Common.Mock; 47using OpenSim.Tests.Common.Mock;
38 48
@@ -44,11 +54,28 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups.Tests
44 [TestFixture] 54 [TestFixture]
45 public class GroupsModuleTests : OpenSimTestCase 55 public class GroupsModuleTests : OpenSimTestCase
46 { 56 {
57 [SetUp]
58 public override void SetUp()
59 {
60 base.SetUp();
61
62 uint port = 9999;
63 uint sslPort = 9998;
64
65 // This is an unfortunate bit of clean up we have to do because MainServer manages things through static
66 // variables and the VM is not restarted between tests.
67 MainServer.RemoveHttpServer(port);
68
69 BaseHttpServer server = new BaseHttpServer(port, false, sslPort, "");
70 MainServer.AddHttpServer(server);
71 MainServer.Instance = server;
72 }
73
47 [Test] 74 [Test]
48 public void TestBasic() 75 public void TestSendAgentGroupDataUpdate()
49 { 76 {
50 TestHelpers.InMethod(); 77 TestHelpers.InMethod();
51// log4net.Config.XmlConfigurator.Configure(); 78// TestHelpers.EnableLogging();
52 79
53 TestScene scene = new SceneHelpers().SetupScene(); 80 TestScene scene = new SceneHelpers().SetupScene();
54 IConfigSource configSource = new IniConfigSource(); 81 IConfigSource configSource = new IniConfigSource();
@@ -56,8 +83,40 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups.Tests
56 config.Set("Enabled", true); 83 config.Set("Enabled", true);
57 config.Set("Module", "GroupsModule"); 84 config.Set("Module", "GroupsModule");
58 config.Set("DebugEnabled", true); 85 config.Set("DebugEnabled", true);
86
87 GroupsModule gm = new GroupsModule();
88 EventQueueGetModule eqgm = new EventQueueGetModule();
89
90 // We need a capabilities module active so that adding the scene presence creates an event queue in the
91 // EventQueueGetModule
59 SceneHelpers.SetupSceneModules( 92 SceneHelpers.SetupSceneModules(
60 scene, configSource, new object[] { new MockGroupsServicesConnector() }); 93 scene, configSource, gm, new MockGroupsServicesConnector(), new CapabilitiesModule(), eqgm);
94
95 ScenePresence sp = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseStem("1"));
96
97 gm.SendAgentGroupDataUpdate(sp.ControllingClient);
98
99 Hashtable eventsResponse = eqgm.GetEvents(UUID.Zero, sp.UUID);
100
101 Assert.That((int)eventsResponse["int_response_code"], Is.EqualTo((int)HttpStatusCode.OK));
102
103// Console.WriteLine("Response [{0}]", (string)eventsResponse["str_response_string"]);
104
105 OSDMap rawOsd = (OSDMap)OSDParser.DeserializeLLSDXml((string)eventsResponse["str_response_string"]);
106 OSDArray eventsOsd = (OSDArray)rawOsd["events"];
107
108 bool foundUpdate = false;
109 foreach (OSD osd in eventsOsd)
110 {
111 OSDMap eventOsd = (OSDMap)osd;
112
113 if (eventOsd["message"] == "AgentGroupDataUpdate")
114 foundUpdate = true;
115 }
116
117 Assert.That(foundUpdate, Is.True, "Did not find AgentGroupDataUpdate in response");
118
119 // TODO: More checking of more actual event data.
61 } 120 }
62 } 121 }
63} \ No newline at end of file 122} \ No newline at end of file
diff --git a/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs b/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs
index 6707019..e666433 100644
--- a/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs
+++ b/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs
@@ -38,6 +38,7 @@ using OpenMetaverse;
38using OpenMetaverse.StructuredData; 38using OpenMetaverse.StructuredData;
39using OpenSim.Framework; 39using OpenSim.Framework;
40using OpenSim.Framework.Servers; 40using OpenSim.Framework.Servers;
41using OpenSim.Region.ClientStack.Linden;
41using OpenSim.Region.Framework.Interfaces; 42using OpenSim.Region.Framework.Interfaces;
42using OpenSim.Region.Framework.Scenes; 43using OpenSim.Region.Framework.Scenes;
43 44
@@ -164,7 +165,7 @@ namespace OpenSim.Tests.Common
164 throw new System.NotImplementedException (); 165 throw new System.NotImplementedException ();
165 } 166 }
166 167
167 public OSD BuildEvent (string eventName, OSD eventBody) 168 public OSD BuildEvent(string eventName, OSD eventBody)
168 { 169 {
169 Console.WriteLine("TWO"); 170 Console.WriteLine("TWO");
170 throw new System.NotImplementedException (); 171 throw new System.NotImplementedException ();
diff --git a/prebuild.xml b/prebuild.xml
index f6e0f4b..5b18195 100644
--- a/prebuild.xml
+++ b/prebuild.xml
@@ -2839,8 +2839,9 @@
2839 <Reference name="OpenSim.Framework.Console"/> 2839 <Reference name="OpenSim.Framework.Console"/>
2840 <Reference name="OpenSim.Framework.Servers"/> 2840 <Reference name="OpenSim.Framework.Servers"/>
2841 <Reference name="OpenSim.Framework.Servers.HttpServer"/> 2841 <Reference name="OpenSim.Framework.Servers.HttpServer"/>
2842 <Reference name="OpenSim.Region.Framework"/>
2843 <Reference name="OpenSim.Region.CoreModules"/> 2842 <Reference name="OpenSim.Region.CoreModules"/>
2843 <Reference name="OpenSim.Region.ClientStack.LindenCaps"/>
2844 <Reference name="OpenSim.Region.Framework"/>
2844 <Reference name="OpenSim.Region.OptionalModules"/> 2845 <Reference name="OpenSim.Region.OptionalModules"/>
2845 <Reference name="OpenSim.Region.Physics.Manager"/> 2846 <Reference name="OpenSim.Region.Physics.Manager"/>
2846 <Reference name="OpenSim.Region.ScriptEngine.Shared"/> 2847 <Reference name="OpenSim.Region.ScriptEngine.Shared"/>
@@ -3200,6 +3201,7 @@
3200 <Reference name="System.Drawing"/> 3201 <Reference name="System.Drawing"/>
3201 <Reference name="OpenMetaverseTypes" path="../../../bin/"/> 3202 <Reference name="OpenMetaverseTypes" path="../../../bin/"/>
3202 <Reference name="OpenMetaverse" path="../../../bin/"/> 3203 <Reference name="OpenMetaverse" path="../../../bin/"/>
3204 <Reference name="OpenMetaverse.StructuredData" path="../../../bin/"/>
3203 <Reference name="OpenSim.Data"/> 3205 <Reference name="OpenSim.Data"/>
3204 <Reference name="OpenSim.Framework"/> 3206 <Reference name="OpenSim.Framework"/>
3205 <Reference name="OpenSim.Framework.Serialization"/> 3207 <Reference name="OpenSim.Framework.Serialization"/>
@@ -3208,6 +3210,7 @@
3208 <Reference name="OpenSim.Framework.Monitoring"/> 3210 <Reference name="OpenSim.Framework.Monitoring"/>
3209 <Reference name="OpenSim.Framework.Servers"/> 3211 <Reference name="OpenSim.Framework.Servers"/>
3210 <Reference name="OpenSim.Framework.Servers.HttpServer"/> 3212 <Reference name="OpenSim.Framework.Servers.HttpServer"/>
3213 <Reference name="OpenSim.Region.ClientStack.LindenCaps"/>
3211 <Reference name="OpenSim.Region.Framework"/> 3214 <Reference name="OpenSim.Region.Framework"/>
3212 <Reference name="OpenSim.Region.CoreModules"/> 3215 <Reference name="OpenSim.Region.CoreModules"/>
3213 <Reference name="OpenSim.Region.OptionalModules"/> 3216 <Reference name="OpenSim.Region.OptionalModules"/>