Package org.apache.poi

Examples of org.apache.poi.POIDataSamples


  private HSLFSlideShow hss;
  // SlideShow primed on the test data
  private SlideShow ss;

  public TestMostRecentRecords() throws Exception {
        POIDataSamples slTests = POIDataSamples.getSlideShowInstance();
    hss = new HSLFSlideShow(slTests.openResourceAsStream("basic_test_ppt_file.ppt"));
    ss = new SlideShow(hss);
  }
View Full Code Here


    String filename2 = "test.doc";
    filename3 = "excel_with_embeded.xls";
    filename4 = "ThreeColHeadFoot.doc";
    filename5 = "HeaderFooterUnicode.doc";
    filename6 = "footnote.doc";
        POIDataSamples docTests = POIDataSamples.getDocumentInstance();
    extractor = new WordExtractor(docTests.openResourceAsStream(filename));
    extractor2 = new WordExtractor(docTests.openResourceAsStream(filename2));

    // Build splat'd out text version
    for(int i=0; i<p_text1.length; i++) {
      p_text1_block += p_text1[i];
    }
View Full Code Here

    /**
     * Tests that we can work with both {@link POIFSFileSystem}
     *  and {@link NPOIFSFileSystem}
     */
    public void testDifferentPOIFS() throws Exception {
       POIDataSamples docTests = POIDataSamples.getDocumentInstance();
      
       // Open the two filesystems
       DirectoryNode[] files = new DirectoryNode[2];
       files[0] = (new POIFSFileSystem(docTests.openResourceAsStream("test2.doc"))).getRoot();
       files[1] = (new NPOIFSFileSystem(docTests.getFile("test2.doc"))).getRoot();
      
       // Open directly
       for(DirectoryNode dir : files) {
          WordExtractor extractor = new WordExtractor(dir);
          assertEquals(p_text1_block, extractor.getText());
View Full Code Here

    /**
     * Add slides to ppt which already has two slides
     */
    public void testAddSlides2to3() throws Exception {
        POIDataSamples slTests = POIDataSamples.getSlideShowInstance();
        SlideShow ppt = new SlideShow(slTests.openResourceAsStream("basic_test_ppt_file.ppt"));

        assertTrue(ppt.getSlides().length == 2);

        // First slide is 256 / 4
        Slide s1 = ppt.getSlides()[0];
View Full Code Here

     *
     * @exception FileNotFoundException if the file to be read does not exist.
     * @exception IOException if any other I/O exception occurs
     */
    protected void setUp() {
        POIDataSamples samples = POIDataSamples.getHPSFInstance();
        data = samples.getFile(POI_FS);
    }
View Full Code Here

    public void testReadDocumentSummaryInformation()
            throws FileNotFoundException, IOException,
            NoPropertySetStreamException, MarkUnsupportedException,
            UnexpectedPropertySetTypeException
    {
        POIDataSamples _samples = POIDataSamples.getHPSFInstance();
        final File dataDir = _samples.getFile("");
        final File[] docs = dataDir.listFiles(new FileFilter()
        {
            public boolean accept(final File file)
            {
                return file.isFile() && file.getName().startsWith("Test");
View Full Code Here

     */
    public void testWriteWellKnown() throws IOException,
            NoPropertySetStreamException, MarkUnsupportedException,
            UnexpectedPropertySetTypeException, WritingNotSupportedException
    {
        POIDataSamples _samples = POIDataSamples.getHPSFInstance();
        final File dataDir = _samples.getFile("");
        final File doc1 = new File(dataDir, POI_FS);

        /* Read a test document <em>doc1</em> into a POI filesystem. */
        POIFSFileSystem poifs = new POIFSFileSystem(new FileInputStream(doc1));
        DirectoryEntry dir = poifs.getRoot();
View Full Code Here

                    cp.getValue();
                }
            }
        };

        POIDataSamples _samples = POIDataSamples.getHPSFInstance();
        final File dataDir = _samples.getFile("");
        final File[] docs = dataDir.listFiles(new FileFilter()
        {
            public boolean accept(final File file)
            {
                return file.isFile() && file.getName().startsWith("Test");
View Full Code Here

     * does not exist
     * @exception IOException if an I/O exception occurs
     */
    public void setUp() throws FileNotFoundException, IOException
    {
        POIDataSamples samples = POIDataSamples.getHPSFInstance();
        final File data = samples.getFile(POI_FS);

        poiFiles = Util.readPOIFiles(data);
    }
View Full Code Here

     * @param task the task to execute
     * @throws Throwable
     */
    public void runTests(final TestTask task) throws Throwable
    {
        POIDataSamples _samples = POIDataSamples.getHPSFInstance();
        final File dataDir = _samples.getFile("");
        final File[] docs = dataDir.listFiles(new FileFilter()
        {
            public boolean accept(final File file)
            {
                return file.isFile() && file.getName().startsWith("Test");
View Full Code Here

TOP

Related Classes of org.apache.poi.POIDataSamples

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.