Search in sources :

Example 1 with XWPFFileHandler

use of org.apache.poi.stress.XWPFFileHandler in project poi by apache.

the class TestAllFiles method files.

@Parameters(name = "{index}: {0} using {1}")
public static Iterable<Object[]> files() {
    DirectoryScanner scanner = new DirectoryScanner();
    scanner.setBasedir(ROOT_DIR);
    scanner.setExcludes(SCAN_EXCLUDES);
    scanner.scan();
    System.out.println("Handling " + scanner.getIncludedFiles().length + " files");
    List<Object[]> files = new ArrayList<Object[]>();
    for (String file : scanner.getIncludedFiles()) {
        // ... failures/handlers lookup doesn't work on windows otherwise
        file = file.replace('\\', '/');
        if (IGNORED.contains(file)) {
            System.out.println("Ignoring " + file);
            continue;
        }
        FileHandler handler = HANDLERS.get(getExtension(file));
        files.add(new Object[] { file, handler });
        // for some file-types also run OPCFileHandler
        if (handler instanceof XSSFFileHandler || handler instanceof XWPFFileHandler || handler instanceof XSLFFileHandler || handler instanceof XDGFFileHandler) {
            files.add(new Object[] { file, new OPCFileHandler() });
        }
        if (handler instanceof HSSFFileHandler || handler instanceof HSLFFileHandler || handler instanceof HWPFFileHandler || handler instanceof HDGFFileHandler) {
            files.add(new Object[] { file, new HPSFFileHandler() });
        }
    }
    return files;
}
Also used : XDGFFileHandler(org.apache.poi.stress.XDGFFileHandler) XSSFFileHandler(org.apache.poi.stress.XSSFFileHandler) HPSFFileHandler(org.apache.poi.stress.HPSFFileHandler) ArrayList(java.util.ArrayList) XWPFFileHandler(org.apache.poi.stress.XWPFFileHandler) OPCFileHandler(org.apache.poi.stress.OPCFileHandler) POIFSFileHandler(org.apache.poi.stress.POIFSFileHandler) HSLFFileHandler(org.apache.poi.stress.HSLFFileHandler) HDGFFileHandler(org.apache.poi.stress.HDGFFileHandler) HMEFFileHandler(org.apache.poi.stress.HMEFFileHandler) AbstractFileHandler(org.apache.poi.stress.AbstractFileHandler) XSSFBFileHandler(org.apache.poi.stress.XSSFBFileHandler) HWPFFileHandler(org.apache.poi.stress.HWPFFileHandler) HSMFFileHandler(org.apache.poi.stress.HSMFFileHandler) XSLFFileHandler(org.apache.poi.stress.XSLFFileHandler) XWPFFileHandler(org.apache.poi.stress.XWPFFileHandler) FileHandler(org.apache.poi.stress.FileHandler) HSSFFileHandler(org.apache.poi.stress.HSSFFileHandler) HPBFFileHandler(org.apache.poi.stress.HPBFFileHandler) XDGFFileHandler(org.apache.poi.stress.XDGFFileHandler) XSSFFileHandler(org.apache.poi.stress.XSSFFileHandler) HPSFFileHandler(org.apache.poi.stress.HPSFFileHandler) OPCFileHandler(org.apache.poi.stress.OPCFileHandler) HSLFFileHandler(org.apache.poi.stress.HSLFFileHandler) HWPFFileHandler(org.apache.poi.stress.HWPFFileHandler) XSLFFileHandler(org.apache.poi.stress.XSLFFileHandler) DirectoryScanner(org.apache.tools.ant.DirectoryScanner) HDGFFileHandler(org.apache.poi.stress.HDGFFileHandler) HSSFFileHandler(org.apache.poi.stress.HSSFFileHandler) Parameters(org.junit.runners.Parameterized.Parameters)

Aggregations

ArrayList (java.util.ArrayList)1 AbstractFileHandler (org.apache.poi.stress.AbstractFileHandler)1 FileHandler (org.apache.poi.stress.FileHandler)1 HDGFFileHandler (org.apache.poi.stress.HDGFFileHandler)1 HMEFFileHandler (org.apache.poi.stress.HMEFFileHandler)1 HPBFFileHandler (org.apache.poi.stress.HPBFFileHandler)1 HPSFFileHandler (org.apache.poi.stress.HPSFFileHandler)1 HSLFFileHandler (org.apache.poi.stress.HSLFFileHandler)1 HSMFFileHandler (org.apache.poi.stress.HSMFFileHandler)1 HSSFFileHandler (org.apache.poi.stress.HSSFFileHandler)1 HWPFFileHandler (org.apache.poi.stress.HWPFFileHandler)1 OPCFileHandler (org.apache.poi.stress.OPCFileHandler)1 POIFSFileHandler (org.apache.poi.stress.POIFSFileHandler)1 XDGFFileHandler (org.apache.poi.stress.XDGFFileHandler)1 XSLFFileHandler (org.apache.poi.stress.XSLFFileHandler)1 XSSFBFileHandler (org.apache.poi.stress.XSSFBFileHandler)1 XSSFFileHandler (org.apache.poi.stress.XSSFFileHandler)1 XWPFFileHandler (org.apache.poi.stress.XWPFFileHandler)1 DirectoryScanner (org.apache.tools.ant.DirectoryScanner)1 Parameters (org.junit.runners.Parameterized.Parameters)1