StartDiscoveryListen() public static method

A method is used to start listening the discovery request from the WOPI server. If the listen thread has existed, the DiscoverProcessHelper will not start any new listen thread.
public static StartDiscoveryListen ( string currentTestClient, string progId ) : void
currentTestClient string A parameter represent the current test client which acts as WOPI client to listen the discovery request.
progId string A parameter represents the id of program which is associated with folder level visit in discovery process. This value must be valid for WOPI server. For Microsoft products, this value can be "OneNote.Notebook". It is used to ensure the WOPI server can support folder level visit ability in WOPI mode when receive the value from the discovery response.
return void
Example #1
0
        /// <summary>
        /// A method is used to perform the discovery process
        /// </summary>
        /// <param name="currentTestClient">A parameter represents the current test client which is listening the discovery request.</param>
        /// <param name="sutControllerAdapterInstance">A parameter represents the IMS_WOPISUTControlAdapter instance which is used to make the WOPI server perform sending discovery request to the discovery listener.</param>
        /// <param name="siteInstance">A parameter represents the ITestSite instance which is used to get the test context.</param>
        public static void PerformDiscoveryProcess(string currentTestClient, IMS_WOPISUTControlAdapter sutControllerAdapterInstance, ITestSite siteInstance)
        {
            DiscoveryProcessHelper.CheckInputParameterNullOrEmpty <string>(currentTestClient, "currentTestClient", "PerformDiscoveryProcess");
            DiscoveryProcessHelper.CheckInputParameterNullOrEmpty <IMS_WOPISUTControlAdapter>(sutControllerAdapterInstance, "sutControllerAdapterInstance", "PerformDiscoveryProcess");
            DiscoveryProcessHelper.CheckInputParameterNullOrEmpty <ITestSite>(siteInstance, "siteInstance", "PerformDiscoveryProcess");

            // If the test class invoke this, means the test class will uses the WOPI discovery binding. The test suite will count all WOPI discovery usage of test classes
            System.Threading.Interlocked.Increment(ref cleanUpDiscoveryStatusCounter);

            // Start the listener, if the listen thread has been start, the DiscoverProcessHelper will not start any new listen thread.
            DiscoveryProcessHelper.StartDiscoveryListen(currentTestClient, progId);

            // Initialize the WOPI Discovery process so that the WOPI server will use the test suite as WOPI client.
            if (!DiscoveryProcessHelper.HasPerformDiscoveryProcessSucceed)
            {
                DiscoveryProcessHelper.PerformDiscoveryProcess(currentTestClient, sutControllerAdapterInstance);
            }
        }