示例#1
0
        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;

            IConfigSource config = new IniConfigSource();
            config.AddConfig("Startup");
            config.Configs["Startup"].Set("EventQueue", "true");

            CapabilitiesModule capsModule = new CapabilitiesModule();
            EventQueueGetModule eqgModule = new EventQueueGetModule();

            m_scene = new SceneHelpers().SetupScene();
            SceneHelpers.SetupSceneModules(m_scene, config, capsModule, eqgModule);
        }
示例#2
0
        public void SetUp()
        {
            MainServer.Instance = new BaseHttpServer(9999, false, 9998, "");

            IConfigSource config = new IniConfigSource();
            config.AddConfig("Startup");
            config.Configs["Startup"].Set("EventQueue", "true");

            CapabilitiesModule capsModule = new CapabilitiesModule();
            EventQueueGetModule eqgModule = new EventQueueGetModule();

            m_scene = new SceneHelpers().SetupScene();
            SceneHelpers.SetupSceneModules(m_scene, config, capsModule, eqgModule);
        }
        public void TestChildAgentEstablishedInNeighbour()
        {
            TestHelpers.InMethod();
//            log4net.Config.XmlConfigurator.Configure();
            
//            UUID agent1Id = UUID.Parse("00000000-0000-0000-0000-000000000001");
            
            TestScene myScene1 = new SceneHelpers().SetupScene("Neighbour y", UUID.Random(), 1000, 1000);
            TestScene myScene2 = new SceneHelpers().SetupScene("Neighbour y + 1", UUID.Random(), 1001, 1000);

            IConfigSource configSource = new IniConfigSource();
            IConfig config = configSource.AddConfig("Startup");
            config.Set("serverside_object_permissions", true);
            config.Set("EventQueue", true);

            EntityTransferModule etm = new EntityTransferModule();

            EventQueueGetModule eqgm1 = new EventQueueGetModule();
            SceneHelpers.SetupSceneModules(myScene1, configSource, etm, eqgm1);

            EventQueueGetModule eqgm2 = new EventQueueGetModule();
            SceneHelpers.SetupSceneModules(myScene2, configSource, etm, eqgm2);
            
//            SceneHelpers.AddScenePresence(myScene1, agent1Id);
//            ScenePresence childPresence = myScene2.GetScenePresence(agent1);
//
//            // TODO: Need to do a fair amount of work to allow synchronous establishment of child agents
//            Assert.That(childPresence, Is.Not.Null);
//            Assert.That(childPresence.IsChildAgent, Is.True);
        }
        public void TestSendAgentGroupDataUpdate()
        {
            TestHelpers.InMethod();
//            TestHelpers.EnableLogging();
            
            TestScene scene = new SceneHelpers().SetupScene();
            IConfigSource configSource = new IniConfigSource();
            IConfig config = configSource.AddConfig("Groups");            
            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, 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.           
        }