Example #1
0
        public void MSFSSHTTP_FSSHTTPB_S07_TC02_EditorsTable_JoinEditSession_EmptyUrl()
        {
            if (!Common.IsRequirementEnabled("MS-FSSHTTP-FSSHTTPB", 9001, this.Site))
            {
                Site.Assume.Inconclusive("Implementation does not support the editors table.");
            }

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

            // Create a EditorsTable subRequest with all valid parameters.
            EditorsTableSubRequestType subRequest = SharedTestSuiteHelper.CreateEditorsTableSubRequestForJoinSession(SharedTestSuiteHelper.DefaultClientID, 3600);

            // Send the serverTime subRequest to the protocol server with Url attribute set to en empty string.
            CellStorageResponse response = this.Adapter.CellStorageRequest(string.Empty, new SubRequestType[] { subRequest });

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R3009
            if (Common.IsRequirementEnabled("MS-FSSHTTP-FSSHTTPB", 3009, this.Site))
            {
                if (SharedContext.Current.IsMsFsshttpRequirementsCaptured)
                {
                    Site.CaptureRequirementIfIsNull(
                        response.ResponseCollection,
                        "MS-FSSHTTP",
                        3009,
                        @"[In Appendix B: Product Behavior] If the Url attribute of the corresponding Request element is an empty string, the implementation does not return Response element. <3> Section 2.2.3.5:  SharePoint Server 2013 will not return Response element.");
                }
                else
                {
                    Site.Assert.IsNull(
                        response.ResponseCollection,
                        @"[In Appendix B: Product Behavior] If the Url attribute of the corresponding Request element is an empty string, the implementation does not return Response element. <3> Section 2.2.3.5:  SharePoint Server 2013 will not return Response element.");
                }
            }
        }
Example #2
0
        public void MSFSSHTTP_FSSHTTPB_S07_TC01_EditorsTable_FileNotExistsOrCannotBeCreated()
        {
            if (!Common.IsRequirementEnabled("MS-FSSHTTP-FSSHTTPB", 9001, this.Site))
            {
                Site.Assume.Inconclusive("Implementation does not support the editors table.");
            }

            // Create a join editor session with the URL which could not be found.
            string url = SharedTestSuiteHelper.GenerateNonExistFileUrl(this.Site);

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

            EditorsTableSubRequestType join = SharedTestSuiteHelper.CreateEditorsTableSubRequestForJoinSession(SharedTestSuiteHelper.DefaultClientID, SharedTestSuiteHelper.DefaultTimeOut);

            // Call protocol adapter operation CellStorageRequest to join the editing session.
            CellStorageResponse         cellStorageResponseJoin = this.Adapter.CellStorageRequest(url, new SubRequestType[] { join });
            EditorsTableSubResponseType subResponseJoin         = SharedTestSuiteHelper.ExtractSubResponse <EditorsTableSubResponseType>(cellStorageResponseJoin, 0, 0, this.Site);

            if (SharedContext.Current.IsMsFsshttpRequirementsCaptured)
            {
                // If the ErrorCode attribute returned equals "FileNotExistsOrCannotBeCreated", MS-FSSHTTP_R1971 and MS-FSSHTTP_R358 can be covered.
                Site.CaptureRequirementIfAreEqual <ErrorCodeType>(
                    ErrorCodeType.FileNotExistsOrCannotBeCreated,
                    SharedTestSuiteHelper.ConvertToErrorCodeType(subResponseJoin.ErrorCode, this.Site),
                    "MS-FSSHTTP",
                    1971,
                    @"[In EditorsTable Subrequest] 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.");

                Site.CaptureRequirementIfAreEqual <ErrorCodeType>(
                    ErrorCodeType.FileNotExistsOrCannotBeCreated,
                    SharedTestSuiteHelper.ConvertToErrorCodeType(subResponseJoin.ErrorCode, this.Site),
                    "MS-FSSHTTP",
                    358,
                    @"[In GenericErrorCodeTypes] FileNotExistsOrCannotBeCreated indicates an error when either the targeted URL for the file specified as part of the Request element does not exist or file creation failed on the protocol server.");
            }
            else
            {
                Site.Assert.AreEqual <ErrorCodeType>(
                    ErrorCodeType.FileNotExistsOrCannotBeCreated,
                    SharedTestSuiteHelper.ConvertToErrorCodeType(subResponseJoin.ErrorCode, this.Site),
                    @"[In GenericErrorCodeTypes] FileNotExistsOrCannotBeCreated indicates an error when either the targeted URL for the file specified as part of the Request element does not exist or file creation failed on the protocol server.");
            }
        }
        /// <summary>
        /// This method is used to prepare to join a editors table on the file using the specified client id.
        /// </summary>
        /// <param name="fileUrl">Specify the file.</param>
        /// <param name="clientId">Specify the client 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 PrepareJoinEditorsTable(string fileUrl, string clientId, string userName, string password, string domain, int timeout = SharedTestSuiteHelper.DefaultTimeOut)
        {
            this.InitializeContext(fileUrl, userName, password, domain);

            // Create join editor session object.
            EditorsTableSubRequestType joinEditorTable = SharedTestSuiteHelper.CreateEditorsTableSubRequestForJoinSession(clientId, timeout);

            // Call protocol adapter operation CellStorageRequest with  EditorsTableRequestType JoinEditingSession.
            CellStorageResponse         response    = this.Adapter.CellStorageRequest(fileUrl, new SubRequestType[] { joinEditorTable });
            EditorsTableSubResponseType subResponse = SharedTestSuiteHelper.ExtractSubResponse <EditorsTableSubResponseType>(response, 0, 0, this.Site);

            this.Site.Assert.AreEqual <ErrorCodeType>(
                ErrorCodeType.Success,
                SharedTestSuiteHelper.ConvertToErrorCodeType(subResponse.ErrorCode, this.Site),
                "The user {0} uses the client id {1} to join the editor table should succeed.",
                userName,
                clientId);

            this.StatusManager.RecordEditorTable(this.DefaultFileUrl, clientId);
        }