コード例 #1
0
        /// <summary>
        /// This method is used to parse the GetServerInfoResult from xml to class.
        /// </summary>
        /// <param name="serverInfo">A string indicates the serverInfo returned by the protocol server.</param>
        /// <returns>A serverInfo parsed from the response.</returns>
        private ServerInfo ParseGetServerInfoResult(string serverInfo)
        {
            ServerInfo info = new ServerInfo();

            // Read string in SubmitFileResult response
            XmlDocument document = new XmlDocument();
            document.LoadXml(serverInfo);

            XmlNodeList nodeList = null;
            XmlNode node = null;

            nodeList = document.GetElementsByTagName("ServerType");
            if (nodeList != null && nodeList.Count == 1)
            {
                node = nodeList[0];
                info.ServerType = node.InnerText;
            }

            nodeList = document.GetElementsByTagName("ServerVersion");
            if (nodeList != null && nodeList.Count == 1)
            {
                node = nodeList[0];
                info.ServerVersion = node.InnerText;
            }

            nodeList = document.GetElementsByTagName("RoutingWeb");
            if (nodeList != null && nodeList.Count == 1)
            {
                node = nodeList[0];
                info.RoutingWeb = node.InnerText;
            }

            return info;
        }
コード例 #2
0
        public void MSOFFICIALFILE_S03_TC01_GetServerInfo()
        {
            // Initial parameters to use a repository that is configured for routing content
            InitialPara paras = new InitialPara();

            paras.Url      = this.EnableRoutingFeatureRecordsCenterServiceUrl;
            paras.UserName = this.SubmitUserName;
            paras.Domain   = this.DomainName;
            paras.Password = this.Password;

            this.Adapter.IntializeService(paras);

            // Retrieves data about the type, version of the repository
            // we just add one hold in server for test
            ServerInfo serverInfo = this.Adapter.GetServerInfo();

            // Verify MS-OFFICIALFILE requirement: MS-OFFICIALFILE_R186
            // Not null means adapter has checked structure of message, so this can be captured.
            Site.CaptureRequirementIfIsNotNull(
                serverInfo,
                "MS-OFFICIALFILE",
                186,
                @"[In GetServerInfo] The protocol client sends a GetServerInfoSoapIn request WSDL message, and the protocol server MUST respond with a GetServerInfoSoapOut response WSDL message.");

            if (Common.Common.IsRequirementEnabled(3702, this.Site))
            {
                // Verify MS-OFFICIALFILE requirement: MS-OFFICIALFILE_R3702
                // Not null means adapter has checked structure of message, so this can be captured.
                Site.CaptureRequirementIfIsNull(
                    serverInfo.RoutingWeb,
                    "MS-OFFICIALFILE",
                    3702,
                    @"[In Appendix C: Product Behavior] Implementation does not include RoutingWeb element. <4> Section 2.2.4.4:  Office SharePoint Server 2007 does not use this element [RoutingWeb].");
            }

            if (Common.Common.IsRequirementEnabled(1031, this.Site))
            {
                // Verify MS-OFFICIALFILE requirement: MS-OFFICIALFILE_R1031
                Site.CaptureRequirementIfIsNotNull(
                    serverInfo.RoutingWeb,
                    "MS-OFFICIALFILE",
                    1031,
                    @"[In Appendix C: Product Behavior] Implementation does include RoutingWeb element. (Microsoft SharePoint Server 2010 and above follow this behavior.)");
            }

            if (Common.Common.IsRequirementEnabled(268, this.Site))
            {
                // Verify MS-OFFICIALFILE requirement: MS-OFFICIALFILE_R268
                bool isServerTypeVerified    = string.Compare("Microsoft.Office.Server", serverInfo.ServerType, true) == 0;
                bool isServerVersionVerified = string.Compare("Microsoft.Office.OfficialFileSoap, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c", serverInfo.ServerVersion, true) == 0;

                Site.Assert.IsTrue(
                    isServerTypeVerified,
                    "When MS-OFFICIALFILE_R268 is enabled, the ServerType should return Microsoft.Office.Server, actual result is {0}",
                    serverInfo.ServerType);

                Site.Assert.IsTrue(
                    isServerVersionVerified,
                    "When MS-OFFICIALFILE_R268 is enabled, the ServerVersion should return Microsoft.Office.OfficialFileSoap, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, actual result is {0}",
                    serverInfo.ServerVersion);

                Site.CaptureRequirementIfIsTrue(
                    isServerTypeVerified && isServerVersionVerified,
                    "MS-OFFICIALFILE",
                    268,
                    @"[In Appendix C: Product Behavior] Implementation does return implementation-specific information in the ServerInfo element. <9> Section 3.1.4.5:  Office SharePoint Server 2007 returns ""Microsoft.Office.Server"" as the ServerType and ""Microsoft.Office.OfficialFileSoap, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"" as the ServerVersion.");
            }

            if (Common.Common.IsRequirementEnabled(269, this.Site))
            {
                // Verify MS-OFFICIALFILE requirement: MS-OFFICIALFILE_R269
                bool isServerTypeVerified    = string.Compare("Microsoft.Office.Server v4", serverInfo.ServerType, true) == 0;
                bool isServerVersionVerified = string.Compare("Microsoft.Office.OfficialFileSoap, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c", serverInfo.ServerVersion, true) == 0;

                Site.Assert.IsTrue(
                    isServerTypeVerified,
                    "When MS-OFFICIALFILE_R269 is enabled, the ServerType should return Microsoft.Office.Server v4, actual result is {0}",
                    serverInfo.ServerType);

                Site.Assert.IsTrue(
                    isServerVersionVerified,
                    "When MS-OFFICIALFILE_R269 is enabled, the ServerVersion should return Microsoft.Office.OfficialFileSoap, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, actual result is {0}",
                    serverInfo.ServerVersion);

                Site.CaptureRequirementIfIsTrue(
                    isServerTypeVerified && isServerVersionVerified,
                    "MS-OFFICIALFILE",
                    269,
                    @"[In Appendix C: Product Behavior] Implementation does return implementation-specific information in the ServerInfo element. [<9> Section 3.1.4.5:] SharePoint Server 2010 returns ""Microsoft.Office.Server v4"" as the ServerType and "" Microsoft.Office.OfficialFileSoap, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"" as the ServerVersion.");
            }

            if (Common.Common.IsRequirementEnabled(357, this.Site))
            {
                // Verify MS-OFFICIALFILE requirement: MS-OFFICIALFILE_R357
                bool isServerTypeVerified    = string.Compare("Microsoft.Office.Server v4", serverInfo.ServerType, true) == 0;
                bool isServerVersionVerified = string.Compare("Microsoft.Office.OfficialFileSoap, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c", serverInfo.ServerVersion, true) == 0;

                Site.Assert.IsTrue(
                    isServerTypeVerified,
                    "When MS-OFFICIALFILE_R357 is enabled, the ServerType should return Microsoft.Office.Server v4, actual result is {0}",
                    serverInfo.ServerType);

                Site.Assert.IsTrue(
                    isServerVersionVerified,
                    "When MS-OFFICIALFILE_R357 is enabled, the ServerVersion should return Microsoft.Office.OfficialFileSoap, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, actual result is {0}",
                    serverInfo.ServerVersion);

                Site.CaptureRequirementIfIsTrue(
                    isServerTypeVerified && isServerVersionVerified,
                    "MS-OFFICIALFILE",
                    357,
                    @"[In Appendix C: Product Behavior] Implementation does return implementation-specific information in the ServerInfo element. [<9> Section 3.1.4.5:] SharePoint Server 2013 returns ""Microsoft.Office.Server v4"" as the ServerType and "" Microsoft.Office.OfficialFileSoap, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"" as the ServerVersion.");
            }
        }