Example #1
0
        /// <summary>
        /// This method is used to record the schema 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 schema lock.</param>
        /// <param name="clientId">Specify the client ID of the schema lock.</param>
        /// <param name="schemaLockId">Specify the schema ID of the schema 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 RecordSchemaLock(string fileUrl, string clientId, string schemaLockId, string userName, string password, string domain)
        {
            Action function = () =>
            {
                SchemaLockSubRequestType schemaLockRequest = new SchemaLockSubRequestType();
                schemaLockRequest.SubRequestToken = SequenceNumberGenerator.GetCurrentToken().ToString();
                schemaLockRequest.SubRequestData  = new SchemaLockSubRequestDataType();
                schemaLockRequest.SubRequestData.SchemaLockRequestType          = SchemaLockRequestTypes.ReleaseLock;
                schemaLockRequest.SubRequestData.SchemaLockRequestTypeSpecified = true;
                schemaLockRequest.SubRequestData.SchemaLockID = schemaLockId;
                schemaLockRequest.SubRequestData.ClientID     = clientId;

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

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

                if (!string.Equals("Success", subResponse.ErrorCode, StringComparison.OrdinalIgnoreCase))
                {
                    this.errorMessage.Add(string.Format("Failed to release the schema lock 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);
        }
Example #2
0
        public void MSFSSHTTP_FSSHTTPB_S03_TC01_GetLock_FileNotExistsOrCannotBeCreated()
        {
            // Get a schema lock with 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);

            SchemaLockSubRequestType  subRequest            = SharedTestSuiteHelper.CreateSchemaLockSubRequest(SchemaLockRequestTypes.GetLock, false, null);
            CellStorageResponse       response              = Adapter.CellStorageRequest(fileUrlNotExit, new SubRequestType[] { subRequest });
            SchemaLockSubResponseType schemaLockSubResponse = SharedTestSuiteHelper.ExtractSubResponse <SchemaLockSubResponseType>(response, 0, 0, this.Site);

            if (SharedContext.Current.IsMsFsshttpRequirementsCaptured)
            {
                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1913
                Site.CaptureRequirementIfAreEqual <ErrorCodeType>(
                    ErrorCodeType.FileNotExistsOrCannotBeCreated,
                    SharedTestSuiteHelper.ConvertToErrorCodeType(schemaLockSubResponse.ErrorCode, this.Site),
                    "MS-FSSHTTP",
                    1913,
                    @"[In SchemaLock 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(schemaLockSubResponse.ErrorCode, this.Site),
                    @"[In SchemaLock 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.");
            }
        }
Example #3
0
        public void TestCase_S10_TC07_InvalidRequestDependencyType()
        {
            if (!Common.IsRequirementEnabled("MS-FSSHTTP-FSSHTTPB", 325, this.Site))
            {
                Site.Assume.Inconclusive("Implementation does not return InvalidRequestDependencyType when the sub-request dependency type that is not valid.");
            }

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

            // Create a serverTime subRequest with all valid parameters.
            ServerTimeSubRequestType serverTimeSubRequest = SharedTestSuiteHelper.CreateServerTimeSubRequest(SequenceNumberGenerator.GetCurrentToken());

            // Create a WhoAmI subRequest with all valid parameters and depends on the serverTime subRequest.
            WhoAmISubRequestType whoAmiSubRequest = SharedTestSuiteHelper.CreateWhoAmISubRequest(SequenceNumberGenerator.GetCurrentToken());

            whoAmiSubRequest.DependencyType          = DependencyTypes.Invalid;
            whoAmiSubRequest.DependencyTypeSpecified = true;
            whoAmiSubRequest.DependsOn = serverTimeSubRequest.SubRequestToken;

            // Send the subRequest to the protocol server, expect the protocol server returns error code "InvalidRequestDependencyType".
            CellStorageResponse       response = this.Adapter.CellStorageRequest(this.DefaultFileUrl, new SubRequestType[] { serverTimeSubRequest, whoAmiSubRequest });
            ServerTimeSubResponseType serverTimeSubResponse = SharedTestSuiteHelper.ExtractSubResponse <ServerTimeSubResponseType>(response, 0, 0, this.Site);

            this.Site.Assert.AreEqual <ErrorCodeType>(ErrorCodeType.Success, SharedTestSuiteHelper.ConvertToErrorCodeType(serverTimeSubResponse.ErrorCode, this.Site), "The serverTime operation should succeed.");
            SchemaLockSubResponseType subResponse = SharedTestSuiteHelper.ExtractSubResponse <SchemaLockSubResponseType>(response, 0, 1, this.Site);

            if (SharedContext.Current.IsMsFsshttpRequirementsCaptured)
            {
                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R325
                Site.CaptureRequirementIfAreEqual <ErrorCodeType>(
                    ErrorCodeType.InvalidRequestDependencyType,
                    SharedTestSuiteHelper.ConvertToErrorCodeType(subResponse.ErrorCode, this.Site),
                    "MS-FSSHTTP",
                    325,
                    @"[In DependencyCheckRelatedErrorCodeTypes] InvalidRequestDependencyType: 
                             Indicates an error when a subrequest dependency type that is not valid is specified. (Microsoft SharePoint Foundation 2010/Microsoft SharePoint Server 2010 follow this behavior.)");
            }
            else
            {
                Site.Assert.AreEqual <ErrorCodeType>(
                    ErrorCodeType.InvalidRequestDependencyType,
                    SharedTestSuiteHelper.ConvertToErrorCodeType(subResponse.ErrorCode, this.Site),
                    @"[In DependencyCheckRelatedErrorCodeTypes] InvalidRequestDependencyType: 
                        Indicates an error when a subrequest dependency type that is not valid is specified. (Microsoft SharePoint Foundation 2010/Microsoft SharePoint Server 2010 follow this behavior.)");
            }
        }
        /// <summary>
        /// This method is used to prepare a schema lock 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>
        protected void PrepareSchemaLock(string fileUrl, string clientId, string schemaLockId, string userName, string password, string domain, int timeout = SharedTestSuiteHelper.DefaultTimeOut)
        {
            this.InitializeContext(fileUrl, userName, password, domain);

            // Get a schema
            SchemaLockSubRequestType subRequest = SharedTestSuiteHelper.CreateSchemaLockSubRequest(SchemaLockRequestTypes.GetLock, false, null);

            subRequest.SubRequestData.SchemaLockID = schemaLockId;
            subRequest.SubRequestData.ClientID     = clientId;
            subRequest.SubRequestData.Timeout      = timeout.ToString();
            CellStorageResponse       response = this.Adapter.CellStorageRequest(this.DefaultFileUrl, new SubRequestType[] { subRequest });
            SchemaLockSubResponseType schemaLockSubResponse = SharedTestSuiteHelper.ExtractSubResponse <SchemaLockSubResponseType>(response, 0, 0, this.Site);

            this.Site.Assert.AreEqual <ErrorCodeType>(
                ErrorCodeType.Success,
                SharedTestSuiteHelper.ConvertToErrorCodeType(schemaLockSubResponse.ErrorCode, this.Site),
                "Test case cannot continue unless the user {0} Get schema lock id {1} with client id {3} sub request succeeds on the file {2}.",
                this.UserName01,
                schemaLockId,
                this.DefaultFileUrl,
                clientId);
            this.StatusManager.RecordSchemaLock(this.DefaultFileUrl, subRequest.SubRequestData.ClientID, subRequest.SubRequestData.SchemaLockID, userName, password, domain);
        }
Example #5
0
        public void MSFSSHTTP_FSSHTTPB_S03_TC04_GetLock_Success_ExclusiveLockReturnReason_CheckedOutByCurrentUser()
        {
            // Initialize the service
            this.InitializeContext(this.DefaultFileUrl, this.UserName01, this.Password01, this.Domain);

            // Check out one file by a specified user name.
            bool isCheckOutSuccess = SutManagedAdapter.CheckOutFile(this.DefaultFileUrl, this.UserName01, this.Password01, this.Domain);

            Site.Assert.AreEqual(true, isCheckOutSuccess, "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();

            // Get a schema lock with AllowFallbackToExclusive set to true, expect the server returns the error code "Success".
            SchemaLockSubRequestType  subRequest            = SharedTestSuiteHelper.CreateSchemaLockSubRequest(SchemaLockRequestTypes.GetLock, true, null);
            CellStorageResponse       response              = Adapter.CellStorageRequest(this.DefaultFileUrl, new SubRequestType[] { subRequest });
            SchemaLockSubResponseType schemaLockSubResponse = SharedTestSuiteHelper.ExtractSubResponse <SchemaLockSubResponseType>(response, 0, 0, this.Site);

            this.Site.Assert.AreEqual <ErrorCodeType>(ErrorCodeType.Success, SharedTestSuiteHelper.ConvertToErrorCodeType(schemaLockSubResponse.ErrorCode, this.Site), "The test case cannot continue unless the server responses Success when the user get a schema lock with AllowFallBack attribute true on an already checked out file by the same account.");
            this.StatusManager.RecordExclusiveLock(this.DefaultFileUrl, subRequest.SubRequestData.ExclusiveLockID);

            #region Verify related requirements

            if (SharedContext.Current.IsMsFsshttpRequirementsCaptured)
            {
                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R404
                Site.CaptureRequirementIfAreEqual <string>(
                    "ExclusiveLock",
                    schemaLockSubResponse.SubResponseData.LockType,
                    "MS-FSSHTTP",
                    404,
                    @"[In LockTypes] ExclusiveLock: The string value ""ExclusiveLock"", indicating an exclusive lock on the file.");

                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R406
                Site.CaptureRequirementIfAreEqual <string>(
                    "ExclusiveLock",
                    schemaLockSubResponse.SubResponseData.LockType,
                    "MS-FSSHTTP",
                    406,
                    @"[In LockTypes][ExclusiveLock or 2] In a cell storage service response message, an exclusive lock indicates that an exclusive lock is granted to the current client for that specific file.");

                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1428
                this.Site.Log.Add(
                    LogEntryKind.Debug,
                    "For MS-FSSHTTP_R1428 and MS-FSSHTTP_R717, the ExclusiveLockReturnReason attribute in the response should be specified, actually it is {0}.",
                    schemaLockSubResponse.SubResponseData.ExclusiveLockReturnReasonSpecified ? "specified" : "not specified");

                Site.CaptureRequirementIfIsTrue(
                    schemaLockSubResponse.SubResponseData.ExclusiveLockReturnReasonSpecified,
                    "MS-FSSHTTP",
                    1428,
                    @"[In SubResponseDataOptionalAttributes][ExclusiveLockReturnReason] The ExclusiveLockReturnReason attribute MUST be specified in a subresponse that is generated in response to one of the following types of cell storage service subrequest operations when the LockType attribute in the subresponse is set to ""ExclusiveLock"": A schema lock subrequest of type ""Get lock"".");

                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R717
                Site.CaptureRequirementIfIsTrue(
                    schemaLockSubResponse.SubResponseData.ExclusiveLockReturnReasonSpecified,
                    "MS-FSSHTTP",
                    717,
                    @"[In SchemaLockSubResponseDataType] The ExclusiveLockReturnReason attribute MUST be specified in a schema lock subresponse that is generated in response to a schema lock subrequest of type ""Get lock"" when the LockType attribute in the subresponse is set to ""ExclusiveLock"".");

                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R715
                Site.CaptureRequirementIfAreEqual <ExclusiveLockReturnReasonTypes>(
                    ExclusiveLockReturnReasonTypes.CheckedOutByCurrentUser,
                    schemaLockSubResponse.SubResponseData.ExclusiveLockReturnReason,
                    "MS-FSSHTTP",
                    715,
                    @"[In SchemaLockSubResponseDataType] ExclusiveLockReturnReason: An ExclusiveLockReturnReasonTypes that specifies the reason why an exclusive lock is granted in a schema lock subresponse.");

                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R350
                Site.CaptureRequirementIfAreEqual <ExclusiveLockReturnReasonTypes>(
                    ExclusiveLockReturnReasonTypes.CheckedOutByCurrentUser,
                    schemaLockSubResponse.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 <string>(
                    "ExclusiveLock",
                    schemaLockSubResponse.SubResponseData.LockType,
                    @"[In LockTypes] ExclusiveLock: The string value ""ExclusiveLock"", indicating an exclusive lock on the file.");

                Site.Assert.IsTrue(
                    schemaLockSubResponse.SubResponseData.ExclusiveLockReturnReasonSpecified,
                    @"[In SubResponseDataOptionalAttributes][ExclusiveLockReturnReason] The ExclusiveLockReturnReason attribute MUST be specified in a subresponse that is generated in response to one of the following types of cell storage service subrequest operations when the LockType attribute in the subresponse is set to ""ExclusiveLock"": A schema lock subrequest of type ""Get lock"".");

                Site.Assert.AreEqual <ExclusiveLockReturnReasonTypes>(
                    ExclusiveLockReturnReasonTypes.CheckedOutByCurrentUser,
                    schemaLockSubResponse.SubResponseData.ExclusiveLockReturnReason,
                    @"[In SchemaLockSubResponseDataType] ExclusiveLockReturnReason: An ExclusiveLockReturnReasonTypes that specifies the reason why an exclusive lock is granted in a schema lock subresponse.");
            }

            #endregion
        }
        /// <summary>
        /// Capture requirements related to SchemaLock sub response.
        /// </summary>
        /// <param name="schemaLockSubResponse">The schemaLock response.</param>
        /// <param name="site">An object provides logging, assertions, and SUT adapters for test code onto its execution context.</param>
        public static void ValidateSchemaLockSubResponse(SchemaLockSubResponseType schemaLockSubResponse, ITestSite site)
        {
            ValidateSubResponseType(schemaLockSubResponse as SubResponseType, site);

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1120
            // if can launch this method, the schema matches
            site.CaptureRequirement(
                "MS-FSSHTTP",
                1120,
                @"[In SchemaLock Subrequest][The protocol client sends a schema lock SubRequest message, which is of type SchemaLockSubRequestType,] The protocol server responds with a schema lock SubResponse message, which is of type SchemaLockSubResponseType as specified in section 2.3.1.16.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R4690
            // if can launch this method, the schema matches
            site.CaptureRequirementIfAreEqual <Type>(
                typeof(SchemaLockSubResponseType),
                schemaLockSubResponse.GetType(),
                "MS-FSSHTTP",
                4690,
                @"[In SubResponseElementGenericType] Depending on the Type attribute specified in the SubRequest element, the SubResponseElementGenericType MUST take one of the forms:  SchemaLockSubResponseType.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R5743
            // if can launch this method, the schema matches
            site.CaptureRequirementIfAreEqual <Type>(
                typeof(SchemaLockSubResponseType),
                schemaLockSubResponse.GetType(),
                "MS-FSSHTTP",
                5743,
                @"[In SubResponseType] The SubResponseElementGenericType takes one of the following forms: SchemaLockSubResponseType.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R725
            // if can launch this method, the schema matches
            site.CaptureRequirement(
                "MS-FSSHTTP",
                725,
                @"[In SchemaLockSubResponseType][SchemaLockSubResponseType schema is:]
                     <xs:complexType name=""SchemaLockSubResponseType"">
                      <xs:complexContent>
                       <xs:extension base=""tns:SubResponseType"">
                        <xs:sequence minOccurs=""1"" maxOccurs=""1"">
                          <xs:element name=""SubResponseData"" type=""tns:SchemaLockSubResponseDataType"" />
                        </xs:sequence>
                       </xs:extension>
                      </xs:complexContent>
                     </xs:complexType>");

            if (string.Compare("Success", schemaLockSubResponse.ErrorCode, StringComparison.OrdinalIgnoreCase) == 0)
            {
                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R265
                // if can launch this method, the schema matches
                bool isVerifyR265 = schemaLockSubResponse.SubResponseData != null;

                // If popup the assert, the case run fail.
                site.Assert.IsTrue(
                    isVerifyR265,
                    "For requirement MS-FSSHTTPB_R265, the SubResponseData should not be NULL.");

                // If the above logic is right, MS-FSSHTTP_R265 can be captured.
                site.CaptureRequirement(
                    "MS-FSSHTTP",
                    265,
                    @"[In SubResponseElementGenericType][The SubResponseData element MUST be sent as part of the SubResponse element in a cell storage service response message if the ErrorCode attribute that is part of the SubResponse element is set to a value of ""Success"" and one of the following conditions is true:] The Type attribute that is specified in the SubRequest element is set to a value of ""SchemaLock"".");
            }

            if (schemaLockSubResponse.SubResponseData != null)
            {
                ValidateSchemaLockSubResponseDataType(schemaLockSubResponse.SubResponseData, site);
            }
        }
        /// <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);
        }