diff options
author | Dominik Stadler <centic@apache.org> | 2022-07-29 17:07:05 +0000 |
---|---|---|
committer | Dominik Stadler <centic@apache.org> | 2022-07-29 17:07:05 +0000 |
commit | 92b8cf9984ba767d10f224d0bc3fa41b01fbcf32 (patch) | |
tree | 633228429903b677eef970e8a43456cc8743a154 /poi-integration/src | |
parent | 5c78170f5de235dc9a4bb0ded7f4afe3f0ee5a43 (diff) | |
download | poi-92b8cf9984ba767d10f224d0bc3fa41b01fbcf32.tar.gz poi-92b8cf9984ba767d10f224d0bc3fa41b01fbcf32.zip |
Also look for test-data in parent-directory
When using the IDE to run tests in one of the
sub-modules uses the poi-* sub-directory, so
looking for the test-data in ../test-data is
useful to make executing tests work out-of-the-box
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1903103 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-integration/src')
-rw-r--r-- | poi-integration/src/test/java/org/apache/poi/stress/TestAllFiles.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/poi-integration/src/test/java/org/apache/poi/stress/TestAllFiles.java b/poi-integration/src/test/java/org/apache/poi/stress/TestAllFiles.java index 8c94027459..aaa1173c7c 100644 --- a/poi-integration/src/test/java/org/apache/poi/stress/TestAllFiles.java +++ b/poi-integration/src/test/java/org/apache/poi/stress/TestAllFiles.java @@ -33,6 +33,7 @@ import java.util.List; import java.util.Set; import java.util.stream.Stream; +import org.apache.poi.POIDataSamples; import org.apache.poi.hssf.record.crypto.Biff8EncryptionKey; import org.apache.tools.ant.DirectoryScanner; import org.junit.jupiter.api.function.Executable; @@ -71,7 +72,15 @@ import org.opentest4j.AssertionFailedError; @Execution(ExecutionMode.CONCURRENT) public class TestAllFiles { private static final String DEFAULT_TEST_DATA_PATH = "test-data"; - public static final File ROOT_DIR = new File(System.getProperty("POI.testdata.path", DEFAULT_TEST_DATA_PATH)); + public static final File ROOT_DIR; + static { + File dir = new File(System.getProperty(POIDataSamples.TEST_PROPERTY, DEFAULT_TEST_DATA_PATH)); + if (!dir.exists()) { + dir = new File(System.getProperty(POIDataSamples.TEST_PROPERTY, "../" + DEFAULT_TEST_DATA_PATH)); + } + + ROOT_DIR = dir; + } public static final String[] SCAN_EXCLUDES = { "**/.svn/**", |