public AssetInventoryServer(IConfigSource config) { ConfigFile = config; m_console = new LocalConsole("AssetInventory"); MainConsole.Instance = m_console; }
/// <summary> /// Performs initialisation of the scene, such as loading configuration from disk. /// </summary> protected override void StartupSpecific() { m_log.Info("===================================================================="); m_log.Info("========================= STARTING OPENSIM ========================="); m_log.Info("===================================================================="); m_log.InfoFormat("[OPENSIM MAIN]: Running "); //m_log.InfoFormat("[OPENSIM MAIN]: GC Is Server GC: {0}", GCSettings.IsServerGC.ToString()); // http://msdn.microsoft.com/en-us/library/bb384202.aspx //GCSettings.LatencyMode = GCLatencyMode.Batch; //m_log.InfoFormat("[OPENSIM MAIN]: GC Latency Mode: {0}", GCSettings.LatencyMode.ToString()); if (m_gui) // Driven by external GUI m_console = new CommandConsole("Region"); else { switch (m_consoleType) { case "basic": m_console = new CommandConsole("Region"); break; case "rest": m_console = new RemoteConsole("Region"); ((RemoteConsole)m_console).ReadConfig(m_config.Source); break; default: m_console = new LocalConsole("Region"); break; } } MainConsole.Instance = m_console; RegisterConsoleCommands(); base.StartupSpecific(); MainServer.Instance.AddStreamHandler(new OpenSim.SimStatusHandler()); MainServer.Instance.AddStreamHandler(new OpenSim.XSimStatusHandler(this)); if (userStatsURI != String.Empty) MainServer.Instance.AddStreamHandler(new OpenSim.UXSimStatusHandler(this)); if (m_console is RemoteConsole) { if (m_consolePort == 0) { ((RemoteConsole)m_console).SetServer(m_httpServer); } else { ((RemoteConsole)m_console).SetServer(MainServer.GetHttpServer(m_consolePort)); } } //Run Startup Commands if (String.IsNullOrEmpty(m_startupCommandsFile)) { m_log.Info("[STARTUP]: No startup command script specified. Moving on..."); } else { RunCommandScript(m_startupCommandsFile); } // Start timer script (run a script every xx seconds) if (m_timedScript != "disabled") { m_scriptTimer = new Timer(); m_scriptTimer.Enabled = true; m_scriptTimer.Interval = 1200*1000; m_scriptTimer.Elapsed += RunAutoTimerScript; } // Hook up to the watchdog timer Watchdog.OnWatchdogTimeout += WatchdogTimeoutHandler; PrintFileToConsole("startuplogo.txt"); // For now, start at the 'root' level by default if (m_sceneManager.Scenes.Count == 1) // If there is only one region, select it ChangeSelectedRegion("region", new string[] {"change", "region", m_sceneManager.Scenes[0].RegionInfo.RegionName}); else ChangeSelectedRegion("region", new string[] {"change", "region", "root"}); }
public MoneyServerBase() { m_console = new LocalConsole("Money "); MainConsole.Instance = m_console; }
/// <summary> /// Performs initialisation of the scene, such as loading configuration from disk. /// </summary> protected override void StartupSpecific() { m_log.Info("===================================================================="); m_log.Info("========================= STARTING OPENSIM ========================="); m_log.Info("===================================================================="); m_log.InfoFormat("[OPENSIM MAIN]: Running in {0} mode", (ConfigurationSettings.Standalone ? "sandbox" : "grid")); //m_log.InfoFormat("[OPENSIM MAIN]: GC Is Server GC: {0}", GCSettings.IsServerGC.ToString()); // http://msdn.microsoft.com/en-us/library/bb384202.aspx //GCSettings.LatencyMode = GCLatencyMode.Batch; //m_log.InfoFormat("[OPENSIM MAIN]: GC Latency Mode: {0}", GCSettings.LatencyMode.ToString()); if (m_gui) // Driven by external GUI m_console = new CommandConsole("Region"); else m_console = new LocalConsole("Region"); MainConsole.Instance = m_console; RegisterConsoleCommands(); base.StartupSpecific(); //Run Startup Commands if (String.IsNullOrEmpty(m_startupCommandsFile)) { m_log.Info("[STARTUP]: No startup command script specified. Moving on..."); } else { RunCommandScript(m_startupCommandsFile); } // Start timer script (run a script every xx seconds) if (m_timedScript != "disabled") { m_scriptTimer = new Timer(); m_scriptTimer.Enabled = true; m_scriptTimer.Interval = 1200*1000; m_scriptTimer.Elapsed += RunAutoTimerScript; } PrintFileToConsole("startuplogo.txt"); // For now, start at the 'root' level by default if (m_sceneManager.Scenes.Count == 1) // If there is only one region, select it ChangeSelectedRegion("region", new string[] {"change", "region", m_sceneManager.Scenes[0].RegionInfo.RegionName}); else ChangeSelectedRegion("region", new string[] {"change", "region", "root"}); }
public OpenMessage_Main() { m_console = new LocalConsole("Messaging"); MainConsole.Instance = m_console; }
/// <summary> /// Performs initialisation of the scene, such as loading configuration from disk. /// </summary> protected override void StartupSpecific() { m_log.Info("===================================================================="); m_log.Info("========================= STARTING OPENSIM ========================="); m_log.Info("===================================================================="); //m_log.InfoFormat("[OPENSIM MAIN]: GC Is Server GC: {0}", GCSettings.IsServerGC.ToString()); // http://msdn.microsoft.com/en-us/library/bb384202.aspx //GCSettings.LatencyMode = GCLatencyMode.Batch; //m_log.InfoFormat("[OPENSIM MAIN]: GC Latency Mode: {0}", GCSettings.LatencyMode.ToString()); if (m_gui) // Driven by external GUI { m_console = new CommandConsole("Region"); } else { switch (m_consoleType) { case "basic": m_console = new CommandConsole("Region"); break; case "rest": m_console = new RemoteConsole("Region"); ((RemoteConsole)m_console).ReadConfig(Config); break; default: m_console = new LocalConsole("Region"); break; } } MainConsole.Instance = m_console; RegisterCommonAppenders(Config.Configs["Startup"]); RegisterConsoleCommands(); base.StartupSpecific(); MainServer.Instance.AddStreamHandler(new OpenSim.SimStatusHandler()); MainServer.Instance.AddStreamHandler(new OpenSim.XSimStatusHandler(this)); if (userStatsURI != String.Empty) { MainServer.Instance.AddStreamHandler(new OpenSim.UXSimStatusHandler(this)); } if (m_console is RemoteConsole) { if (m_consolePort == 0) { ((RemoteConsole)m_console).SetServer(m_httpServer); } else { ((RemoteConsole)m_console).SetServer(MainServer.GetHttpServer(m_consolePort)); } } // Hook up to the watchdog timer Watchdog.OnWatchdogTimeout += WatchdogTimeoutHandler; PrintFileToConsole("startuplogo.txt"); // For now, start at the 'root' level by default if (SceneManager.Scenes.Count == 1) // If there is only one region, select it { ChangeSelectedRegion("region", new string[] { "change", "region", SceneManager.Scenes[0].RegionInfo.RegionName }); } else { ChangeSelectedRegion("region", new string[] { "change", "region", "root" }); } //Run Startup Commands if (String.IsNullOrEmpty(m_startupCommandsFile)) { m_log.Info("[STARTUP]: No startup command script specified. Moving on..."); } else { RunCommandScript(m_startupCommandsFile); } // Start timer script (run a script every xx seconds) if (m_timedScript != "disabled") { m_scriptTimer = new Timer(); m_scriptTimer.Enabled = true; m_scriptTimer.Interval = m_timeInterval * 1000; m_scriptTimer.Elapsed += RunAutoTimerScript; } }
UnitTestResult RunWithConsoleRunner(ProcessExecutionCommand cmd, UnitTest test, string suiteName, string pathName, string testName, TestContext testContext) { var outFile = Path.GetTempFileName(); LocalConsole cons = new LocalConsole(); try { MonoDevelop.NUnit.External.TcpTestListener tcpListener = null; LocalTestMonitor localMonitor = new LocalTestMonitor(testContext, test, suiteName, testName != null); if (!string.IsNullOrEmpty(cmd.Arguments)) { cmd.Arguments += " "; } cmd.Arguments += "\"-xml=" + outFile + "\" " + AssemblyPath; bool automaticUpdates = cmd.Command != null && (cmd.Command.Contains("GuiUnit") || (cmd.Command.Contains("mdtool.exe") && cmd.Arguments.Contains("run-md-tests"))); if (!string.IsNullOrEmpty(pathName)) { cmd.Arguments += " -run=" + test.TestId; } if (automaticUpdates) { tcpListener = new MonoDevelop.NUnit.External.TcpTestListener(localMonitor, suiteName); cmd.Arguments += " -port=" + tcpListener.Port; } // Note that we always dispose the tcp listener as we don't want it listening // forever if the test runner does not try to connect to it using (tcpListener) { var p = testContext.ExecutionContext.Execute(cmd, cons); testContext.Monitor.CancelRequested += p.Cancel; if (testContext.Monitor.IsCancelRequested) { p.Cancel(); } p.WaitForCompleted(); if (new FileInfo(outFile).Length == 0) { throw new Exception("Command failed"); } } // mdtool.exe does not necessarily guarantee we get automatic updates. It just guarantees // that if guiunit is being used then it will give us updates. If you have a regular test // assembly compiled against nunit.framework.dll if (automaticUpdates && tcpListener.HasReceivedConnection) { if (testName != null) { return(localMonitor.SingleTestResult); } return(test.GetLastResult()); } XDocument doc = XDocument.Load(outFile); if (doc.Root != null) { var root = doc.Root.Elements("test-suite").FirstOrDefault(); if (root != null) { cons.SetDone(); var ot = cons.Out.ReadToEnd(); var et = cons.Error.ReadToEnd(); testContext.Monitor.WriteGlobalLog(ot); if (!string.IsNullOrEmpty(et)) { testContext.Monitor.WriteGlobalLog("ERROR:\n"); testContext.Monitor.WriteGlobalLog(et); } bool macunitStyle = doc.Root.Element("environment") != null && doc.Root.Element("environment").Attribute("macunit-version") != null; var result = ReportXmlResult(localMonitor, root, "", macunitStyle); if (testName != null) { result = localMonitor.SingleTestResult; } return(result); } } throw new Exception("Test results could not be parsed."); } catch (Exception ex) { cons.SetDone(); var ot = cons.Out.ReadToEnd(); var et = cons.Error.ReadToEnd(); testContext.Monitor.WriteGlobalLog(ot); if (!string.IsNullOrEmpty(et)) { testContext.Monitor.WriteGlobalLog("ERROR:\n"); testContext.Monitor.WriteGlobalLog(et); } testContext.Monitor.ReportRuntimeError("Test execution failed.\n" + ot + "\n" + et, ex); return(UnitTestResult.CreateIgnored("Test execution failed")); } finally { File.Delete(outFile); } }
public OpenUser_Main() { m_console = new LocalConsole("User"); MainConsole.Instance = m_console; }
public MoneyServerBase() { m_console = new LocalConsole("Money "); // m_console = new CommandConsole("Money "); MainConsole.Instance = m_console; }
UnitTestResult RunWithConsoleRunner(ProcessExecutionCommand cmd, UnitTest test, string suiteName, string pathName, string testName, TestContext testContext) { var outFile = Path.GetTempFileName(); LocalConsole cons = new LocalConsole(); try { LocalTestMonitor localMonitor = new LocalTestMonitor(testContext, test, suiteName, testName != null); if (!string.IsNullOrEmpty(cmd.Arguments)) { cmd.Arguments += " "; } cmd.Arguments += "\"-xml=" + outFile + "\" " + AssemblyPath; bool automaticUpdates = cmd.Command.Contains("GuiUnit") || (cmd.Command.Contains("mdtool.exe") && cmd.Arguments.Contains("run-md-tests")); if (!string.IsNullOrEmpty(testName)) { cmd.Arguments += " -run=" + suiteName + "." + testName; } else if (!string.IsNullOrEmpty(suiteName)) { cmd.Arguments += " -run=" + suiteName; } if (automaticUpdates) { var tcpListener = new MonoDevelop.NUnit.External.TcpTestListener(localMonitor); cmd.Arguments += " -port=" + tcpListener.Port; } var p = testContext.ExecutionContext.Execute(cmd, cons); testContext.Monitor.CancelRequested += p.Cancel; if (testContext.Monitor.IsCancelRequested) { p.Cancel(); } p.WaitForCompleted(); if (new FileInfo(outFile).Length == 0) { throw new Exception("Command failed"); } XDocument doc = XDocument.Load(outFile); if (doc.Root != null) { if (automaticUpdates) { DispatchService.GuiDispatch(delegate { testContext.ResultsPad.InitializeTestRun(test); }); } var root = doc.Root.Elements("test-suite").FirstOrDefault(); if (root != null) { cons.SetDone(); var ot = cons.Out.ReadToEnd(); var et = cons.Error.ReadToEnd(); testContext.Monitor.WriteGlobalLog(ot); if (!string.IsNullOrEmpty(et)) { testContext.Monitor.WriteGlobalLog("ERROR:\n"); testContext.Monitor.WriteGlobalLog(et); } bool macunitStyle = doc.Root.Element("environment") != null && doc.Root.Element("environment").Attribute("macunit-version") != null; return(ReportXmlResult(localMonitor, root, "", macunitStyle)); } } throw new Exception("Test results could not be parsed."); } catch (Exception ex) { cons.SetDone(); var ot = cons.Out.ReadToEnd(); var et = cons.Error.ReadToEnd(); testContext.Monitor.WriteGlobalLog(ot); if (!string.IsNullOrEmpty(et)) { testContext.Monitor.WriteGlobalLog("ERROR:\n"); testContext.Monitor.WriteGlobalLog(et); } testContext.Monitor.ReportRuntimeError("Test execution failed.\n" + ot + "\n" + et, ex); return(UnitTestResult.CreateIgnored("Test execution failed")); } finally { File.Delete(outFile); } }
public OpenInventory_Main() { m_console = new LocalConsole("Inventory"); MainConsole.Instance = m_console; }
public OpenAsset_Main() { m_console = new LocalConsole("Asset"); MainConsole.Instance = m_console; }