コード例 #1
0
        public void MSCOPYS_S02_TC07_CopyIntoItemsLocal_EncodedAbsUrlField()
        {
            this.Site.Assume.IsTrue(Common.IsRequirementEnabled(232, this.Site), @"This is executed only when R232Enable is set to true.");

            // Get the value of the source file URL.
            string sourceFileUrl = this.GetSourceFileUrl(SourceFileUrlType.SourceFileOnDesSUT);

            // Get the first destination location.
            string desFileUrl = this.GetDestinationFileUrl(DestinationFileUrlType.NormalDesLibraryOnDesSUT);

            string[] desUrls = new string[] { desFileUrl };

            // Retrieve the contents and metadata for a file from the specified location.
            GetItemResponse getitemsResponse = MSCopysAdapter.GetItem(sourceFileUrl);

            this.Site.Assert.IsNotNull(getitemsResponse, "GetItem operation should succeed");

            // Select a field by specified field attribute value.
            FieldInformation fieldInfoScource = this.SelectFieldBySpecifiedAtrribute(
                getitemsResponse.Fields,
                "EncodedAbsUrl",
                FieldAttributeType.InternalName);

            // Copy a file to the destination server.
            CopyIntoItemsLocalResponse copyIntoItemsLocalResponse = MSCopysAdapter.CopyIntoItemsLocal(
                sourceFileUrl,
                desUrls);

            // Verify whether all copy results are successful.
            bool isVerifyCopySuccess = VerifyAllCopyResultsSuccess(copyIntoItemsLocalResponse.Results, true);

            this.Site.Assert.IsTrue(isVerifyCopySuccess, "CopyIntoItemsLocal operation should succeed.");

            // Collect files from specified file URLs.
            this.CollectFileByUrl(desUrls);

            // Retrieve content and metadata for a file that is stored in a source location with first destination URL.
            GetItemResponse getitemsResponseDes = MSCopysAdapter.GetItem(copyIntoItemsLocalResponse.Results[0].DestinationUrl);

            // Select a field by specified field attribute value.
            FieldInformation fieldInfoDes = this.SelectFieldBySpecifiedAtrribute(
                getitemsResponseDes.Fields,
                "EncodedAbsUrl",
                FieldAttributeType.InternalName);

            if (Common.IsRequirementEnabled(232, this.Site))
            {
                // Verify MS-COPYS requirement: MS-COPYS_R232
                this.Site.CaptureRequirementIfAreNotEqual(
                    fieldInfoScource.Value.ToLower(),
                    fieldInfoDes.Value.ToLower(),
                    232,
                    @"[In Appendix B: Product Behavior] CopyIntoItemsLocal operation does not copy the EncodedAbsUrl field.(Windows SharePoint Services 3.0, SharePoint Foundation 2010 and SharePoint Foundation 2013 follow this behavior.)");
            }
        }
コード例 #2
0
        public void MSCOPYS_S02_TC08_CopyIntoItemsLocal_CopySourceField()
        {
            this.Site.Assume.IsTrue(Common.IsRequirementEnabled(149, this.Site), @"This is executed only when R149Enable is set to true.");

            // Get the value of the source file URL.
            string sourceFileUrl = this.GetSourceFileUrl(SourceFileUrlType.SourceFileOnDesSUT);

            // Get the first destination location.
            string desFileUrl = this.GetDestinationFileUrl(DestinationFileUrlType.NormalDesLibraryOnDesSUT);

            string[] desUrls = new string[] { desFileUrl };

            // Copy a file to the destination server.
            CopyIntoItemsLocalResponse copyIntoItemsLocalResponse = MSCopysAdapter.CopyIntoItemsLocal(
                sourceFileUrl,
                desUrls);

            // Verify whether all copy results are successful.
            bool isVerifyCopySuccess = VerifyAllCopyResultsSuccess(copyIntoItemsLocalResponse.Results, true);

            this.Site.Assert.IsTrue(isVerifyCopySuccess, "CopyIntoItemsLocal operation should succeed.");

            // Collect files from specified file URLs.
            this.CollectFileByUrl(desUrls);

            // Retrieve content and metadata for a file that is stored in a source location with first destination URL.
            GetItemResponse getitemsResponseDes = MSCopysAdapter.GetItem(copyIntoItemsLocalResponse.Results[0].DestinationUrl);

            // Select a field by specified field attribute value.
            FieldInformation fieldInfoDes = this.SelectFieldBySpecifiedAtrribute(
                getitemsResponseDes.Fields,
                "_CopySource",
                FieldAttributeType.InternalName);

            // Verify MS-COPYS requirement: MS-COPYS_R149
            this.Site.CaptureRequirementIfAreEqual(
                sourceFileUrl.ToLower(),
                fieldInfoDes.Value.ToLower(),
                149,
                @"[In Appendix B: Product Behavior] [For CopyIntoItemsLocation operation] Implementation [the value of field with internal name _CopySource ] does equal to the value of source location.(SharePoint Foundation 2010 follow this behavior.)");
        }
