]> source.dussan.org Git - poi.git/commitdiff
As discussed at ApacheCon: Try to automatically find test-data in unit tests, this...
authorDominik Stadler <centic@apache.org>
Mon, 5 Oct 2015 06:45:20 +0000 (06:45 +0000)
committerDominik Stadler <centic@apache.org>
Mon, 5 Oct 2015 06:45:20 +0000 (06:45 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1706752 13f79535-47bb-0310-9956-ffa450edef68

src/testcases/org/apache/poi/POIDataSamples.java

index a62e664e1e1f43fb0e7774ed66bd6ba0a23744f9..8ff09d908399d1a801b711f9d54a7f701fa395b1 100644 (file)
@@ -197,8 +197,12 @@ public final class POIDataSamples {
                 return;\r
             }\r
 \r
-            throw new RuntimeException("Must set system property '" +\r
-                    TEST_PROPERTY + "' before running tests");\r
+            if(new File("test-data").exists()) {\r
+               dataDirName = "test-data";\r
+            } else {\r
+               throw new RuntimeException("Must set system property '" +\r
+                       TEST_PROPERTY + "' before running tests");\r
+            }\r
         }\r
         File dataDir = new File(dataDirName, _moduleDir);\r
         if (!dataDir.exists()) {\r