From: Dominik Stadler Date: Tue, 6 Apr 2021 06:10:46 +0000 (+0000) Subject: Also look for test-data in ../test-data for Gradle build X-Git-Tag: REL_5_1_0~279 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ddc13a4c48ab296fbadb19ae1a02e511e9db64e8;p=poi.git Also look for test-data in ../test-data for Gradle build 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 --- diff --git a/main/src/test/java/org/apache/poi/POIDataSamples.java b/main/src/test/java/org/apache/poi/POIDataSamples.java index ddf66e25bf..d74839e3a7 100644 --- a/main/src/test/java/org/apache/poi/POIDataSamples.java +++ b/main/src/test/java/org/apache/poi/POIDataSamples.java @@ -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");