/// <summary>
        /// This method is used to prepare a coauthoring session on the file with the specified schema lock id and client id.
        /// </summary>
        /// <param name="fileUrl">Specify the file which is locked.</param>
        /// <param name="clientId">Specify the client ID.</param>
        /// <param name="schemaLockId">Specify the schemaLock ID.</param>
        /// <param name="userName">Specify the user name of the user who calls cell storage service.</param>
        /// <param name="password">Specify the password of the user who calls cell storage service.</param>
        /// <param name="domain">Specify the domain of the user who calls cell storage service.</param>
        /// <param name="timeout">Specify the timeout value.</param>
        /// <returns>Return the current coauthoring status when the user join the coauthoring session.</returns>
        protected CoauthStatusType PrepareCoauthoringSession(string fileUrl, string clientId, string schemaLockId, string userName, string password, string domain, int timeout = SharedTestSuiteHelper.DefaultTimeOut)
        {
            this.InitializeContext(fileUrl, userName, password, domain);

            // Join a Coauthoring session
            CoauthSubRequestType  subRequest   = SharedTestSuiteHelper.CreateCoauthSubRequestForJoinCoauthSession(clientId, schemaLockId, null, null, timeout);
            CellStorageResponse   cellResponse = this.Adapter.CellStorageRequest(fileUrl, new SubRequestType[] { subRequest });
            CoauthSubResponseType joinResponse = SharedTestSuiteHelper.ExtractSubResponse <CoauthSubResponseType>(cellResponse, 0, 0, this.Site);

            this.Site.Assert.AreEqual(
                ErrorCodeType.Success,
                SharedTestSuiteHelper.ConvertToErrorCodeType(joinResponse.ErrorCode, this.Site),
                "Join coauthoring session with client ID {0} and schema lock ID {4} by the user {1}@{2} on the file {3} should succeed.",
                clientId,
                userName,
                domain,
                fileUrl,
                schemaLockId);

            this.StatusManager.RecordCoauthSession(fileUrl, clientId, schemaLockId, userName, password, domain);

            this.Site.Assert.IsTrue(
                joinResponse.SubResponseData.CoauthStatusSpecified,
                "When join the coauthoring session succeeds, the coauth status should be returned.");

            return(joinResponse.SubResponseData.CoauthStatus);
        }
        public void MSFSSHTTP_FSSHTTPB_S02_TC06_JoinCoauthoringSession_PathNotFound()
        {
            Site.Assume.IsTrue(Common.IsRequirementEnabled(11265, this.Site), "This test case only runs PathNotFound is returned when the file path is not found.");

            string fileUrlNotExit = SharedTestSuiteHelper.GenerateNonExistFileUrl(this.Site);
            string path           = fileUrlNotExit.Substring(0, fileUrlNotExit.LastIndexOf('/'));

            // Initialize the service
            this.InitializeContext(path, this.UserName01, this.Password01, this.Domain);

            CoauthSubRequestType  subRequest   = SharedTestSuiteHelper.CreateCoauthSubRequestForJoinCoauthSession(SharedTestSuiteHelper.DefaultClientID, SharedTestSuiteHelper.ReservedSchemaLockID, null, null, 3600);
            CellStorageResponse   cellResponse = this.Adapter.CellStorageRequest(path, new SubRequestType[] { subRequest });
            CoauthSubResponseType joinResponse = SharedTestSuiteHelper.ExtractSubResponse <CoauthSubResponseType>(cellResponse, 0, 0, this.Site);

            if (SharedContext.Current.IsMsFsshttpRequirementsCaptured)
            {
                Site.CaptureRequirementIfAreEqual <ErrorCodeType>(
                    ErrorCodeType.PathNotFound,
                    SharedTestSuiteHelper.ConvertToErrorCodeType(joinResponse.ErrorCode, this.Site),
                    "MS-FSSHTTP",
                    11265,
                    @"[In Appendix B: Product Behavior] Implementation does return the value ""PathNotFound"" of GenericErrorCodeTypes when the file path is not found. (Microsoft Office 2016/Microsoft SharePoint Server 2016 follow this behavior.)");
            }
            else
            {
                Site.Assert.AreEqual <ErrorCodeType>(
                    ErrorCodeType.PathNotFound,
                    SharedTestSuiteHelper.ConvertToErrorCodeType(joinResponse.ErrorCode, this.Site),
                    @"Error ""PathNotFound"" should be returned when the file path is not found.");
            }
        }
        public void MSFSSHTTP_FSSHTTPB_S02_TC04_JoinCoauthSession_FileNotExistsOrCannotBeCreated()
        {
            // Join a coauthoring session on a nonexistent file, expect the server returns the error code "FileNotExistsOrCannotBeCreated".
            string fileUrlNotExit = SharedTestSuiteHelper.GenerateNonExistFileUrl(this.Site);

            // Initialize the service
            this.InitializeContext(fileUrlNotExit, this.UserName01, this.Password01, this.Domain);

            // Join a Coauthoring session with the non-exist URL.
            CoauthSubRequestType  subRequest   = SharedTestSuiteHelper.CreateCoauthSubRequestForJoinCoauthSession(SharedTestSuiteHelper.DefaultClientID, SharedTestSuiteHelper.ReservedSchemaLockID, null, null, 3600);
            CellStorageResponse   cellResponse = this.Adapter.CellStorageRequest(fileUrlNotExit, new SubRequestType[] { subRequest });
            CoauthSubResponseType joinResponse = SharedTestSuiteHelper.ExtractSubResponse <CoauthSubResponseType>(cellResponse, 0, 0, this.Site);

            if (SharedContext.Current.IsMsFsshttpRequirementsCaptured)
            {
                // If the ErrorCode attribute returned equals "FileNotExistsOrCannotBeCreated", MS-FSSHTTP_R4003 can be covered.
                Site.CaptureRequirementIfAreEqual <ErrorCodeType>(
                    ErrorCodeType.FileNotExistsOrCannotBeCreated,
                    SharedTestSuiteHelper.ConvertToErrorCodeType(joinResponse.ErrorCode, this.Site),
                    "MS-FSSHTTP",
                    4003,
                    @"[In Coauth Subrequest][The protocol server returns results based on the following conditions:] If the protocol server was unable to find the URL for the file specified in the Url attribute, the protocol server reports a failure by returning an error code value set to ""FileNotExistsOrCannotBeCreated"" in the ErrorCode attribute sent back in the SubResponse element.");
            }
            else
            {
                Site.Assert.AreEqual <ErrorCodeType>(
                    ErrorCodeType.FileNotExistsOrCannotBeCreated,
                    SharedTestSuiteHelper.ConvertToErrorCodeType(joinResponse.ErrorCode, this.Site),
                    @"[In Coauth Subrequest][The protocol server returns results based on the following conditions:] If the protocol server was unable to find the URL for the file specified in the Url attribute, the protocol server reports a failure by returning an error code value set to ""FileNotExistsOrCannotBeCreated"" in the ErrorCode attribute sent back in the SubResponse element.");
            }
        }
