]> source.dussan.org Git - poi.git/commitdiff
Also look for test-data in ../test-data for Gradle build
authorDominik Stadler <centic@apache.org>
Tue, 6 Apr 2021 06:10:46 +0000 (06:10 +0000)
committerDominik Stadler <centic@apache.org>
Tue, 6 Apr 2021 06:10:46 +0000 (06:10 +0000)
This is needed when running tests in the IDE via the Gradle project import

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1888417 13f79535-47bb-0310-9956-ffa450edef68

main/src/test/java/org/apache/poi/POIDataSamples.java

index ddf66e25bf21a28feaf94b1beaf1e1e5b71cf59a..d74839e3a7cd9406cb6b171e7309e99c4b00a2f5 100644 (file)
@@ -120,7 +120,7 @@ public final class POIDataSamples {
         if(_instXmlDSign == null) _instXmlDSign = new POIDataSamples("xmldsign");
         return _instXmlDSign;
     }
-    
+
     /**
      * Opens a sample file from the test data directory
      *
@@ -197,8 +197,10 @@ public final class POIDataSamples {
                 return;
             }
 
-            if(new File("test-data").exists()) {
-               dataDirName = "test-data";
+            if (new File("test-data").exists()) {
+                               dataDirName = "test-data";
+                       } else if (new File("../test-data").exists()) {
+               dataDirName = "../test-data";
             } else {
                throw new RuntimeException("Must set system property '" +
                        TEST_PROPERTY + "' before running tests");