public void TestCase_S10_TC01_SubRequestToken()
        {
            // Initialize the service
            this.InitializeContext(this.DefaultFileUrl, this.UserName01, this.Password01, this.Domain);

            ExclusiveLockSubRequestType exclusiveLocksubRequest = SharedTestSuiteHelper.CreateExclusiveLockSubRequest(ExclusiveLockRequestTypes.GetLock);

            // Update the file contents when the coalesce is true.
            CellSubRequestType putChange = SharedTestSuiteHelper.CreateCellSubRequestEmbeddedPutChanges(SequenceNumberGenerator.GetCurrentFSSHTTPBSubRequestID(), System.Text.Encoding.Unicode.GetBytes(SharedTestSuiteHelper.GenerateRandomString(10)));

            putChange.SubRequestData.CoalesceSpecified = true;
            putChange.SubRequestData.Coalesce          = true;

            CellStorageResponse response = this.Adapter.CellStorageRequest(this.DefaultFileUrl, new SubRequestType[] { exclusiveLocksubRequest, putChange });
            int exclusiveIndex           = 0;
            int putchangeIndex           = 0;

            for (int i = 0; i < response.ResponseCollection.Response[0].SubResponse.Length; i++)
            {
                if (response.ResponseCollection.Response[0].SubResponse[i].SubRequestToken == exclusiveLocksubRequest.SubRequestToken)
                {
                    exclusiveIndex = i;
                }
                else if (response.ResponseCollection.Response[0].SubResponse[i].SubRequestToken == putChange.SubRequestToken)
                {
                    putchangeIndex = i;
                }
            }

            ExclusiveLockSubResponseType exclusiveResponse = SharedTestSuiteHelper.ExtractSubResponse <ExclusiveLockSubResponseType>(response, 0, exclusiveIndex, this.Site);
            CellSubResponseType          putChangeResponse = SharedTestSuiteHelper.ExtractSubResponse <CellSubResponseType>(response, 0, putchangeIndex, this.Site);

            this.Site.Assert.AreEqual <ErrorCodeType>(ErrorCodeType.Success, SharedTestSuiteHelper.ConvertToErrorCodeType(exclusiveResponse.ErrorCode, this.Site), "Test case cannot continue unless the get lock sub request succeeds.");
            this.StatusManager.RecordExclusiveLock(this.DefaultFileUrl, exclusiveLocksubRequest.SubRequestData.ExclusiveLockID);
            this.Site.Assert.AreEqual <ErrorCodeType>(ErrorCodeType.Success, SharedTestSuiteHelper.ConvertToErrorCodeType(putChangeResponse.ErrorCode, this.Site), "Test case cannot continue unless the put changes sub request succeeds.");

            this.Site.Assert.AreEqual <int>(
                int.Parse(exclusiveLocksubRequest.SubRequestToken),
                int.Parse(exclusiveResponse.SubRequestToken),
                "Test case cannot run unless the put change response token equals the expected sub request token.");
            this.Site.Assert.AreEqual <int>(
                int.Parse(putChange.SubRequestToken),
                int.Parse(putChangeResponse.SubRequestToken),
                "Test case cannot run unless the put change response token equals the expected sub request token.");

            if (SharedContext.Current.IsMsFsshttpRequirementsCaptured)
            {
                // If both the subRequest tokens are mapping, then MS-FSSHTTP_R1484 and MS-FSSHTTP_R283 can be captured.
                Site.CaptureRequirement(
                    "MS-FSSHTTP",
                    1484,
                    @"[In SubResponseType] SubRequestToken: If client sends 2 SubRequest elements in the Request, in the server response, SubRequestToken uniquely identifies the 2 SubRequest element whose subresponse is being generated as part of the SubResponse element.");

                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R283
                Site.CaptureRequirement(
                    "MS-FSSHTTP",
                    283,
                    @"[In SubResponseType][SubRequestToken] The mapping subresponse that gets generated for the subrequest references the SubRequestToken to indicate that it is the response for that subrequest.");
            }
        }