Пример #4
0
        /// <summary>
        /// This method is used to record the coauth lock status with specified client ID and schema lock ID for the file URL.
        /// </summary>
        /// <param name="fileUrl">Specify the file URL which get the coauth lock.</param>
        /// <param name="clientId">Specify the client ID of the coauth lock.</param>
        /// <param name="schemaLockId">Specify the schema ID of the coauth lock.</param>
        /// <param name="userName">Specify the user name of the user who calls cell storage service.</param>
        /// <param name="password">Specify the password of the user who calls cell storage service.</param>
        /// <param name="domain">Specify the domain of the user who calls cell storage service.</param>
        public void RecordCoauthSession(string fileUrl, string clientId, string schemaLockId, string userName, string password, string domain)
        {
            Action function = () =>
            {
                CoauthSubRequestType coauthLockRequest = new CoauthSubRequestType();
                coauthLockRequest.SubRequestToken = SequenceNumberGenerator.GetCurrentToken().ToString();
                coauthLockRequest.SubRequestData  = new CoauthSubRequestDataType();
                coauthLockRequest.SubRequestData.CoauthRequestType          = CoauthRequestTypes.ExitCoauthoring;
                coauthLockRequest.SubRequestData.CoauthRequestTypeSpecified = true;
                coauthLockRequest.SubRequestData.SchemaLockID = schemaLockId;
                coauthLockRequest.SubRequestData.ClientID     = clientId;

                IMS_FSSHTTP_FSSHTTPBAdapter adapter = site.GetAdapter <IMS_FSSHTTP_FSSHTTPBAdapter>();
                this.intializeContext(fileUrl, userName, password, domain);

                CoauthSubResponseType subResponse = SharedTestSuiteHelper.ExtractSubResponse <CoauthSubResponseType>(adapter.CellStorageRequest(fileUrl, new SubRequestType[] { coauthLockRequest }), 0, 0, site);

                if (!string.Equals("Success", subResponse.ErrorCode, StringComparison.OrdinalIgnoreCase))
                {
                    this.errorMessage.Add(string.Format("Failed to leave the coauth session for the client id {1} and schema lock id {5} on the file {0} using the following user: {2}/{3}and password:{4}", fileUrl, clientId, userName, domain, password, schemaLockId));
                    this.isEnvironmentRollbackSuccess = false;
                }
            };

            this.AddOrUpdate(new SharedLockKey(fileUrl, clientId, schemaLockId), function);
        }
Пример #5
0
        public void MSFSSHTTP_FSSHTTPB_TestCase_S18_TC01_AmIAlone_False()
        {
            // Initialize the service
            this.InitializeContext(this.DefaultFileUrl, this.UserName01, this.Password01, this.Domain);

            // Join Coauthoring session using the first user
            CoauthSubRequestType  subRequest   = SharedTestSuiteHelper.CreateCoauthSubRequestForJoinCoauthSession(SharedTestSuiteHelper.DefaultClientID, SharedTestSuiteHelper.ReservedSchemaLockID);
            CellStorageResponse   cellResponse = this.Adapter.CellStorageRequest(this.DefaultFileUrl, new SubRequestType[] { subRequest });
            CoauthSubResponseType subResponse  = SharedTestSuiteHelper.ExtractSubResponse <CoauthSubResponseType>(cellResponse, 0, 0, this.Site);

            this.Site.Assert.AreEqual(
                ErrorCodeType.Success,
                SharedTestSuiteHelper.ConvertToErrorCodeType(subResponse.ErrorCode, this.Site),
                string.Format("Account {0} with client ID {1} and schema lock ID {2} should join the coauthoring session successfully.", this.UserName01, SharedTestSuiteHelper.DefaultClientID, SharedTestSuiteHelper.ReservedSchemaLockID));
            this.StatusManager.RecordCoauthSession(this.DefaultFileUrl, SharedTestSuiteHelper.DefaultClientID, SharedTestSuiteHelper.ReservedSchemaLockID);

            // Join the Coauthoring session using the second user with same SchemaLockId
            this.InitializeContext(this.DefaultFileUrl, this.UserName02, this.Password02, this.Domain);
            string secondClientId = System.Guid.NewGuid().ToString();

            subRequest   = SharedTestSuiteHelper.CreateCoauthSubRequestForJoinCoauthSession(secondClientId, SharedTestSuiteHelper.ReservedSchemaLockID);
            cellResponse = this.Adapter.CellStorageRequest(this.DefaultFileUrl, new SubRequestType[] { subRequest });
            CoauthSubResponseType secondResponse = SharedTestSuiteHelper.ExtractSubResponse <CoauthSubResponseType>(cellResponse, 0, 0, this.Site);

            this.StatusManager.RecordCoauthSession(this.DefaultFileUrl, secondClientId, SharedTestSuiteHelper.ReservedSchemaLockID, this.UserName02, this.Password02, this.Domain);

            string transitionId = secondResponse.SubResponseData.TransitionID;

            AmIAloneSubRequestType amIAlone = SharedTestSuiteHelper.CreateAmIAloneSubRequest();

            amIAlone.SubRequestData.TransitionID = transitionId;
            CellStorageResponse     response         = this.Adapter.CellStorageRequest(this.DefaultFileUrl, new SubRequestType[] { amIAlone });
            AmIAloneSubResponseType amIAloneResponse = SharedTestSuiteHelper.ExtractSubResponse <AmIAloneSubResponseType>(response, 0, 0, this.Site);

            if (SharedContext.Current.IsMsFsshttpRequirementsCaptured)
            {
                //Verify MS-FSSHTTP requirement: MS-FSSHTTP_R224912
                Site.CaptureRequirementIfAreEqual <string>(
                    "False",
                    amIAloneResponse.SubResponseData.AmIAlone,
                    "MS-FSSHTTP",
                    224912,
                    @"[In AmIAloneSubResponseDataType]AmIAlone: False means the user is not alone in the coauthoring session.");

                //Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2181012
                //If MS-FSSHTTP224912 is verified, this requirement can be verified directly
                Site.CaptureRequirement(
                    "MS-FSSHTTP",
                    2181012,
                    @"[In SubResponseDataOptionalAttributes]AmIAlone: False means the user is not alone in the coauthoring session.");
            }
            else
            {
                Site.Assert.AreEqual <string>(
                    "False",
                    amIAloneResponse.SubResponseData.AmIAlone,
                    "AmIAlone: False means the user is not alone in the coauthoring session.");
            }
        }
        /// <summary>
        /// This method is used to check the user with specified client whether exist in a coauthoring session.
        /// </summary>
        /// <param name="fileUrl">Specify the file which is locked.</param>
        /// <param name="clientId">Specify the client ID.</param>
        /// <param name="schemaLockId">Specify the schemaLock ID.</param>
        /// <param name="userName">Specify the user name of the user who calls cell storage service.</param>
        /// <param name="password">Specify the password of the user who calls cell storage service.</param>
        /// <param name="domain">Specify the domain of the user who calls cell storage service.</param>
        /// <returns>Return true is exist in the coauthoring session, otherwise return false.</returns>
        protected bool IsPresentInCoauthSession(string fileUrl, string clientId, string schemaLockId, string userName, string password, string domain)
        {
            this.InitializeContext(fileUrl, userName, password, domain);
            CoauthSubRequestType  subRequest   = SharedTestSuiteHelper.CreateCoauthSubRequestForMarkTransitionComplete(clientId, schemaLockId);
            CellStorageResponse   cellResponse = this.Adapter.CellStorageRequest(fileUrl, new SubRequestType[] { subRequest });
            CoauthSubResponseType response     = SharedTestSuiteHelper.ExtractSubResponse <CoauthSubResponseType>(cellResponse, 0, 0, this.Site);

            return(SharedTestSuiteHelper.ConvertToErrorCodeType(response.ErrorCode, this.Site) == ErrorCodeType.Success);
        }
