Esempio n. 1
0
        public void Init()
        {
            //AppDomain.CurrentDomain.SetData("APPBASE", Environment.CurrentDirectory + "/bin");
//            Console.WriteLine(AppDomain.CurrentDomain.BaseDirectory);
            m_xEngine = new XEngine();

            IniConfigSource configSource = new IniConfigSource();
            
            IConfig startupConfig = configSource.AddConfig("Startup");
            startupConfig.Set("DefaultScriptEngine", "XEngine");

            IConfig xEngineConfig = configSource.AddConfig("XEngine");
            xEngineConfig.Set("Enabled", "true");
            xEngineConfig.Set("StartDelay", "0");

            // These tests will not run with AppDomainLoading = true, at least on mono.  For unknown reasons, the call
            // to AssemblyResolver.OnAssemblyResolve fails.
            xEngineConfig.Set("AppDomainLoading", "false");

            m_scene = new SceneHelpers().SetupScene("My Test", UUID.Random(), 1000, 1000, configSource);
            SceneHelpers.SetupSceneModules(m_scene, configSource, m_xEngine);
            m_scene.StartScripts();
        }
        public void Init()
        {
            m_osChatMessageReceived = null;
            m_chatMessagesReceived = 0;
            m_chatMessagesThreshold = 0;
            m_chatEvent = new AutoResetEvent(false);
            m_stoppedEvent = new AutoResetEvent(false);

            //AppDomain.CurrentDomain.SetData("APPBASE", Environment.CurrentDirectory + "/bin");
//            Console.WriteLine(AppDomain.CurrentDomain.BaseDirectory);
            m_xEngine = new OpenSim.Region.ScriptEngine.XEngine.XEngine();
            m_xEngine.DebugLevel = 1;

            IniConfigSource configSource = new IniConfigSource();
            
            IConfig startupConfig = configSource.AddConfig("Startup");
            startupConfig.Set("DefaultScriptEngine", "XEngine");

            IConfig xEngineConfig = configSource.AddConfig("XEngine");
            xEngineConfig.Set("Enabled", "true");
            xEngineConfig.Set("StartDelay", "0");

            // These tests will not run with AppDomainLoading = true, at least on mono.  For unknown reasons, the call
            // to AssemblyResolver.OnAssemblyResolve fails.
            xEngineConfig.Set("AppDomainLoading", "false");

            xEngineConfig.Set("ScriptStopStrategy", "co-op");

            // Make sure loops aren't actually being terminated by a script delay wait.
            xEngineConfig.Set("ScriptDelayFactor", 0);

            // This is really just set for debugging the test.
            xEngineConfig.Set("WriteScriptSourceToDebugFile", true);

            // Set to false if we need to debug test so the old scripts don't get wiped before each separate test
//            xEngineConfig.Set("DeleteScriptsOnStartup", false);

            // This is not currently used at all for co-op termination.  Bumping up to demonstrate that co-op termination
            // has an effect - without it tests will fail due to a 120 second wait for the event to finish.
            xEngineConfig.Set("WaitForEventCompletionOnScriptStop", 120000);

            m_scene = new SceneHelpers().SetupScene("My Test", TestHelpers.ParseTail(0x9999), 1000, 1000, configSource);
            SceneHelpers.SetupSceneModules(m_scene, configSource, m_xEngine);
            m_scene.StartScripts();
        }