You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by sh...@apache.org on 2016/09/12 09:33:52 UTC

[15/15] lucene-solr:branch_6_2: SOLR-9445: Fix failures in TestLocalFSCloudBackupRestore due to changed code path which return SolrExceptions instead of SolrServerExceptions (cherry picked from commit df9a642)

SOLR-9445: Fix failures in TestLocalFSCloudBackupRestore due to changed code path which return SolrExceptions instead of SolrServerExceptions
(cherry picked from commit df9a642)

(cherry picked from commit 7cf7bfd)


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

Branch: refs/heads/branch_6_2
Commit: b34f9b6fe590a46aef7792e0313f88721f1caded
Parents: e567747
Author: Shalin Shekhar Mangar <sh...@apache.org>
Authored: Sun Aug 28 00:38:53 2016 +0530
Committer: Shalin Shekhar Mangar <sh...@apache.org>
Committed: Mon Sep 12 14:30:00 2016 +0530

----------------------------------------------------------------------
 .../solr/cloud/AbstractCloudBackupRestoreTestCase.java   | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b34f9b6f/solr/core/src/test/org/apache/solr/cloud/AbstractCloudBackupRestoreTestCase.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/AbstractCloudBackupRestoreTestCase.java b/solr/core/src/test/org/apache/solr/cloud/AbstractCloudBackupRestoreTestCase.java
index fd74eaf..8e7a4b0 100644
--- a/solr/core/src/test/org/apache/solr/cloud/AbstractCloudBackupRestoreTestCase.java
+++ b/solr/core/src/test/org/apache/solr/cloud/AbstractCloudBackupRestoreTestCase.java
@@ -33,6 +33,7 @@ import org.apache.solr.client.solrj.impl.HttpSolrClient.RemoteSolrException;
 import org.apache.solr.client.solrj.request.CollectionAdminRequest;
 import org.apache.solr.client.solrj.request.CollectionAdminRequest.ClusterProp;
 import org.apache.solr.client.solrj.response.RequestStatusState;
+import org.apache.solr.common.SolrException;
 import org.apache.solr.common.SolrException.ErrorCode;
 import org.apache.solr.common.SolrInputDocument;
 import org.apache.solr.common.cloud.DocCollection;
@@ -147,9 +148,8 @@ public abstract class AbstractCloudBackupRestoreTestCase extends SolrCloudTestCa
     try {
       backup.process(solrClient);
       fail("This request should have failed since the cluster property value for backup location property is invalid.");
-    } catch (SolrServerException ex) {
-      assertTrue(ex.getCause() instanceof RemoteSolrException);
-      assertEquals(ErrorCode.SERVER_ERROR.code, ((RemoteSolrException)ex.getCause()).code());
+    } catch (SolrException ex) {
+      assertEquals(ErrorCode.SERVER_ERROR.code, ex.code());
     }
 
     String restoreCollectionName = collectionName + "_invalidrequest";
@@ -158,9 +158,8 @@ public abstract class AbstractCloudBackupRestoreTestCase extends SolrCloudTestCa
     try {
       restore.process(solrClient);
       fail("This request should have failed since the cluster property value for backup location property is invalid.");
-    } catch (SolrServerException ex) {
-      assertTrue(ex.getCause() instanceof RemoteSolrException);
-      assertEquals(ErrorCode.SERVER_ERROR.code, ((RemoteSolrException)ex.getCause()).code());
+    } catch (SolrException ex) {
+      assertEquals(ErrorCode.SERVER_ERROR.code, ex.code());
     }
   }