示例#1
0
        public void Test52258()
        {
            POIFSFileSystem         fs  = new POIFSFileSystem(_samples.OpenResourceAsStream("TestVisioWithCodepage.vsd"));
            HPSFPropertiesExtractor ext = new HPSFPropertiesExtractor(fs);

            try
            {
                Assert.IsNotNull(ext.DocSummaryInformation);
                Assert.IsNotNull(ext.DocumentSummaryInformationText);
                Assert.IsNotNull(ext.SummaryInformation);
                Assert.IsNotNull(ext.SummaryInformationText);
                Assert.IsNotNull(ext.Text);
            }
            finally
            {
                ext.Close();
            }
        }
示例#2
0
        public void TestConstructors()
        {
            POIFSFileSystem fs;
            HSSFWorkbook    wb;

            try
            {
                fs = new POIFSFileSystem(_samples.OpenResourceAsStream("TestUnicode.xls"));
                wb = new HSSFWorkbook(fs);
            }
            catch (IOException e)
            {
                throw new Exception("TestConstructors", e);
            }
            ExcelExtractor excelExt = new ExcelExtractor(wb);

            String fsText;
            HPSFPropertiesExtractor fsExt = new HPSFPropertiesExtractor(fs);

            fsExt.SetFilesystem(null); // Don't close re-used test resources!
            try
            {
                fsText = fsExt.Text;
            }
            finally
            {
                fsExt.Close();
            }

            String hwText;
            HPSFPropertiesExtractor hwExt = new HPSFPropertiesExtractor(wb);

            hwExt.SetFilesystem(null); // Don't close re-used test resources!
            try
            {
                hwText = hwExt.Text;
            }
            finally
            {
                hwExt.Close();
            }

            String eeText;
            HPSFPropertiesExtractor eeExt = new HPSFPropertiesExtractor(excelExt);

            eeExt.SetFilesystem(null); // Don't close re-used test resources!
            try
            {
                eeText = eeExt.Text;
            }
            finally
            {
                eeExt.Close();
            }

            Assert.AreEqual(fsText, hwText);
            Assert.AreEqual(fsText, eeText);

            Assert.IsTrue(fsText.IndexOf("AUTHOR = marshall") > -1);
            Assert.IsTrue(fsText.IndexOf("TITLE = Titel: \u00c4h") > -1);

            // Finally tidy
            wb.Close();
        }