aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDominik Stadler <centic@apache.org>2015-10-05 06:45:20 +0000
committerDominik Stadler <centic@apache.org>2015-10-05 06:45:20 +0000
commit1cff226bcc1fcd235d4147eab9560a0be494b2d3 (patch)
tree443fc45209855c2fd97cbc7290f2df77c55a04a7 /src
parentea73cb013eceb50c5e858861a81717910daef24e (diff)
downloadpoi-1cff226bcc1fcd235d4147eab9560a0be494b2d3.tar.gz
poi-1cff226bcc1fcd235d4147eab9560a0be494b2d3.zip
As discussed at ApacheCon: Try to automatically find test-data in unit tests, this makes it easier to get going in Eclipse or other IDEs.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1706752 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/testcases/org/apache/poi/POIDataSamples.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/testcases/org/apache/poi/POIDataSamples.java b/src/testcases/org/apache/poi/POIDataSamples.java
index a62e664e1e..8ff09d9083 100644
--- a/src/testcases/org/apache/poi/POIDataSamples.java
+++ b/src/testcases/org/apache/poi/POIDataSamples.java
@@ -197,8 +197,12 @@ public final class POIDataSamples {
return;
}
- throw new RuntimeException("Must set system property '" +
- TEST_PROPERTY + "' before running tests");
+ if(new File("test-data").exists()) {
+ dataDirName = "test-data";
+ } else {
+ throw new RuntimeException("Must set system property '" +
+ TEST_PROPERTY + "' before running tests");
+ }
}
File dataDir = new File(dataDirName, _moduleDir);
if (!dataDir.exists()) {