public void MSSITESS_S01_TC02_ExportingMutiplePackages()
{
Site.Assume.IsTrue(Common.IsRequirementEnabled(5311, this.Site), @"Test is executed only when R5311Enabled is set to true.");
#region Variables
string exportUrl = Common.GetConfigurationPropertyValue(Constants.SpecialSubsiteUrl, this.Site);
string exportUrlLowerCase = Common.GetConfigurationPropertyValue(Constants.SpecialSubsiteUrl, this.Site).ToLower(System.Globalization.CultureInfo.CurrentCulture);
string dataPath = Common.GetConfigurationPropertyValue(Constants.DataPath, this.Site);
string exportJobName = Constants.ExportJobName + Common.FormatCurrentDateTime();
int cabSize = 1;
int exportWebResult = 0;
string[] exportWebFilesWithCabSize1 = null;
string[] expectedWebFilesWithCabSize1 = null;
#endregion Variables
// Initialize the web service with an authenticated account.
this.sitessAdapter.InitializeWebService(UserAuthenticationOption.Authenticated);
if (Common.IsRequirementEnabled(7411, this.Site))
{
// Invoke the ExportWeb operation with webUrl in lower case. Since The webUrl SHOULD be case-sensitive, 4 is expected to be returned.
exportWebResult = this.sitessAdapter.ExportWeb(Constants.ExportJobName, exportUrlLowerCase, dataPath, true, true, true, cabSize);
#region Capture requirements
// If 4 is returned, MS-SITESS_R7411 can be captured.
Site.Log.Add(LogEntryKind.Debug, "Verify MS-SITESS_R7411");
// Verify MS-SITESS requirement: MS-SITESS_R7411
Site.CaptureRequirementIfAreEqual<int>(
4,
exportWebResult,
7411,
@"[In ExportWeb] [webUrl:] Implementation does be case-sensitive.(Windows SharePoint Services 3.0 and above products follow this behavior.)");
// If 4 is returned, MS-SITESS_R57 can be captured.
this.VerifyExportWebErrorCode(exportWebResult);
#endregion Capture requirements
}
// Invoke the ExportWeb operation with cabSize set to 1, 1 is expected to be returned and two cmp files are expected to be exported.
exportWebResult = this.sitessAdapter.ExportWeb(exportJobName, exportUrl, dataPath, true, true, true, cabSize);
#region Capture requirements
// If 1 is returned, requirements related with ExportWeb pending can be verified.
this.VerifyExportWebInProgress(exportWebResult);
#endregion Capture requirements
string files = TestSuiteHelper.VerifyExportAndImportFile(exportJobName, 3, this.Site, this.sutAdapter);
exportWebFilesWithCabSize1 = files == null ? null : files.TrimEnd(new char[] { ';' }).Split(';');
// As specified in MS-SITESS protocol section 3.1.4.2.2.1, if multiple content migration package files are created,
// then the server MUST also append a positive, incrementing integer to the name of each subsequent content migration package file.
expectedWebFilesWithCabSize1 = new string[]
{
exportJobName + Constants.SntExtension,
exportJobName + Constants.CmpExtension,
exportJobName + "1" + Constants.CmpExtension
};
#region Capture requirements
// If exported files are consistent with the expected, it means multiple cmp files
// are created and a positive, incrementing integer is append to the second file's
// name (i.e. ExportWeb.cmp & ExportWeb1.cmp), R73 can be captured.
Site.Log.Add(LogEntryKind.Debug, "Verify MS-SITESS_R73: the exported file name list is {0}", files);
// Verify MS-SITESS requirement: MS-SITESS_R73
bool isVerifyR73 = AdapterHelper.CompareStringArrays(expectedWebFilesWithCabSize1, exportWebFilesWithCabSize1);
Site.CaptureRequirementIfIsTrue(
isVerifyR73,
73,
@"[In ExportWeb] [jobName:] If multiple content migration package files are created, then the server MUST also append a positive, incrementing integer to the name of each subsequent content migration package file.");
// Verify that Microsoft Windows SharePoint Services 3.0 and above support operation ExportWeb.
this.VerifyOperationExportWeb();
#endregion Capture requirements
}