You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ce...@apache.org on 2015/10/05 08:45:20 UTC

svn commit: r1706752 - /poi/trunk/src/testcases/org/apache/poi/POIDataSamples.java

Author: centic
Date: Mon Oct  5 06:45:20 2015
New Revision: 1706752

URL: http://svn.apache.org/viewvc?rev=1706752&view=rev
Log:
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.

Modified:
    poi/trunk/src/testcases/org/apache/poi/POIDataSamples.java

Modified: poi/trunk/src/testcases/org/apache/poi/POIDataSamples.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/POIDataSamples.java?rev=1706752&r1=1706751&r2=1706752&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/POIDataSamples.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/POIDataSamples.java Mon Oct  5 06:45:20 2015
@@ -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()) {



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org