Exemple #1
0
        public void OpenReadTest()
        {
            string          serverURL = string.Empty;                                       // TODO: Initialize to an appropriate value
            string          username  = string.Empty;                                       // TODO: Initialize to an appropriate value
            string          password  = string.Empty;                                       // TODO: Initialize to an appropriate value
            XWikiHTTPClient target    = new XWikiHTTPClient(serverURL, username, password); // TODO: Initialize to an appropriate value
            Uri             address   = null;                                               // TODO: Initialize to an appropriate value
            Stream          expected  = null;                                               // TODO: Initialize to an appropriate value
            Stream          actual;

            actual = target.OpenRead(address);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
        /// <summary>
        /// Gets a list with the protected pages and spaces in the wiki
        /// The names support whildcards.
        /// </summary>
        /// <returns>A list with the protected pages and spaces in the wiki.</returns>
        public List <String> GetProtectedPages()
        {
            String[] separators = { " ", "\n", "\t", "\r", ";", "\\" };
            String   url        = Addin.serverURL + XWikiURLs.ProtectedPagesURL;

            if (Client.ClientType == XWikiClientType.HTTP_Client)
            {
                XWikiHTTPClient httpClient = (XWikiHTTPClient)Client;
                Stream          data       = httpClient.OpenRead(url);
                StreamReader    reader     = new StreamReader(data);
                String          pages      = reader.ReadToEnd();
                String[]        pagesArray = pages.Split(separators, StringSplitOptions.RemoveEmptyEntries);
                return(new List <string>(pagesArray));
            }
            else
            {
                return(new List <string>());
            }
        }