]> source.dussan.org Git - poi.git/commitdiff
fixed case-sensitive file names in unit tests for Bugzilla 47520
authorYegor Kozlov <yegor@apache.org>
Thu, 16 Jul 2009 10:44:01 +0000 (10:44 +0000)
committerYegor Kozlov <yegor@apache.org>
Thu, 16 Jul 2009 10:44:01 +0000 (10:44 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@794621 13f79535-47bb-0310-9956-ffa450edef68

src/ooxml/testcases/org/apache/poi/xssf/extractor/TestXSSFExportToXML.java
src/ooxml/testcases/org/apache/poi/xssf/model/TestMapInfo.java
src/testcases/org/apache/poi/hssf/HSSFTestDataSamples.java

index 960f078ee241a712bbec9ad9e2de45cc7f781f38..ab74042927930e2a4f029f91cb72f6fcafe29364 100755 (executable)
@@ -43,7 +43,7 @@ public class TestXSSFExportToXML extends TestCase{
        public void testExportToXML() throws Exception{
        
                
-                XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("CustomXmlMappings.xlsx");
+                XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("CustomXMLMappings.xlsx");
                  
                 
                 
index 465a5beba281bae1a89474ff25db548aaef6efae..e10711e6962bfb3597c6b63b56c4f834a635c659 100755 (executable)
@@ -36,7 +36,7 @@ public class TestMapInfo extends TestCase {
     public void testMapInfoExists() throws Exception {
 
 
-        XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("CustomXmlMappings.xlsx");
+        XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("CustomXMLMappings.xlsx");
 
         MapInfo mapInfo = null;
         SingleXmlCells singleXMLCells = null;
index 97eefa8826bc154f8288780501edc9bffae304d0..113329265f4ab5d42d2bfe128fe5d42a9e3484a1 100644 (file)
@@ -77,8 +77,16 @@ public final class HSSFTestDataSamples {
                        throw new RuntimeException("Sample file '" + sampleFileName
                                        + "' not found in data dir '" + _resolvedDataDir.getAbsolutePath() + "'");
                }
-//             System.out.println("opening " + f.getAbsolutePath());
-               try {
+        try {
+            if(!sampleFileName.equals(f.getCanonicalFile().getName())){
+                throw new RuntimeException("File name is case-sensitive: requested '" + sampleFileName
+                        + "' but actual file is '" + f.getCanonicalFile().getName() + "'");
+            }
+        } catch (IOException e){
+            throw new RuntimeException(e);
+        }
+        
+        try {
                        return new FileInputStream(f);
                } catch (FileNotFoundException e) {
                        throw new RuntimeException(e);