You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2018/03/23 15:36:01 UTC

lucene-solr:master: SOLR-10075: TestNonWritablePersistFile fails when run as a single test under root.

Repository: lucene-solr
Updated Branches:
  refs/heads/master e364f5be3 -> 848a410ca


SOLR-10075: TestNonWritablePersistFile fails when run as a single test under root.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/848a410c
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/848a410c
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/848a410c

Branch: refs/heads/master
Commit: 848a410ca1e4be7b27fe7d338e64fe599351c9c2
Parents: e364f5b
Author: markrmiller <ma...@apache.org>
Authored: Thu Mar 22 09:32:37 2018 -0500
Committer: markrmiller <ma...@apache.org>
Committed: Fri Mar 23 10:35:43 2018 -0500

----------------------------------------------------------------------
 .../dataimport/TestNonWritablePersistFile.java  | 22 ++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/848a410c/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestNonWritablePersistFile.java
----------------------------------------------------------------------
diff --git a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestNonWritablePersistFile.java b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestNonWritablePersistFile.java
index a7d3d0a..4d43ff6 100644
--- a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestNonWritablePersistFile.java
+++ b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestNonWritablePersistFile.java
@@ -70,10 +70,24 @@ public class TestNonWritablePersistFile extends AbstractDataImportHandlerTestCas
 
     try {
       // execute the test only if we are able to set file to read only mode
-      assumeTrue("No dataimport.properties file", f.exists() || f.createNewFile());
-      assumeTrue("dataimport.properties can't be set read only", f.setReadOnly());
-      assumeFalse("dataimport.properties is still writable even though " + 
-                  "marked readonly - test running as superuser?", f.canWrite());
+      // we don't use assume because if no tests executes when you run a single test
+      // it's considered a fail
+      
+      if (!(f.exists() || f.createNewFile()))  {
+        System.err.println("No dataimport.properties file, skipping rest of test ...");
+        return;
+      }
+      
+      if (!f.setReadOnly())  {
+        System.err.println("dataimport.properties can't be set read only, skipping rest of test ...");
+        return;
+      }
+      
+      if (f.canWrite())  {
+        System.err.println("dataimport.properties is still writable even though \" + \n" + 
+            "                  \"marked readonly - test running as superuser?, skipping rest of test ...");
+        return;
+      }
 
       ignoreException("Properties is not writable");