dirname = System.getProperty("HSSF.testdata.path");
FileInputStream in = new FileInputStream(dirname + "/sample.xlsx"); try { new POIFSFileSystem(in); fail(); } catch(OfficeXmlFileException e) { // Good }