Пример #7
0
        public void TestCase_S10_TC08_OnSuccessOrNotSupported_OnNotSupport()
        {
            if (!Common.IsRequirementEnabled("MS-FSSHTTP-FSSHTTPB", 337, this.Site))
            {
                Site.Assume.Inconclusive("Implementation does not return Success when its sub-request dependency type is OnSuccessOrNotSupported and the dependent subRequest is not supported");
            }

            // Initialize the service
            this.InitializeContext(this.DefaultFileUrl, this.UserName01, this.Password01, this.Domain);

            // Disable the coauthoring feature.
            bool isSwitchedSuccessfully = SutPowerShellAdapter.SwitchCoauthoringFeature(true);

            this.Site.Assert.IsTrue(isSwitchedSuccessfully, "The Coauthoring Feature should be disabled.");
            this.StatusManager.RecordDisableCoauth();

            // create a coauthoring subRequest with all valid parameters.
            CoauthSubRequestType coauthSubRequest = SharedTestSuiteHelper.CreateCoauthSubRequestForJoinCoauthSession(SharedTestSuiteHelper.DefaultClientID, SharedTestSuiteHelper.ReservedSchemaLockID);

            // Create a serverTime subRequest with DependencyType set to "OnSuccessOrNotSupported", which depends on the coauthoring subRequest.
            ServerTimeSubRequestType serverTimeSubRequest = SharedTestSuiteHelper.CreateServerTimeSubRequest(SequenceNumberGenerator.GetCurrentToken());

            serverTimeSubRequest.DependencyType          = DependencyTypes.OnSuccessOrNotSupported;
            serverTimeSubRequest.DependencyTypeSpecified = true;
            serverTimeSubRequest.DependsOn = coauthSubRequest.SubRequestToken;

            // Send these two subRequests to the protocol server, expect the protocol server returns error code "Success" for the serverTimeSubRequest.
            CellStorageResponse   response          = this.Adapter.CellStorageRequest(this.DefaultFileUrl, new SubRequestType[] { coauthSubRequest, serverTimeSubRequest });
            CoauthSubResponseType coauthSubResponse = SharedTestSuiteHelper.ExtractSubResponse <CoauthSubResponseType>(response, 0, 0, this.Site);

            this.Site.Assert.AreNotEqual <ErrorCodeType>(ErrorCodeType.Success, SharedTestSuiteHelper.ConvertToErrorCodeType(coauthSubResponse.ErrorCode, this.Site), "The coauthoring operation should be failed.");
            ServerTimeSubResponseType serverTimeSubResponse = SharedTestSuiteHelper.ExtractSubResponse <ServerTimeSubResponseType>(response, 0, 1, this.Site);

            if (SharedContext.Current.IsMsFsshttpRequirementsCaptured)
            {
                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R337
                Site.CaptureRequirementIfAreEqual <ErrorCodeType>(
                    ErrorCodeType.Success,
                    SharedTestSuiteHelper.ConvertToErrorCodeType(serverTimeSubResponse.ErrorCode, this.Site),
                    "MS-FSSHTTP",
                    337,
                    @"[In DependencyTypes] OnSuccessOrNotSupported: Indicates that the subrequest MUST be processed only when one of the following conditions is true:
                             If the other subrequest is not supported. (Microsoft SharePoint Foundation 2010/Microsoft SharePoint Server 2010 follow this behavior.)");
            }
            else
            {
                Site.Assert.AreEqual <ErrorCodeType>(
                    ErrorCodeType.Success,
                    SharedTestSuiteHelper.ConvertToErrorCodeType(serverTimeSubResponse.ErrorCode, this.Site),
                    @"[In DependencyTypes] OnSuccessOrNotSupported: Indicates that the subrequest MUST be processed only when one of the following conditions is true:
                    If the other subrequest is not supported. (Microsoft SharePoint Foundation 2010/Microsoft SharePoint Server 2010 follow this behavior.)");
            }
        }
        public void MSFSSHTTP_FSSHTTPB_S02_TC05_JoinCoauthoringSession_CheckedOutByCurrentUser()
        {
            // Initialize the service
            this.InitializeContext(this.DefaultFileUrl, this.UserName01, this.Password01, this.Domain);

            // Check out the file
            if (!this.SutManagedAdapter.CheckOutFile(this.DefaultFileUrl, this.UserName01, this.Password01, this.Domain))
            {
                this.Site.Assert.Fail("Cannot change the file {0} to check out status using the user name {1} and password {2}", this.DefaultFileUrl, this.UserName01, this.Password01);
            }

            this.StatusManager.RecordFileCheckOut(this.DefaultFileUrl, this.UserName01, this.Password01, this.Domain);

            CheckLockAvailability();

            // Join a Coauthoring session
            CoauthSubRequestType  request      = SharedTestSuiteHelper.CreateCoauthSubRequestForJoinCoauthSession(SharedTestSuiteHelper.DefaultClientID, SharedTestSuiteHelper.ReservedSchemaLockID, true, SharedTestSuiteHelper.DefaultExclusiveLockID);
            CellStorageResponse   cellResponse = this.Adapter.CellStorageRequest(this.DefaultFileUrl, new SubRequestType[] { request });
            CoauthSubResponseType response     = SharedTestSuiteHelper.ExtractSubResponse <CoauthSubResponseType>(cellResponse, 0, 0, this.Site);

            this.Site.Assert.AreEqual(
                ErrorCodeType.Success,
                SharedTestSuiteHelper.ConvertToErrorCodeType(response.ErrorCode, this.Site),
                "The test case cannot continue unless the server response succeeds when the user join the coauthoring session with allowFallback set to true on an already checked out file by the same user.");
            this.StatusManager.RecordExclusiveLock(this.DefaultFileUrl, SharedTestSuiteHelper.DefaultExclusiveLockID);

            this.Site.Assert.AreEqual(
                "ExclusiveLock",
                response.SubResponseData.LockType,
                "The test case cannot continue unless the server responses an exclusive lock type when the user join the coauthoring session with allowFallback set to true on an already checked out file by the same user.");

            this.Site.Assert.IsTrue(
                response.SubResponseData.ExclusiveLockReturnReasonSpecified,
                "The test case cannot continue unless the server returns ExclusiveLockReturnReason attribute when the user join the coauthoring session with allowFallback set to true on an already checked out file by the same user.");

            if (SharedContext.Current.IsMsFsshttpRequirementsCaptured)
            {
                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R350
                Site.CaptureRequirementIfAreEqual <ExclusiveLockReturnReasonTypes>(
                    ExclusiveLockReturnReasonTypes.CheckedOutByCurrentUser,
                    response.SubResponseData.ExclusiveLockReturnReason,
                    "MS-FSSHTTP",
                    350,
                    @"[In ExclusiveLockReturnReasonTypes] CheckedOutByCurrentUser: The string value ""CheckedOutByCurrentUser"", indicating that an exclusive lock is granted on the file because the file is checked out by the current user who sent the cell storage service request message.");
            }
            else
            {
                Site.Assert.AreEqual <ExclusiveLockReturnReasonTypes>(
                    ExclusiveLockReturnReasonTypes.CheckedOutByCurrentUser,
                    response.SubResponseData.ExclusiveLockReturnReason,
                    "The server should response when an exclusive lock is granted on the file because the file is checked out by the current user who sent the cell storage service request message.");
            }
        }
Пример #9
0
        public void TestCase_S19_TC01_LockStatus_Success()
        {
            // Initialize the service
            this.InitializeContext(this.DefaultFileUrl, this.UserName01, this.Password01, this.Domain);

            CoauthSubRequestType  subRequest   = SharedTestSuiteHelper.CreateCoauthSubRequestForJoinCoauthSession(SharedTestSuiteHelper.DefaultClientID, SharedTestSuiteHelper.ReservedSchemaLockID);
            CellStorageResponse   cellResponse = this.Adapter.CellStorageRequest(this.DefaultFileUrl, new SubRequestType[] { subRequest });
            CoauthSubResponseType subResponse  = SharedTestSuiteHelper.ExtractSubResponse <CoauthSubResponseType>(cellResponse, 0, 0, this.Site);

            this.Site.Assert.AreEqual(
                ErrorCodeType.Success,
                SharedTestSuiteHelper.ConvertToErrorCodeType(subResponse.ErrorCode, this.Site),
                string.Format("Account {0} with client ID {1} and schema lock ID {2} should join the coauthoring session successfully.", this.UserName01, SharedTestSuiteHelper.DefaultClientID, SharedTestSuiteHelper.ReservedSchemaLockID));
            this.StatusManager.RecordCoauthSession(this.DefaultFileUrl, SharedTestSuiteHelper.DefaultClientID, SharedTestSuiteHelper.ReservedSchemaLockID);

            LockStatusSubRequestType lockStatus = SharedTestSuiteHelper.CreateLockStatusSubRequest();

            CellStorageResponse       response           = this.Adapter.CellStorageRequest(this.DefaultFileUrl, new SubRequestType[] { lockStatus });
            LockStatusSubResponseType lockStatusResponse = SharedTestSuiteHelper.ExtractSubResponse <LockStatusSubResponseType>(response, 0, 0, this.Site);
            SubResponseType           subresponse        = response.ResponseCollection.Response[0].SubResponse[0];

            if (SharedContext.Current.IsMsFsshttpRequirementsCaptured)
            {
                // Capture the requirement MS-FSSHTTP_R246601
                Site.CaptureRequirement(
                    "MS-FSSHTTP",
                    246601,
                    @"[In Appendix B: Product Behavior] Implementation does support LockStatus operation. (SharePoint Server 2016 and above follow this behavior.)");

                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2272
                Site.CaptureRequirementIfAreEqual <string>(
                    GenericErrorCodeTypes.Success.ToString(),
                    subresponse.ErrorCode,
                    "MS-FSSHTTP",
                    2272,
                    @"[LockStatusSubResponseType]In the case of success, it contains information requested as part of a LockStatus subrequest. ");

                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R401011
                Site.CaptureRequirementIfAreEqual <int>(
                    1,
                    int.Parse(lockStatusResponse.SubResponseData.LockType),
                    "MS-FSSHTTP",
                    401011,
                    @"[In LockTypes] 1: The integer value ""1"", indicating a shared lock on the file.");
            }
            else
            {
                Site.Assert.AreEqual <string>(
                    GenericErrorCodeTypes.Success.ToString(),
                    subresponse.ErrorCode,
                    "In the case of success, it contains information requested as part of a LockStatus subrequest. ");
            }
        }
        public void MSFSSHTTP_FSSHTTPB_TestCase_S19_TC01_LockStatus_ExclusiveLock()
        {
            // Initialize the service
            this.InitializeContext(this.DefaultFileUrl, this.UserName01, this.Password01, this.Domain);

            // Disable the Coauthoring Feature
            bool isSwitchedSuccessfully = SutPowerShellAdapter.SwitchCoauthoringFeature(true);

            this.Site.Assert.IsTrue(isSwitchedSuccessfully, "The Coauthoring Feature should be disabled.");
            this.StatusManager.RecordDisableCoauth();

            // Waiting change takes effect
            System.Threading.Thread.Sleep(30 * 1000);

            // Join a Coauthoring session
            CoauthSubRequestType  subRequest   = SharedTestSuiteHelper.CreateCoauthSubRequestForJoinCoauthSession(SharedTestSuiteHelper.DefaultClientID, SharedTestSuiteHelper.ReservedSchemaLockID, true, SharedTestSuiteHelper.DefaultExclusiveLockID);
            CellStorageResponse   cellResponse = this.Adapter.CellStorageRequest(this.DefaultFileUrl, new SubRequestType[] { subRequest });
            CoauthSubResponseType subResponse  = SharedTestSuiteHelper.ExtractSubResponse <CoauthSubResponseType>(cellResponse, 0, 0, this.Site);

            this.Site.Assert.AreEqual(
                ErrorCodeType.Success,
                SharedTestSuiteHelper.ConvertToErrorCodeType(subResponse.ErrorCode, this.Site),
                string.Format("Account {0} with client ID {1} and schema lock ID {2} should join the coauthoring session successfully.", this.UserName01, SharedTestSuiteHelper.DefaultClientID, SharedTestSuiteHelper.DefaultExclusiveLockID));
            this.StatusManager.RecordCoauthSession(this.DefaultFileUrl, SharedTestSuiteHelper.DefaultClientID, SharedTestSuiteHelper.DefaultExclusiveLockID);

            LockStatusSubRequestType lockStatus = SharedTestSuiteHelper.CreateLockStatusSubRequest();

            CellStorageResponse       response           = this.Adapter.CellStorageRequest(this.DefaultFileUrl, new SubRequestType[] { lockStatus });
            LockStatusSubResponseType lockStatusResponse = SharedTestSuiteHelper.ExtractSubResponse <LockStatusSubResponseType>(response, 0, 0, this.Site);
            SubResponseType           subresponse        = response.ResponseCollection.Response[0].SubResponse[0];

            if (SharedContext.Current.IsMsFsshttpRequirementsCaptured)
            {
                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R404011
                Site.CaptureRequirementIfAreEqual <int>(
                    2,
                    int.Parse(lockStatusResponse.SubResponseData.LockType),
                    "MS-FSSHTTP",
                    404011,
                    @"[In LockTypes] 2: The integer value ""2"", indicating an exclusive lock on the file.");
            }
            else
            {
                Site.Assert.AreEqual <int>(
                    2,
                    int.Parse(lockStatusResponse.SubResponseData.LockType),
                    @"2: The integer value ""2"", indicating an exclusive lock on the file.");
            }
        }
Пример #11
0
        public void TestCase_S18_TC01_AmIAlone_Success()
        {
            // Initialize the service
            this.InitializeContext(this.DefaultFileUrl, this.UserName01, this.Password01, this.Domain);
            // Join a Coauthoring session with time out value 3600.
            CoauthSubRequestType  subRequest   = SharedTestSuiteHelper.CreateCoauthSubRequestForJoinCoauthSession(SharedTestSuiteHelper.DefaultClientID, SharedTestSuiteHelper.ReservedSchemaLockID, null, null, 3600);
            CellStorageResponse   cellResponse = this.Adapter.CellStorageRequest(this.DefaultFileUrl, new SubRequestType[] { subRequest });
            CoauthSubResponseType joinResponse = SharedTestSuiteHelper.ExtractSubResponse <CoauthSubResponseType>(cellResponse, 0, 0, this.Site);

            this.Site.Assert.AreEqual <ErrorCodeType>(
                ErrorCodeType.Success,
                SharedTestSuiteHelper.ConvertToErrorCodeType(joinResponse.ErrorCode, this.Site),
                "Test case cannot continue unless the user {0} using client id {1} and schema lock id {2} to join the coauthoring session succeed.",
                this.UserName01,
                SharedTestSuiteHelper.DefaultClientID,
                SharedTestSuiteHelper.ReservedSchemaLockID);
            this.StatusManager.RecordCoauthSession(this.DefaultFileUrl, SharedTestSuiteHelper.DefaultClientID, SharedTestSuiteHelper.ReservedSchemaLockID);
            string transitionId = joinResponse.SubResponseData.TransitionID;

            AmIAloneSubRequestType amIAlone = SharedTestSuiteHelper.CreateAmIAloneSubRequest();

            amIAlone.SubRequestData.TransitionID = transitionId;

            CellStorageResponse     response         = this.Adapter.CellStorageRequest(this.DefaultFileUrl, new SubRequestType[] { amIAlone });
            AmIAloneSubResponseType amIAloneResponse = SharedTestSuiteHelper.ExtractSubResponse <AmIAloneSubResponseType>(response, 0, 0, this.Site);
            SubResponseType         subresponse      = response.ResponseCollection.Response[0].SubResponse[0];

            if (SharedContext.Current.IsMsFsshttpRequirementsCaptured)
            {
                // Capture the requirement MS-FSSHTTP_R246401
                Site.CaptureRequirement(
                    "MS-FSSHTTP",
                    246401,
                    @"[In Appendix B: Product Behavior] Implementation does support AmIAlone operation. <60> (Microsoft SharePoint Foundation 2013/Microsoft SharePoint Server 2013 and above follow this behavior.)");

                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R224911
                Site.CaptureRequirementIfAreEqual <string>(
                    "True",
                    amIAloneResponse.SubResponseData.AmIAlone,
                    "MS-FSSHTTP",
                    224911,
                    @"[In AmIAloneSubResponseDataType]AmIAlone: True means the user is alone in the coauthoring session.");

                //Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2181011
                //If MS-FSSHTTP224911 is verified, this requirement can be verified directly
                Site.CaptureRequirement(
                    "MS-FSSHTTP",
                    2181011,
                    @"[In SubResponseDataOptionalAttributes]AmIAlone: True means the user is alone in the coauthoring session.");

                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2251
                Site.CaptureRequirementIfAreEqual <string>(
                    GenericErrorCodeTypes.Success.ToString(),
                    subresponse.ErrorCode,
                    "MS-FSSHTTP",
                    2251,
                    @"[In AmIAloneSubResponseType]In the case of success, it contains information requested as part of an AmIAlone subrequest. ");

                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2374
                Site.CaptureRequirementIfAreEqual <ErrorCodeType>(
                    ErrorCodeType.Success,
                    SharedTestSuiteHelper.ConvertToErrorCodeType(subresponse.ErrorCode, this.Site),
                    "MS-FSSHTTP",
                    2374,
                    @"[AmIAlone Subrequest][The protocol returns results based on the following conditions]Otherwise, the protocol server sets the error code value to ""Success"" to indicate success in processing the AmIAlone subrequest.");
            }
            else
            {
                Site.Assert.AreEqual <string>(
                    GenericErrorCodeTypes.Success.ToString(),
                    subresponse.ErrorCode,
                    "In the case of success, it contains information requested as part of an AmIAlone subrequest. ");
            }
        }
        public void MSFSSHTTP_FSSHTTPB_S02_TC01_JoinCoauthoringSession_UrlNotSpecified()
        {
            // Initialize the service
            this.InitializeContext(this.DefaultFileUrl, this.UserName01, this.Password01, this.Domain);

            // Create a JoinCoauthoringSession subRequest with all valid parameters.
            CoauthSubRequestType subRequest = SharedTestSuiteHelper.CreateCoauthSubRequestForJoinCoauthSession(SharedTestSuiteHelper.DefaultClientID, SharedTestSuiteHelper.ReservedSchemaLockID);

            CellStorageResponse response = new CellStorageResponse();
            bool isR3006Verified         = false;

            try
            {
                // Send a JoinCoauthoringSession subRequest to the protocol server without specifying URL attribute.
                response = this.Adapter.CellStorageRequest(null, new SubRequestType[] { subRequest });
            }
            catch (System.Xml.XmlException exception)
            {
                string message = exception.Message;
                isR3006Verified  = message.Contains("Duplicate attribute");
                isR3006Verified &= message.Contains("ErrorCode");
            }

            if (SharedContext.Current.IsMsFsshttpRequirementsCaptured)
            {
                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R3006
                if (Common.IsRequirementEnabled("MS-FSSHTTP-FSSHTTPB", 3006, this.Site))
                {
                    Site.Log.Add(
                        LogEntryKind.Debug,
                        "SharePoint server 2010 and SharePoint Foundation responses two ErrorCode attributes when the URL is non exists.");

                    Site.CaptureRequirementIfIsTrue(
                        isR3006Verified,
                        "MS-FSSHTTP",
                        3006,
                        @"[In Appendix B: Product Behavior] If the Url attribute of the corresponding Request element doesn't exist, the implementation does return two ErrorCode attributes in Response element. <8> Section 2.2.3.5:  SharePoint Server 2010 will return 2 ErrorCode attributes in Response element.");
                }

                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R3007
                if (Common.IsRequirementEnabled("MS-FSSHTTP-FSSHTTPB", 3007, this.Site))
                {
                    Site.CaptureRequirementIfIsNull(
                        response.ResponseCollection,
                        "MS-FSSHTTP",
                        3007,
                        @"[In Appendix B: Product Behavior] If the Url attribute of the corresponding Request element doesn't exist, the implementation does not return Response element. <8> Section 2.2.3.5:  SharePoint Server 2013 will not return Response element.");
                }
            }
            else
            {
                if (Common.IsRequirementEnabled("MS-FSSHTTP-FSSHTTPB", 3006, this.Site))
                {
                    Site.Log.Add(
                        LogEntryKind.Debug,
                        "SharePoint server 2010 and SharePoint Foundation responses two ErrorCode attributes when the URL is non exists.");

                    Site.Assert.IsTrue(
                        isR3006Verified,
                        "SharePoint server 2010 and SharePoint Foundation responses two ErrorCode attributes when the URL is non exists.");
                }

                if (Common.IsRequirementEnabled("MS-FSSHTTP-FSSHTTPB", 3007, this.Site))
                {
                    Site.Assert.IsNull(
                        response.ResponseCollection,
                        @"[In Appendix B: Product Behavior] If the URL attribute of the corresponding Request element doesn't exist, the implementation does not return Response element. <8> Section 2.2.3.5:  SharePoint Server 2013 will not return Response element.");
                }
            }
        }
        public void MSFSSHTTP_FSSHTTPB_S02_TC03_CoauthSubRequest_FileAlreadyCheckedOutOnServer()
        {
            // Use SUT method to check out the file.
            if (!this.SutManagedAdapter.CheckOutFile(this.DefaultFileUrl, this.UserName02, this.Password02, this.Domain))
            {
                this.Site.Assert.Fail("Cannot change the file {0} to check out status using the user name {1} and password {2}", this.DefaultFileUrl, this.UserName02, this.Password02);
            }

            this.StatusManager.RecordFileCheckOut(this.DefaultFileUrl, this.UserName02, this.Password02, this.Domain);

            // Initialize the service
            this.InitializeContext(this.DefaultFileUrl, this.UserName01, this.Password01, this.Domain);

            // Join a Coauthoring session, if the coauthorable file is checked out on the server and is checked out by a client with a different user name, the server returns a FileAlreadyCheckedOutOnServer error code.
            // Now the web service is initialized using the user01, so the user is different with the user who check the file out.
            CoauthSubRequestType  subRequest   = SharedTestSuiteHelper.CreateCoauthSubRequestForJoinCoauthSession(SharedTestSuiteHelper.DefaultClientID, SharedTestSuiteHelper.ReservedSchemaLockID);
            CellStorageResponse   cellResponse = this.Adapter.CellStorageRequest(this.DefaultFileUrl, new SubRequestType[] { subRequest });
            CoauthSubResponseType joinResponse = SharedTestSuiteHelper.ExtractSubResponse <CoauthSubResponseType>(cellResponse, 0, 0, this.Site);

            if (SharedContext.Current.IsMsFsshttpRequirementsCaptured)
            {
                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1555
                Site.CaptureRequirementIfAreEqual <ErrorCodeType>(
                    ErrorCodeType.FileAlreadyCheckedOutOnServer,
                    SharedTestSuiteHelper.ConvertToErrorCodeType(joinResponse.ErrorCode, this.Site),
                    "MS-FSSHTTP",
                    1555,
                    @"[In Join Coauthoring Session]  If the coauthorable file is checked out on the server and checked out by a client with a different user name than the current client, the protocol server returns an error code value set to ""FileAlreadyCheckedOutOnServer"".");
            }
            else
            {
                Site.Assert.AreEqual <ErrorCodeType>(
                    ErrorCodeType.FileAlreadyCheckedOutOnServer,
                    SharedTestSuiteHelper.ConvertToErrorCodeType(joinResponse.ErrorCode, this.Site),
                    @"[When sending Join Coauthoring Session subrequest] If the coauthorable file is checked out on the server and checked out by a client with a different user name than the current client, the protocol server returns an error code value set to ""FileAlreadyCheckedOutOnServer"".");
            }

            bool isVerifyR385 = joinResponse.ErrorMessage != null && joinResponse.ErrorMessage.IndexOf(this.UserName02, StringComparison.OrdinalIgnoreCase) >= 0;

            if (SharedContext.Current.IsMsFsshttpRequirementsCaptured)
            {
                this.Site.Log.Add(
                    LogEntryKind.Debug,
                    "For the requirement MS-FSSHTTP_R385, the error message should contain the user name {0}, actual value is {1}",
                    this.UserName02,
                    joinResponse.ErrorMessage);

                Site.CaptureRequirementIfIsTrue(
                    isVerifyR385,
                    "MS-FSSHTTP",
                    385,
                    @"[In LockAndCoauthRelatedErrorCodeTypes][FileAlreadyCheckedOutOnServer] When the ""FileAlreadyCheckedOutOnServer"" error code is returned as the error code value in the SubResponse element, the protocol server returns the identity of the user who has currently checked out the file in the error message attribute.");
            }
            else
            {
                this.Site.Log.Add(
                    LogEntryKind.Debug,
                    "The error message should contain the user name {0}, actual value is {1}",
                    this.UserName02,
                    joinResponse.ErrorMessage);

                Site.Assert.IsTrue(
                    isVerifyR385,
                    @"When the ""FileAlreadyCheckedOutOnServer"" error code is returned as the error code value in the SubResponse element, the protocol server returns the identity of the user who has currently checked out the file in the error message attribute.");
            }

            // Refresh the Coauthoring Session, if the coauthorable file is checked out on the server and is checked out by a client with a different user name,
            // the server returns a FileAlreadyCheckedOutOnServer error code.
            subRequest   = SharedTestSuiteHelper.CreateCoauthSubRequestForRefreshCoauthoringSession(SharedTestSuiteHelper.DefaultClientID, SharedTestSuiteHelper.ReservedSchemaLockID);
            cellResponse = this.Adapter.CellStorageRequest(this.DefaultFileUrl, new SubRequestType[] { subRequest });
            CoauthSubResponseType refreshResponse = SharedTestSuiteHelper.ExtractSubResponse <CoauthSubResponseType>(cellResponse, 0, 0, this.Site);

            isVerifyR385 = refreshResponse.ErrorMessage != null && refreshResponse.ErrorMessage.IndexOf(this.UserName02, StringComparison.OrdinalIgnoreCase) >= 0;
            if (SharedContext.Current.IsMsFsshttpRequirementsCaptured)
            {
                if (Common.IsRequirementEnabled("MS-FSSHTTP-FSSHTTPB", 1566, this.Site))
                {
                    // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1566
                    Site.CaptureRequirementIfAreEqual <ErrorCodeType>(
                        ErrorCodeType.FileAlreadyCheckedOutOnServer,
                        SharedTestSuiteHelper.ConvertToErrorCodeType(refreshResponse.ErrorCode, this.Site),
                        "MS-FSSHTTP",
                        1566,
                        @"[In Refresh Coauthoring Session][When sending Refresh Coauthoring Session subrequest] If the coauthorable file is checked out on the server and checked out by a client with a different user name than the current client, the protocol server returns an error code value set to ""FileAlreadyCheckedOutOnServer"".");
                }
                this.Site.Log.Add(
                    LogEntryKind.Debug,
                    "For the requirement MS-FSSHTTP_R385, the error message should contain the user name {0}, actual value is {1}",
                    this.UserName02,
                    refreshResponse.ErrorMessage);

                Site.CaptureRequirementIfIsTrue(
                    isVerifyR385,
                    "MS-FSSHTTP",
                    385,
                    @"[In LockAndCoauthRelatedErrorCodeTypes][FileAlreadyCheckedOutOnServer] When the ""FileAlreadyCheckedOutOnServer"" error code is returned as the error code value in the SubResponse element, the protocol server returns the identity of the user who has currently checked out the file in the error message attribute.");
            }
            else
            {
                if (Common.IsRequirementEnabled("MS-FSSHTTP-FSSHTTPB", 1566, this.Site))
                {
                    Site.Assert.AreEqual <ErrorCodeType>(
                        ErrorCodeType.FileAlreadyCheckedOutOnServer,
                        SharedTestSuiteHelper.ConvertToErrorCodeType(refreshResponse.ErrorCode, this.Site),
                        @"[When sending Refresh Coauthoring Session subrequest]If the coauthorable file is checked out on the server and checked out by a client with a different user name than the current client, the protocol server returns an error code value set to ""FileAlreadyCheckedOutOnServer"".");
                }

                this.Site.Log.Add(
                    LogEntryKind.Debug,
                    "The error message should contain the user name {0}, actual value is {1}",
                    this.UserName02,
                    refreshResponse.ErrorMessage);

                Site.Assert.IsTrue(
                    isVerifyR385,
                    @"When the ""FileAlreadyCheckedOutOnServer"" error code is returned as the error code value in the SubResponse element, the protocol server returns the identity of the user who has currently checked out the file in the error message attribute.");
            }

            // Check Lock Availability of the Coauthoring Session, if the file is already checked out by a different user,
            // the server returns a FileAlreadyCheckedOutOnServer error code.
            subRequest   = SharedTestSuiteHelper.CreateCoauthSubRequestForCheckLockAvailability(SharedTestSuiteHelper.DefaultClientID, SharedTestSuiteHelper.ReservedSchemaLockID);
            cellResponse = this.Adapter.CellStorageRequest(this.DefaultFileUrl, new SubRequestType[] { subRequest });
            CoauthSubResponseType checkResponse = SharedTestSuiteHelper.ExtractSubResponse <CoauthSubResponseType>(cellResponse, 0, 0, this.Site);

            // Add the log information.
            Site.Log.Add(LogEntryKind.Debug, "The errorCode for Check Lock Availability SubRequest is :{0}", checkResponse.ErrorCode);
            if (Common.IsRequirementEnabled("MS-FSSHTTP-FSSHTTPB", 1082, this.Site))
            {
                if (SharedContext.Current.IsMsFsshttpRequirementsCaptured)
                {
                    // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1082
                    Site.CaptureRequirementIfAreEqual <ErrorCodeType>(
                        ErrorCodeType.FileAlreadyCheckedOutOnServer,
                        SharedTestSuiteHelper.ConvertToErrorCodeType(checkResponse.ErrorCode, this.Site),
                        "MS-FSSHTTP",
                        1082,
                        @"[In Check Lock Availability] If the coauthorable file is checked out on the server and it is checked out by a client with a different user name than the current client, the protocol server returns an error code value set to ""FileAlreadyCheckedOutOnServer"".");
                }
                else
                {
                    Site.Assert.AreEqual <ErrorCodeType>(
                        ErrorCodeType.FileAlreadyCheckedOutOnServer,
                        SharedTestSuiteHelper.ConvertToErrorCodeType(checkResponse.ErrorCode, this.Site),
                        @"[When sending check lock availability subrequest]If the coauthorable file is checked out on the server and it is checked out by a client with a different user name than the current client, the protocol server returns an error code value set to ""FileAlreadyCheckedOutOnServer"".");
                }
            }
        }
Пример #14
0
        public void TestCase_S10_TC09_DependencyTypeOnExecute()
        {
            // Initialize the service
            this.InitializeContext(this.DefaultFileUrl, this.UserName01, this.Password01, this.Domain);

            // Create a coauthoring subRequest with all valid parameters.
            CoauthSubRequestType firstCoauthSubRequest = SharedTestSuiteHelper.CreateCoauthSubRequestForJoinCoauthSession(SharedTestSuiteHelper.DefaultClientID, SharedTestSuiteHelper.ReservedSchemaLockID);

            // Create another coauthoring subRequest which depends on the previous coauthoring subRequest and set the dependency type to OnFail so as to make the second subRequest not executed.
            CoauthSubRequestType secondCoauthSubRequest = SharedTestSuiteHelper.CreateCoauthSubRequestForJoinCoauthSession(Guid.NewGuid().ToString(), SharedTestSuiteHelper.ReservedSchemaLockID);

            secondCoauthSubRequest.DependencyType          = DependencyTypes.OnFail;
            secondCoauthSubRequest.DependencyTypeSpecified = true;
            secondCoauthSubRequest.DependsOn = firstCoauthSubRequest.SubRequestToken;

            // Create a serverTime subRequest which depends on the second coauthoring subRequest and set the dependency type to OnExecute.
            // Create a ServerTime subRequest which depends on the coauthoring subRequest.
            ServerTimeSubRequestType serverTimeSubRequest = SharedTestSuiteHelper.CreateServerTimeSubRequest(SequenceNumberGenerator.GetCurrentToken());

            serverTimeSubRequest.DependsOn               = secondCoauthSubRequest.SubRequestToken;
            serverTimeSubRequest.DependencyType          = DependencyTypes.OnExecute;
            serverTimeSubRequest.DependencyTypeSpecified = true;

            // Send these three subRequests to the protocol server, expect the protocol server returns error code "Success" for the first coauthoring subRequest, returns "DependentOnlyOnFailRequestSucceeded" for the second coauthoring subRequest and returns "DependentRequestNotExecuted" for the severTime subRequest.
            CellStorageResponse response = this.Adapter.CellStorageRequest(this.DefaultFileUrl, new SubRequestType[] { firstCoauthSubRequest, secondCoauthSubRequest, serverTimeSubRequest });

            this.StatusManager.RecordCoauthSession(this.DefaultFileUrl, SharedTestSuiteHelper.DefaultClientID, SharedTestSuiteHelper.ReservedSchemaLockID);
            CoauthSubResponseType firstCoauthSubResponse = SharedTestSuiteHelper.ExtractSubResponse <CoauthSubResponseType>(response, 0, 0, this.Site);

            this.Site.Assert.AreEqual <ErrorCodeType>(ErrorCodeType.Success, SharedTestSuiteHelper.ConvertToErrorCodeType(firstCoauthSubResponse.ErrorCode, this.Site), "The first coauthoring operation should succeed.");
            CoauthSubResponseType secondCoauthSubResponse = SharedTestSuiteHelper.ExtractSubResponse <CoauthSubResponseType>(response, 0, 1, this.Site);

            this.Site.Assert.AreEqual <ErrorCodeType>(ErrorCodeType.DependentOnlyOnFailRequestSucceeded, SharedTestSuiteHelper.ConvertToErrorCodeType(secondCoauthSubResponse.ErrorCode, this.Site), "The second coauthoring operation should not be executed.");
            ServerTimeSubResponseType serverTimeSubResponse = SharedTestSuiteHelper.ExtractSubResponse <ServerTimeSubResponseType>(response, 0, 2, this.Site);

            if (SharedContext.Current.IsMsFsshttpRequirementsCaptured)
            {
                if (Common.IsRequirementEnabled("MS-FSSHTTP-FSSHTTPB", 332, this.Site))
                {
                    // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R332
                    Site.CaptureRequirementIfAreEqual <ErrorCodeType>(
                        ErrorCodeType.DependentRequestNotExecuted,
                        SharedTestSuiteHelper.ConvertToErrorCodeType(serverTimeSubResponse.ErrorCode, this.Site),
                        "MS-FSSHTTP",
                        332,
                        @"[In DependencyTypes] OnExecute:Indicates that the subrequest MUST be processed only on the execution of the other subrequest. (Microsoft SharePoint Foundation 2013/Microsoft SharePoint Server 2013 follow this behavior.)");

                    Site.CaptureRequirementIfAreEqual <ErrorCodeType>(
                        ErrorCodeType.DependentRequestNotExecuted,
                        SharedTestSuiteHelper.ConvertToErrorCodeType(serverTimeSubResponse.ErrorCode, this.Site),
                        "MS-FSSHTTP",
                        321,
                        @"[In DependencyCheckRelatedErrorCodeTypes] DependentRequestNotExecuted: 
                             Indicates an error when the subrequest on which this specific subrequest is dependent has not been executed and the DependencyType attribute in this subrequest is set to ""OnExecute"".");
                }
            }
            else
            {
                Site.Assert.AreEqual <ErrorCodeType>(
                    ErrorCodeType.DependentRequestNotExecuted,
                    SharedTestSuiteHelper.ConvertToErrorCodeType(serverTimeSubResponse.ErrorCode, this.Site),
                    @"[In DependencyTypes] OnExecute:Indicates that the subrequest MUST be processed only on the execution of the other subrequest. (Microsoft SharePoint Foundation 2013/Microsoft SharePoint Server 2013 follow this behavior.)");
            }
        }
        /// <summary>
        /// This method is used to test whether the lock with the specified id exist on the file.
        /// </summary>
        /// <param name="file">Specify the file.</param>
        /// <param name="schemaLockId">Specify the schemaLock ID.</param>
        /// <param name="userName">Specify the user name of the user who calls cell storage service.</param>
        /// <param name="password">Specify the password of the user who calls cell storage service.</param>
        /// <param name="domain">Specify the domain of the user who calls cell storage service.</param>
        /// <returns>Return true if exist, otherwise return false.</returns>
        protected bool CheckSchemaLockExist(string file, string schemaLockId, string userName, string password, string domain)
        {
            this.InitializeContext(file, userName, password, domain);

            // Generate a new schema lock id value which is different with the given one.
            System.Guid newId;
            do
            {
                newId = System.Guid.NewGuid();
            }while (newId == new System.Guid(schemaLockId));

            if (Common.IsRequirementEnabled("MS-FSSHTTP-FSSHTTPB", 93101, this.Site))
            {
                // Check the schema lock availability using the new schema lock id.
                SchemaLockSubRequestType subRequest = SharedTestSuiteHelper.CreateSchemaLockSubRequest(SchemaLockRequestTypes.CheckLockAvailability, null, null);
                subRequest.SubRequestData.SchemaLockID = newId.ToString();
                CellStorageResponse       response = this.Adapter.CellStorageRequest(file, new SubRequestType[] { subRequest });
                SchemaLockSubResponseType schemaLockSubResponse = SharedTestSuiteHelper.ExtractSubResponse <SchemaLockSubResponseType>(response, 0, 0, this.Site);

                ErrorCodeType error = SharedTestSuiteHelper.ConvertToErrorCodeType(schemaLockSubResponse.ErrorCode, this.Site);
                if (error == ErrorCodeType.FileAlreadyLockedOnServer)
                {
                    // Now there could be kind of two conditions:
                    //  1) There is an exclusive lock
                    //  2) There is a schema lock
                    // So it is needed to check the schema lock with the given schema lock id should exist.
                    subRequest = SharedTestSuiteHelper.CreateSchemaLockSubRequest(SchemaLockRequestTypes.CheckLockAvailability, null, null);
                    subRequest.SubRequestData.SchemaLockID = schemaLockId;
                    response = this.Adapter.CellStorageRequest(file, new SubRequestType[] { subRequest });
                    schemaLockSubResponse = SharedTestSuiteHelper.ExtractSubResponse <SchemaLockSubResponseType>(response, 0, 0, this.Site);

                    return(SharedTestSuiteHelper.ConvertToErrorCodeType(schemaLockSubResponse.ErrorCode, this.Site) == ErrorCodeType.Success);
                }
                else
                {
                    if (error != ErrorCodeType.Success)
                    {
                        this.Site.Assert.Fail(
                            "If the schema lock {0} does not exist, check the schema lock using the id {0} should success, but actual the result is {2}",
                            schemaLockId,
                            newId.ToString(),
                            error.ToString());
                    }

                    return(false);
                }
            }
            else if (Common.IsRequirementEnabled("MS-FSSHTTP-FSSHTTPB", 93102, this.Site))
            {
                // Check the schema lock availability using the new schema lock id.
                CoauthSubRequestType  subRequest        = SharedTestSuiteHelper.CreateCoauthSubRequestForCheckLockAvailability(SharedTestSuiteHelper.DefaultClientID, newId.ToString());
                CellStorageResponse   response          = this.Adapter.CellStorageRequest(file, new SubRequestType[] { subRequest });
                CoauthSubResponseType coauthSubResponse = SharedTestSuiteHelper.ExtractSubResponse <CoauthSubResponseType>(response, 0, 0, this.Site);

                ErrorCodeType error = SharedTestSuiteHelper.ConvertToErrorCodeType(coauthSubResponse.ErrorCode, this.Site);
                if (error == ErrorCodeType.FileAlreadyLockedOnServer)
                {
                    // Now there could be kind of two conditions:
                    //  1) There is an exclusive lock
                    //  2) There is a schema lock
                    // So it is needed to check the schema lock with the given schema lock id should exist.
                    subRequest        = SharedTestSuiteHelper.CreateCoauthSubRequestForCheckLockAvailability(SharedTestSuiteHelper.DefaultClientID, schemaLockId);
                    response          = this.Adapter.CellStorageRequest(file, new SubRequestType[] { subRequest });
                    coauthSubResponse = SharedTestSuiteHelper.ExtractSubResponse <CoauthSubResponseType>(response, 0, 0, this.Site);

                    return(SharedTestSuiteHelper.ConvertToErrorCodeType(coauthSubResponse.ErrorCode, this.Site) == ErrorCodeType.Success);
                }
                else
                {
                    if (error != ErrorCodeType.Success)
                    {
                        this.Site.Assert.Fail(
                            "If the schema lock {0} does not exist, check the schema lock using the id {0} should success, but actual the result is {2}",
                            schemaLockId,
                            newId.ToString(),
                            error.ToString());
                    }

                    return(false);
                }
            }

            this.Site.Assert.Fail("The server should at least support one of operations: Coauthoring session and Schema Lock");
            return(false);
        }