コード例 #3
0
        public void MSCOPYS_S02_TC09_CopyIntoItemsLocal_CheckFileContent()
        {
            // Get resource from properties,normal source file and normal destination library.
            string sourceFileUrlOnDesSut = this.GetSourceFileUrl(SourceFileUrlType.SourceFileOnDesSUT);

            // Get the first destination location.
            string desFileUrl1 = this.GetDestinationFileUrl(DestinationFileUrlType.NormalDesLibraryOnDesSUT);

            // Get the section destination location.
            string desFileUrl2 = this.GetDestinationFileUrl(DestinationFileUrlType.NormalDesLibraryOnDesSUT);

            string[] desUrls = new string[] { desFileUrl1, desFileUrl2 };

            // Copy files in same SUT.
            CopyIntoItemsLocalResponse copyIntoItemsLocalResponse = MSCopysAdapter.CopyIntoItemsLocal(
                sourceFileUrlOnDesSut,
                desUrls);

            // Verify whether all copy results are successful.
            bool isVerifyCopySuccess = VerifyAllCopyResultsSuccess(copyIntoItemsLocalResponse.Results, true);

            this.Site.Assert.IsTrue(isVerifyCopySuccess, "CopyIntoItemsLocal operation should succeed.");

            // Collect files from specified file URLs.
            this.CollectFileByUrl(desUrls);

            this.Site.Assert.AreEqual(2, copyIntoItemsLocalResponse.Results.Length, "CopyIntoItemsLocal operation return a collection must contain two items if the DestinationUrls have two items in the request.");

            // Retrieve content and metadata for a file that is stored in a source location with first destination URL.
            GetItemResponse getitemsResponseDes1 = MSCopysAdapter.GetItem(copyIntoItemsLocalResponse.Results[0].DestinationUrl);

            // Retrieve content and metadata for a file that is stored in a source location with second destination URL.
            GetItemResponse getitemsResponseDes2 = MSCopysAdapter.GetItem(copyIntoItemsLocalResponse.Results[1].DestinationUrl);

            this.Site.Assert.IsNotNull(getitemsResponseDes1.StreamRawValues, "The element StreamRawValues should be returned.");
            this.Site.Assert.IsNotNull(getitemsResponseDes2.StreamRawValues, "The element StreamRawValues should be returned.");

            // If the contents of the file are equal to the property which is configured, then R168, R285, R265 and R261 should be covered.
            this.Site.Assert.AreEqual(
                Common.GetConfigurationPropertyValue("SourceFileContents", this.Site),
                Encoding.UTF8.GetString(getitemsResponseDes1.StreamRawValues),
                "The file content should equal to the source which is copied to the destination location.");

            this.Site.Assert.AreEqual(
                Common.GetConfigurationPropertyValue("SourceFileContents", this.Site),
                Encoding.UTF8.GetString(getitemsResponseDes2.StreamRawValues),
                "The file content should equal to the source which is copied to the destination location.");

            // Verify MS-COPYS requirement: MS-COPYS_R168
            this.Site.CaptureRequirement(
                168,
                @"[In Message Processing Events and Sequencing Rules] CopyIntoItemsLocal: Copies a file when the destination 
                of the operation is on the same protocol server as the source location.");

            // Verify MS-COPYS requirement: MS-COPYS_R285
            this.Site.CaptureRequirement(
                285,
                @"[In CopyIntoItemsLocal] The protocol server MUST attempt to copy the file to all destination locations that 
                are specified in the request.");

            // Because the server is never be changed, the source location and destination server is the same server all the time.
            // Verify MS-COPYS requirement: MS-COPYS_R265
            this.Site.CaptureRequirement(
                265,
                @"[In CopyIntoItemsLocal] The source location and the destination server refer to the same protocol server for 
                this operation.");

            // Verify MS-COPYS requirement: MS-COPYS_R261
            this.Site.CaptureRequirement(
                261,
                @"[In CopyIntoItemsLocal] The CopyIntoItemsLocal operation copies a file, and the associated metadata, from one 
                location to one or more locations on the same protocol server.");
        }