Example #2
0
        public void TestCase_S10_TC04_DependencyTypeOnNotSupported_Support()
        {
            // Initialize the service
            this.InitializeContext(this.DefaultFileUrl, this.UserName01, this.Password01, this.Domain);

            ExclusiveLockSubRequestType exclusiveLocksubRequest = SharedTestSuiteHelper.CreateExclusiveLockSubRequest(ExclusiveLockRequestTypes.GetLock);

            // Update the file contents when the coalesce is true.
            CellSubRequestType putChange = SharedTestSuiteHelper.CreateCellSubRequestEmbeddedPutChanges(SequenceNumberGenerator.GetCurrentFSSHTTPBSubRequestID(), System.Text.Encoding.Unicode.GetBytes(SharedTestSuiteHelper.GenerateRandomString(10)));

            putChange.SubRequestData.CoalesceSpecified = true;
            putChange.SubRequestData.Coalesce          = true;

            // Make a putChanges subRequest dependent on the exclusive lock and the dependency type is OnNotSupported.
            putChange.DependencyTypeSpecified = true;
            putChange.DependencyType          = DependencyTypes.OnNotSupported;
            putChange.DependsOn = exclusiveLocksubRequest.SubRequestToken;

            CellStorageResponse response = this.Adapter.CellStorageRequest(this.DefaultFileUrl, new SubRequestType[] { exclusiveLocksubRequest, putChange });

            ExclusiveLockSubResponseType exclusiveResponse = SharedTestSuiteHelper.ExtractSubResponse <ExclusiveLockSubResponseType>(response, 0, 0, this.Site);
            CellSubResponseType          putChanges        = SharedTestSuiteHelper.ExtractSubResponse <CellSubResponseType>(response, 0, 1, this.Site);

            this.Site.Assert.AreEqual <ErrorCodeType>(ErrorCodeType.Success, SharedTestSuiteHelper.ConvertToErrorCodeType(exclusiveResponse.ErrorCode, this.Site), "Test case cannot continue unless the get lock sub request succeeds.");
            this.StatusManager.RecordExclusiveLock(this.DefaultFileUrl, exclusiveLocksubRequest.SubRequestData.ExclusiveLockID);

            if (SharedContext.Current.IsMsFsshttpRequirementsCaptured)
            {
                // If the error code equals DependentOnlyOnNotSupportedRequestGetSupported, then capture R324 and R2244
                Site.CaptureRequirementIfAreEqual <ErrorCodeType>(
                    ErrorCodeType.DependentOnlyOnNotSupportedRequestGetSupported,
                    SharedTestSuiteHelper.ConvertToErrorCodeType(putChanges.ErrorCode, this.Site),
                    "MS-FSSHTTP",
                    324,
                    @"[In DependencyCheckRelatedErrorCodeTypes] DependentOnlyOnNotSupportedRequestGetSupported:
                         Indicates an error when the subrequest on which this specific subrequest is dependent is supported and the DependencyType attribute in this subrequest is set to ""OnNotSupported"" or [""OnSuccessOrOnNotSupported""].");

                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2244
                Site.CaptureRequirementIfAreEqual <ErrorCodeType>(
                    ErrorCodeType.DependentOnlyOnNotSupportedRequestGetSupported,
                    SharedTestSuiteHelper.ConvertToErrorCodeType(putChanges.ErrorCode, this.Site),
                    "MS-FSSHTTP",
                    2244,
                    @"[In DependencyTypes] OnNotSupported: Indicates that the subrequest MUST NOT be processed if the other subrequest is supported.");
            }
            else
            {
                Site.Assert.AreEqual <ErrorCodeType>(
                    ErrorCodeType.DependentOnlyOnNotSupportedRequestGetSupported,
                    SharedTestSuiteHelper.ConvertToErrorCodeType(putChanges.ErrorCode, this.Site),
                    @"[In DependencyCheckRelatedErrorCodeTypes] DependentOnlyOnNotSupportedRequestGetSupported:
                        Indicates an error when the subrequest on which this specific subrequest is dependent is supported and the DependencyType attribute in this subrequest is set to ""OnNotSupported"" or [""OnSuccessOrOnNotSupported""].");
            }
        }
        public void TestCase_S15_TC02_UploadContents_CreateFile_ExclusiveLock()
        {
            string randomFileUrl = SharedTestSuiteHelper.GenerateNonExistFileUrl(this.Site);

            // Initialize the context using user01 and defaultFileUrl.
            this.InitializeContext(randomFileUrl, this.UserName01, this.Password01, this.Domain);

            CellSubRequestType putChange = SharedTestSuiteHelper.CreateCellSubRequestEmbeddedPutChanges(SequenceNumberGenerator.GetCurrentFSSHTTPBSubRequestID(), SharedTestSuiteHelper.GenerateRandomFileContent(this.Site));

            putChange.SubRequestData.CoalesceSpecified           = true;
            putChange.SubRequestData.Coalesce                    = true;
            putChange.SubRequestData.ExpectNoFileExistsSpecified = true;
            putChange.SubRequestData.ExpectNoFileExists          = true;
            putChange.SubRequestData.ExclusiveLockID             = SharedTestSuiteHelper.DefaultExclusiveLockID;
            putChange.SubRequestData.Timeout = "3600";

            CellStorageResponse response        = Adapter.CellStorageRequest(randomFileUrl, new SubRequestType[] { putChange });
            CellSubResponseType cellSubResponse = SharedTestSuiteHelper.ExtractSubResponse <CellSubResponseType>(response, 0, 0, this.Site);

            this.Site.Assert.AreEqual <ErrorCodeType>(
                ErrorCodeType.Success,
                SharedTestSuiteHelper.ConvertToErrorCodeType(cellSubResponse.ErrorCode, this.Site),
                "When uploading contents if the protocol server was unable to find the URL for the file specified in the Url attribute,, the server returns success and create a new file using the specified contents in the file URI.");

            bool isExclusiveLock = this.CheckExclusiveLockExist(randomFileUrl, SharedTestSuiteHelper.DefaultExclusiveLockID, this.UserName01, this.Password01, this.Domain);

            Site.Log.Add(
                TestTools.LogEntryKind.Debug,
                "When creating a new file with ExclusiveLockID specified, the server will lock the new created file, but actually it {0}",
                isExclusiveLock ? "locks" : "does not lock");

            Site.Assert.IsTrue(
                isExclusiveLock,
                "When creating a new file with ExclusiveLockID specified, the server will lock the new created file");

            this.StatusManager.RecordExclusiveLock(randomFileUrl, SharedTestSuiteHelper.DefaultExclusiveLockID, this.UserName01, this.Password01, this.Domain);
            this.StatusManager.RecordFileUpload(randomFileUrl);
        }
Example #4
0
        public void TestCase_S10_TC05_DependencyTypeOnSuccessOrNotSupported_OnSuccess()
        {
            // Initialize the service
            this.InitializeContext(this.DefaultFileUrl, this.UserName01, this.Password01, this.Domain);

            ExclusiveLockSubRequestType exclusiveLocksubRequest = SharedTestSuiteHelper.CreateExclusiveLockSubRequest(ExclusiveLockRequestTypes.GetLock);

            // Update the file contents when the coalesce is true.
            CellSubRequestType putChange = SharedTestSuiteHelper.CreateCellSubRequestEmbeddedPutChanges(SequenceNumberGenerator.GetCurrentFSSHTTPBSubRequestID(), System.Text.Encoding.Unicode.GetBytes(SharedTestSuiteHelper.GenerateRandomString(10)));

            putChange.SubRequestData.CoalesceSpecified = true;
            putChange.SubRequestData.Coalesce          = true;

            // Make a putChanges subRequest dependent on the exclusive lock and the dependency type is success.
            putChange.DependencyTypeSpecified = true;
            putChange.DependencyType          = DependencyTypes.OnSuccessOrNotSupported;
            putChange.DependsOn = exclusiveLocksubRequest.SubRequestToken;

            CellStorageResponse response = this.Adapter.CellStorageRequest(this.DefaultFileUrl, new SubRequestType[] { exclusiveLocksubRequest, putChange });

            ExclusiveLockSubResponseType exclusiveResponse = SharedTestSuiteHelper.ExtractSubResponse <ExclusiveLockSubResponseType>(response, 0, 0, this.Site);
            CellSubResponseType          putChanges        = SharedTestSuiteHelper.ExtractSubResponse <CellSubResponseType>(response, 0, 1, this.Site);

            this.Site.Assert.AreEqual <ErrorCodeType>(ErrorCodeType.Success, SharedTestSuiteHelper.ConvertToErrorCodeType(exclusiveResponse.ErrorCode, this.Site), "Test case cannot continue unless the get lock sub request succeeds.");
            this.StatusManager.RecordExclusiveLock(this.DefaultFileUrl, exclusiveLocksubRequest.SubRequestData.ExclusiveLockID);

            this.Site.Assert.AreEqual <ErrorCodeType>(ErrorCodeType.Success, SharedTestSuiteHelper.ConvertToErrorCodeType(putChanges.ErrorCode, this.Site), "Test case cannot continue unless the put changes sub request succeeds.");

            // Make another GetLock request with a different exclusive lock ID.
            exclusiveLocksubRequest = SharedTestSuiteHelper.CreateExclusiveLockSubRequest(ExclusiveLockRequestTypes.GetLock);
            exclusiveLocksubRequest.SubRequestData.ExclusiveLockID = System.Guid.NewGuid().ToString();

            // Also make another putChange request dependent on the new GetLock request.
            putChange = SharedTestSuiteHelper.CreateCellSubRequestEmbeddedPutChanges(SequenceNumberGenerator.GetCurrentFSSHTTPBSubRequestID(), System.Text.Encoding.Unicode.GetBytes(SharedTestSuiteHelper.GenerateRandomString(10)));
            putChange.SubRequestData.CoalesceSpecified = true;
            putChange.SubRequestData.Coalesce          = true;

            // Make a putChanges subRequest dependent on the exclusive lock and the dependency type is success.
            putChange.DependencyTypeSpecified = true;
            putChange.DependencyType          = DependencyTypes.OnSuccessOrNotSupported;
            putChange.DependsOn = exclusiveLocksubRequest.SubRequestToken;

            response = this.Adapter.CellStorageRequest(this.DefaultFileUrl, new SubRequestType[] { exclusiveLocksubRequest, putChange });

            exclusiveResponse = SharedTestSuiteHelper.ExtractSubResponse <ExclusiveLockSubResponseType>(response, 0, 0, this.Site);
            putChanges        = SharedTestSuiteHelper.ExtractSubResponse <CellSubResponseType>(response, 0, 1, this.Site);

            this.Site.Assert.AreNotEqual <ErrorCodeType>(ErrorCodeType.Success, SharedTestSuiteHelper.ConvertToErrorCodeType(exclusiveResponse.ErrorCode, this.Site), "Test case cannot continue unless the get lock sub request fails.");

            if (SharedContext.Current.IsMsFsshttpRequirementsCaptured)
            {
                // If the first putChanges request succeed and the second putChanges request fails, then capture requirement R336 and R32201.
                Site.CaptureRequirementIfAreEqual <ErrorCodeType>(
                    ErrorCodeType.DependentOnlyOnSuccessRequestFailed,
                    SharedTestSuiteHelper.ConvertToErrorCodeType(putChanges.ErrorCode, this.Site),
                    "MS-FSSHTTP",
                    336,
                    @"[In DependencyTypes] OnSuccessOrNotSupported: Indicates that the subrequest MUST be processed only when one of the following conditions is true:
                         On the successful execution of the other subrequest.");

                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R32201
                Site.CaptureRequirementIfAreEqual <ErrorCodeType>(
                    ErrorCodeType.DependentOnlyOnSuccessRequestFailed,
                    SharedTestSuiteHelper.ConvertToErrorCodeType(putChanges.ErrorCode, this.Site),
                    "MS-FSSHTTP",
                    32201,
                    @"[In DependencyCheckRelatedErrorCodeTypes] DependentOnlyOnSuccessRequestFailed: Indicates an error when the subrequest on which this specific subrequest is dependent has failed and the DependencyType attribute in this subrequest is set to [""OnSuccess""] or ""OnSuccessOrNotSupported"".");
            }
            else
            {
                Site.Assert.AreEqual <ErrorCodeType>(
                    ErrorCodeType.DependentOnlyOnSuccessRequestFailed,
                    SharedTestSuiteHelper.ConvertToErrorCodeType(putChanges.ErrorCode, this.Site),
                    @"[In DependencyTypes] OnSuccessOrNotSupported: Indicates that the subrequest MUST be processed only when one of the following conditions is true:
                    On the successful execution of the other subrequest.");
            }
        }
        public void TestCase_S15_TC01_CreateFile()
        {
            string randomFileUrl = SharedTestSuiteHelper.GenerateNonExistFileUrl(this.Site);

            // Initialize the context using user01 and defaultFileUrl.
            this.InitializeContext(randomFileUrl, this.UserName01, this.Password01, this.Domain);

            CellSubRequestType putChange = SharedTestSuiteHelper.CreateCellSubRequestEmbeddedPutChanges(SequenceNumberGenerator.GetCurrentFSSHTTPBSubRequestID(), SharedTestSuiteHelper.GenerateRandomFileContent(this.Site));

            putChange.SubRequestData.CoalesceSpecified = true;
            putChange.SubRequestData.Coalesce          = true;

            CellStorageResponse response        = Adapter.CellStorageRequest(randomFileUrl, new SubRequestType[] { putChange });
            CellSubResponseType cellSubResponse = SharedTestSuiteHelper.ExtractSubResponse <CellSubResponseType>(response, 0, 0, this.Site);

            this.Site.Assert.AreEqual <ErrorCodeType>(
                ErrorCodeType.Success,
                SharedTestSuiteHelper.ConvertToErrorCodeType(cellSubResponse.ErrorCode, this.Site),
                "When uploading contents if the protocol server was unable to find the URL for the file specified in the Url attribute,, the server returns success and create a new file using the specified contents in the file URI.");

            // Query the updated file content.
            CellSubRequestType queryChange = SharedTestSuiteHelper.CreateCellSubRequestEmbeddedQueryChanges(SequenceNumberGenerator.GetCurrentFSSHTTPBSubRequestID());

            response        = Adapter.CellStorageRequest(randomFileUrl, new SubRequestType[] { queryChange });
            cellSubResponse = SharedTestSuiteHelper.ExtractSubResponse <CellSubResponseType>(response, 0, 0, this.Site);

            if (SharedContext.Current.IsMsFsshttpRequirementsCaptured)
            {
                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R3103
                // If queryChange subrequest can download a file from randomFileUrl, then capture MS-FSSHTTP_R3103.
                Site.CaptureRequirementIfAreEqual <ErrorCodeType>(
                    ErrorCodeType.Success,
                    SharedTestSuiteHelper.ConvertToErrorCodeType(cellSubResponse.ErrorCode, this.Site),
                    "MS-FSSHTTP",
                    3103,
                    @"[In Cell Subrequest] But for Put Changes subrequest, as described in [MS-FSSHTTPB] section 2.2.2.1.4, [If the protocol server was unable to find the URL for the file specified in the Url attribute] the protocol server creates a new file using the specified Url.");
            }
            else
            {
                Site.Assert.AreEqual <ErrorCodeType>(
                    ErrorCodeType.Success,
                    SharedTestSuiteHelper.ConvertToErrorCodeType(cellSubResponse.ErrorCode, this.Site),
                    @"[In Cell Subrequest] But for Put Changes subrequest, as described in [MS-FSSHTTPB] section 2.2.2.1.4, [If the protocol server was unable to find the URL for the file specified in the Url attribute] the protocol server creates a new file using the specified Url.");
            }

            this.StatusManager.RecordFileUpload(randomFileUrl);

            // Re-generate the non-exist file URL again.
            randomFileUrl = SharedTestSuiteHelper.GenerateNonExistFileUrl(this.Site);
            this.InitializeContext(randomFileUrl, this.UserName01, this.Password01, this.Domain);

            putChange.SubRequestData.ExpectNoFileExistsSpecified = true;
            putChange.SubRequestData.ExpectNoFileExists          = true;
            putChange.SubRequestData.Etag = string.Empty;
            putChange.SubRequestData.CoalesceSpecified = true;
            putChange.SubRequestData.Coalesce          = true;
            response        = Adapter.CellStorageRequest(randomFileUrl, new SubRequestType[] { putChange });
            cellSubResponse = SharedTestSuiteHelper.ExtractSubResponse <CellSubResponseType>(response, 0, 0, this.Site);

            if (SharedContext.Current.IsMsFsshttpRequirementsCaptured)
            {
                // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2252
                Site.CaptureRequirementIfAreEqual <ErrorCodeType>(
                    ErrorCodeType.Success,
                    SharedTestSuiteHelper.ConvertToErrorCodeType(cellSubResponse.ErrorCode, this.Site),
                    "MS-FSSHTTP",
                    2252,
                    @"[In Cell Subrequest] In this case[If the ExpectNoFileExists attribute is set to true in a file content upload cell subrequest, the Etag attribute MUST be an empty string], the protocol server MUST NOT cause the cell subrequest to fail with a coherency error if the file does not exist on the server.");
            }
            else
            {
                Site.Assert.AreEqual <ErrorCodeType>(
                    ErrorCodeType.Success,
                    SharedTestSuiteHelper.ConvertToErrorCodeType(cellSubResponse.ErrorCode, this.Site),
                    @"[In Cell Subrequest] In this case[If the ExpectNoFileExists attribute is set to true in a file content upload cell subrequest, the Etag attribute MUST be an empty string], the protocol server MUST NOT cause the cell subrequest to fail with a coherency error if the file does not exist on the server.");
            }

            this.StatusManager.RecordFileUpload(randomFileUrl);
        }
        public void TestCase_S15_TC04_UploadContents_ExclusiveLockSuccess()
        {
            string randomFileUrl = SharedTestSuiteHelper.GenerateNonExistFileUrl(this.Site);

            // Initialize the context using user01 and defaultFileUrl.
            this.InitializeContext(randomFileUrl, this.UserName01, this.Password01, this.Domain);

            CellSubRequestType putChange = SharedTestSuiteHelper.CreateCellSubRequestEmbeddedPutChanges(SequenceNumberGenerator.GetCurrentFSSHTTPBSubRequestID(), SharedTestSuiteHelper.GenerateRandomFileContent(this.Site));

            putChange.SubRequestData.CoalesceSpecified           = true;
            putChange.SubRequestData.Coalesce                    = true;
            putChange.SubRequestData.ExpectNoFileExistsSpecified = true;
            putChange.SubRequestData.ExpectNoFileExists          = true;
            putChange.SubRequestData.ExclusiveLockID             = SharedTestSuiteHelper.DefaultExclusiveLockID;
            putChange.SubRequestData.BypassLockID                = putChange.SubRequestData.ExclusiveLockID;
            putChange.SubRequestData.Timeout = "3600";

            CellStorageResponse response        = Adapter.CellStorageRequest(randomFileUrl, new SubRequestType[] { putChange });
            CellSubResponseType cellSubResponse = SharedTestSuiteHelper.ExtractSubResponse <CellSubResponseType>(response, 0, 0, this.Site);

            this.Site.Assert.AreEqual <ErrorCodeType>(
                ErrorCodeType.Success,
                SharedTestSuiteHelper.ConvertToErrorCodeType(cellSubResponse.ErrorCode, this.Site),
                "When the file is locked by exclusive lock and the ByPassLockID is specified by the valid exclusive lock id, the server returns the error code success.");

            this.StatusManager.RecordExclusiveLock(randomFileUrl, SharedTestSuiteHelper.DefaultExclusiveLockID, this.UserName01, this.Password01, this.Domain);
            this.StatusManager.RecordFileUpload(randomFileUrl);

            if (SharedContext.Current.IsMsFsshttpRequirementsCaptured)
            {
                // If the server responds with the error code "Success",
                // when the above steps show that the client has got an exclusive lock and the PutChange subrequest was sent with BypassLockID equal to ExclusiveLockID,
                // then requirement MS-FSSHTTP_R833 is captured.
                Site.CaptureRequirementIfAreEqual <ErrorCodeType>(
                    ErrorCodeType.Success,
                    SharedTestSuiteHelper.ConvertToErrorCodeType(cellSubResponse.ErrorCode, this.Site),
                    "MS-FSSHTTP",
                    833,
                    @"[In CellSubRequestDataOptionalAttributes][BypassLockID] If a client has got an exclusive lock, this value[BypassLockID] MUST be the same as the value of ExclusiveLockID, as specified in section 2.3.1.1.");

                // If the server responds with "ExclusiveLock" in LockType attribute, the requirement MS-FSSHTTP_R1533 is captured.
                Site.CaptureRequirementIfAreEqual <string>(
                    "ExclusiveLock",
                    cellSubResponse.SubResponseData.LockType.ToString(),
                    "MS-FSSHTTP",
                    1533,
                    @"[In CellSubResponseDataType] The LockType attribute MUST be set to ""ExclusiveLock"" in the cell subresponse if the ExclusiveLockID attribute is sent in the cell subrequest and the protocol server is successfully able to take an exclusive lock.");
            }
            else
            {
                Site.Assert.AreEqual <ErrorCodeType>(
                    ErrorCodeType.Success,
                    SharedTestSuiteHelper.ConvertToErrorCodeType(cellSubResponse.ErrorCode, this.Site),
                    @"[In CellSubRequestDataOptionalAttributes][BypassLockID] If a client has got an exclusive lock, this value[BypassLockID] MUST be the same as the value of ExclusiveLockID, as specified in section 2.3.1.1.");

                Site.Assert.AreEqual <string>(
                    "ExclusiveLock",
                    cellSubResponse.SubResponseData.LockType.ToString(),
                    @"[In CellSubResponseDataType] The LockType attribute MUST be set to ""ExclusiveLock"" in the cell subresponse if the ExclusiveLockID attribute is sent in the cell subrequest and the protocol server is successfully able to take an exclusive lock.");
            }

            // Update contents without the ByPassLockID and coalesce true.
            putChange = SharedTestSuiteHelper.CreateCellSubRequestEmbeddedPutChanges(SequenceNumberGenerator.GetCurrentFSSHTTPBSubRequestID(), SharedTestSuiteHelper.GenerateRandomFileContent(this.Site));
            putChange.SubRequestData.BypassLockID      = null;
            putChange.SubRequestData.CoalesceSpecified = true;
            putChange.SubRequestData.Coalesce          = true;

            response        = Adapter.CellStorageRequest(randomFileUrl, new SubRequestType[] { putChange });
            cellSubResponse = SharedTestSuiteHelper.ExtractSubResponse <CellSubResponseType>(response, 0, 0, this.Site);

            this.Site.Assert.AreEqual <ErrorCodeType>(
                ErrorCodeType.Success,
                SharedTestSuiteHelper.ConvertToErrorCodeType(cellSubResponse.ErrorCode, this.Site),
                "When the file is locked by exclusive lock and the ByPassLockID is not specified, the server returns the error code success.");
        }