예제 #1
0
 public void PerformancePageLoadTest(string url, int benchmark)
 {
     this.BrowserCapabilities.SetCapability("browser", "Chrome");
     this.BrowserCapabilities.SetCapability("browser_version", "36.0");
     this.instance = new AreaLibrary.Browsers.ChromeInstance(this.BrowserCapabilities);
     CommonTests.PerformancePageLoadTest(this, url, benchmark);
 }
예제 #2
0
        //Usage: MgTestRunner.exe <webconfig.ini path> <MENTOR_DICTIONARY_PATH> [test log path]
        static void Main(string[] args)
        {
            if (args.Length >= 2 && args.Length <= 3)
            {
                string webconfig = args[0];
                string logFile   = "UnitTests.log";
                if (args.Length == 3)
                {
                    logFile = args[2];
                }

                int failures = 0;
                using (var logger = new TestLoggerFile(logFile, false))
                {
                    logger.Write("Run started: {0}\n\n", DateTime.Now.ToString());

                    Environment.SetEnvironmentVariable("MENTOR_DICTIONARY_PATH", args[1], EnvironmentVariableTarget.Process);

                    MapGuideApi.MgInitializeWebTier(args[0]);
                    userInfo = new MgUserInformation("Administrator", "admin");
                    siteConn = new MgSiteConnection();
                    siteConn.Open(userInfo);

                    var factory = new PlatformFactory(siteConn);

                    int  testsRun     = 0;
                    bool isEnterprise = false;
                    failures += ExecuteTest(ApiTypes.Platform, "../../TestData/ResourceService/ResourceServiceTest.dump", ref testsRun, logger, isEnterprise);
                    failures += ExecuteTest(ApiTypes.Platform, "../../TestData/DrawingService/DrawingServiceTest.dump", ref testsRun, logger, isEnterprise);
                    failures += ExecuteTest(ApiTypes.Platform, "../../TestData/FeatureService/FeatureServiceTest.dump", ref testsRun, logger, isEnterprise);
                    failures += ExecuteTest(ApiTypes.Platform, "../../TestData/SiteService/SiteServiceTest.dump", ref testsRun, logger, isEnterprise);
                    failures += ExecuteTest(ApiTypes.Platform, "../../TestData/MappingService/MappingServiceTest.dump", ref testsRun, logger, isEnterprise);
                    failures += ExecuteTest(ApiTypes.Platform, "../../TestData/ServerAdmin/ServerAdminTest.dump", ref testsRun, logger, isEnterprise);
                    failures += ExecuteTest(ApiTypes.Platform, "../../TestData/MapLayer/MapLayerTest.dump", ref testsRun, logger, isEnterprise);
                    failures += ExecuteTest(ApiTypes.Platform, "../../TestData/WebLayout/WebLayoutTest.dump", ref testsRun, logger, isEnterprise);
                    failures += ExecuteTest(ApiTypes.Platform, "../../TestData/Unicode/UnicodeTest.dump", ref testsRun, logger, isEnterprise);
                    //Run auxillary tests not part of the SQLite-defined suite
                    failures += CommonTests.Execute(factory, logger, ref testsRun);
                    failures += MapGuideTests.Execute(factory, logger, ref testsRun);
                    logger.Write("\n\nTests failed/run: {0}/{1}\n", failures, testsRun);
                    Console.Write("\n\nTests failed/run: {0}/{1}\n", failures, testsRun);
                    logger.Write("Run ended: {0}\n\n", DateTime.Now.ToString());
                }
                Environment.ExitCode = failures;
            }
            else
            {
                Console.WriteLine("Usage: MgTestRunner.exe <webconfig.ini path> <MENTOR_DICTIONARY_PATH> [test log path]");
                Environment.ExitCode = 1;
            }
        }
예제 #3
0
        static void Main(string[] args)
        {
            CommonTests t = new CommonTests();

            t.GetPublicObsoleteClasses_Should_Return_Right_List();
            t.GetProperty_Should_Return_Property_Value_For_Single_Path();
            t.GetProperty_Should_Return_Property_Value_For_Complex_Path();
            t.SetProperty_Should_Assign_Value_For_Single_Public_Path();
            t.GetProperty_Should_Assign_Value_For_Complex_Path();
            t.SetProperty_Should_Assign_Value_For_Single_Private_Path();
            CodeGenerationTests cg = new CodeGenerationTests();

            cg.GetVectorMultiplyFunction_Returns_Function_For_Int();
            cg.GetVectorMultiplyFunction_Returns_Function_For_Long();
            cg.GetVectorMultiplyFunction_Returns_Function_For_Double();
            cg.CodeGeneration_PerformanceTest();

            Console.WriteLine("Press any key");
            Console.ReadKey();
        }
 public void QuickPulseAggregates()
 {
     CommonTests.QuickPulseAggregates(this.QuickPulseListener, this.HttpClient);
 }
 public void NonParsableCounter()
 {
     CommonTests.NonParsableCounter(this.Listener);
 }
 public void NonExistentCounterWhichUsesPlaceHolder()
 {
     CommonTests.NonExistentCounterWhichUsesPlaceHolder(this.Listener);
 }
 public void NonExistentCounter()
 {
     CommonTests.NonExistentCounter(this.Listener);
 }
 public void CustomCounterCollection()
 {
     CommonTests.CustomCounterCollection(this.Listener);
 }
