Author: nick Date: Wed Oct 17 14:20:02 2018 New Revision: 1844115 URL: http://svn.apache.org/viewvc?rev=1844115&view=rev Log: Failing unit test for bug #62831
Modified: poi/trunk/.classpath poi/trunk/src/ooxml/testcases/org/apache/poi/ss/TestWorkbookFactory.java Modified: poi/trunk/.classpath URL: http://svn.apache.org/viewvc/poi/trunk/.classpath?rev=1844115&r1=1844114&r2=1844115&view=diff ============================================================================== --- poi/trunk/.classpath (original) +++ poi/trunk/.classpath Wed Oct 17 14:20:02 2018 @@ -36,7 +36,7 @@ <classpathentry exported="true" kind="lib" path="lib/commons-collections4-4.2.jar"/> <classpathentry kind="lib" path="lib/commons-math3-3.6.1.jar"/> <classpathentry kind="lib" path="lib/xmlunit-core-2.5.1.jar"/> - <classpathentry kind="lib" path="lib/mockito-core-2.13.0.jar"/> + <classpathentry kind="lib" path="lib/mockito-core-2.21.0.jar"/> <classpathentry kind="lib" path="lib/byte-buddy-1.7.9.jar"/> <classpathentry kind="lib" path="lib/byte-buddy-agent-1.7.9.jar"/> <classpathentry kind="lib" path="lib/objenesis-2.6.jar"/> Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/ss/TestWorkbookFactory.java URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/ss/TestWorkbookFactory.java?rev=1844115&r1=1844114&r2=1844115&view=diff ============================================================================== --- poi/trunk/src/ooxml/testcases/org/apache/poi/ss/TestWorkbookFactory.java (original) +++ poi/trunk/src/ooxml/testcases/org/apache/poi/ss/TestWorkbookFactory.java Wed Oct 17 14:20:02 2018 @@ -39,6 +39,7 @@ import org.apache.poi.xssf.usermodel.XSS import org.apache.poi.openxml4j.opc.OPCPackage; import org.apache.poi.openxml4j.opc.PackageAccess; import org.apache.poi.xssf.usermodel.XSSFWorkbookFactory; +import org.junit.Ignore; import org.junit.Test; public final class TestWorkbookFactory { @@ -387,4 +388,34 @@ public final class TestWorkbookFactory { } } + /** + * See Bugzilla bug #62831 - #WorkbookFactory.create(File) needs + * to work for sub-classes of File too, eg JFileChooser + */ + @Test + @Ignore + public void testFileSubclass() throws Exception { + Workbook wb; + + File normalXLS = HSSFTestDataSamples.getSampleFile(xls); + File normalXLSX = HSSFTestDataSamples.getSampleFile(xlsx); + File altXLS = new TestFile(normalXLS.getAbsolutePath()); + File altXLSX = new TestFile(normalXLSX.getAbsolutePath()); + assertTrue(altXLS.exists()); + assertTrue(altXLSX.exists()); + + wb = WorkbookFactory.create(altXLS); + assertNotNull(wb); + assertTrue(wb instanceof HSSFWorkbook); + + wb = WorkbookFactory.create(altXLSX); + assertNotNull(wb); + assertTrue(wb instanceof XSSFWorkbook); + } + + private static class TestFile extends File { + public TestFile(String file) { + super(file); + } + } } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@poi.apache.org For additional commands, e-mail: commits-h...@poi.apache.org