예제 #9
0
 public void SuccessCreateFolder()
 {
     CommonTests.SuccessCreateFolder(amazonProvider);
 }
예제 #10
0
파일: DATTest.cs 프로젝트: Fe-Bell/OpenDBF
 public void GenericTest()
 {
     CommonTests.GenericTest(FRAMEWORK);
 }
예제 #11
0
 public void AnyFiles()
 {
     CommonTests.AnyFiles(mongoProvider);
 }
예제 #12
0
 public void AnyFolders()
 {
     CommonTests.AnyFolders(mongoProvider);
 }
예제 #13
0
 public void SuccessCreateFolder()
 {
     CommonTests.SuccessCreateFolder(mongoProvider);
 }
예제 #14
0
 public void SuccessCreateFile()
 {
     CommonTests.SuccessCreateFile(mongoProvider);
 }
예제 #15
0
 public void AnyFiles()
 {
     CommonTests.AnyFiles(amazonProvider);
 }
 public void QuickPulseMetricsAndDocuments()
 {
     CommonTests.QuickPulseMetricsAndDocuments(this.QuickPulseListener, this);
 }
 public void QuickPulseTopCpuProcesses()
 {
     CommonTests.QuickPulseTopCpuProcesses(this.QuickPulseListener, this);
 }
예제 #18
0
        static void Main(string[] args)
        {
            // Visual setup
            try
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
            }
            catch (InvalidOperationException e)
            {
                Debug.WriteLine("Unable to set text compatible text rendering default: " + e.Message + "\n" + e.StackTrace);
            }

            // If run with -startserver flag, try to start the server; if the server is already running, ignore this flag
            bool start_server_arg = args.Length == 1 && args[0] == "-startserver";

            // Check whether the OSVR Server is already running
            bool server_running = OSVRProcessManager.ProcessInstanceIsRunning(Common.SERVICE_NAME);

            // Check whether another instance of the TrayApp is already running
            Process existing_trayapp_instance = OSVRProcessManager.ExistingTrayAppProcess();

            bool trayapp_running = existing_trayapp_instance != null;

            // On Win7x64 Pro and potentially other operating systems, two instances of this application are for some reason
            // being launched on startup, despite only one entry existing in msconfig's startups tab.  See OSVI-201 for details.
            //
            // When this situation occurs, this block will detect it and terminate the instance with the higher process ID.
            // This could also be solved with the sort of global system lock that used to be present here, but that had other issues.
            if (trayapp_running &&
                DateTime.Now - existing_trayapp_instance.StartTime < TimeSpan.FromSeconds(1d))
            {
                if (existing_trayapp_instance.Id < Process.GetCurrentProcess().Id)
                {
                    Debug.WriteLine("Two instances launched at nearly the same time; terminating this one because it has a higher process ID.");
                    return;
                }
                else
                {
                    Debug.WriteLine("Two instances launched at nearly the same time; terminating other one because it has a higher process ID.");
                    trayapp_running = false;
                }
            }

            /*
             * trayapp_running, start_server_arg, server_running:
             * no, yes, yes -> show message saying unmanaged server already running
             * no, no, yes -> show message saying unmanaged server already running
             * no, no, no -> vanilla
             * yes, yes, no -> terminate existing instance, launch server
             * no, yes, no -> launch server
             * yes, yes, yes -> terminate this instance, show message saying both server and trayapp are already running
             * yes, no, yes -> terminate this instance, show message saying trayapp already running
             * yes, no, no ->  terminate this instance, show message saying trayapp already running
             */

            bool terminate_this_instance     = trayapp_running && (!start_server_arg || server_running);
            bool terminate_existing_instance = trayapp_running && start_server_arg && !server_running;
            bool launch_server = start_server_arg && !server_running;
            bool msg_unmanaged_server_already_running = !trayapp_running && server_running;
            bool msg_trayapp_already_running          = trayapp_running && !start_server_arg;
            bool msg_both_already_running             = trayapp_running && start_server_arg && server_running;

            if (msg_unmanaged_server_already_running)
            {
                Common.ShowMessageBox(Common.MSG_SERVER_ALREADY_RUNNING_UMANAGED, MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }

            if (msg_trayapp_already_running)
            {
                Common.ShowMessageBox(Common.MSG_TRAYAPP_ALREADY_RUNNING, MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }

            if (msg_both_already_running)
            {
                Common.ShowMessageBox(Common.MSG_TRAYAPP_AND_SERVER_ALREADY_RUNNING, MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }

            if (terminate_existing_instance)
            {
                try
                {
                    existing_trayapp_instance.Kill();
                }
                catch
                {
                    Debug.WriteLine("Unable to kill existing TrayApp process with PID " + existing_trayapp_instance.Id + "!");
                }
            }

            if (terminate_this_instance)
            {
                return;
            }

#if (RUN_TESTRAIL)
            CommonTests.Run();
#endif

            using (OSVRIcon osvrIcon = new OSVRIcon())
            {
                osvrIcon.Display(launch_server);
                Application.Run();
            }
        }
예제 #19
0
파일: DATTest.cs 프로젝트: Fe-Bell/OpenDBF
 public void LoadExistingDatabaseTest()
 {
     CommonTests.LoadExistingDatabaseTest(FRAMEWORK);
 }
 public void DefaultCounterCollection()
 {
     CommonTests.DefaultCounterCollection(this.Listener);
 }