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 2017/06/21 10:22:11 UTC
lucene-solr:feature/autoscaling: SOLR-9735: Fix assertions on error
cases in AutoScalingHandlerTest after changes made by SOLR-10406
Repository: lucene-solr
Updated Branches:
refs/heads/feature/autoscaling b499f5aac -> 148865f02
SOLR-9735: Fix assertions on error cases in AutoScalingHandlerTest after changes made by SOLR-10406
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/148865f0
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/148865f0
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/148865f0
Branch: refs/heads/feature/autoscaling
Commit: 148865f020005aa941e2aceb75a324c1bca63ef0
Parents: b499f5a
Author: Shalin Shekhar Mangar <sh...@apache.org>
Authored: Wed Jun 21 15:52:03 2017 +0530
Committer: Shalin Shekhar Mangar <sh...@apache.org>
Committed: Wed Jun 21 15:52:03 2017 +0530
----------------------------------------------------------------------
.../solr/cloud/autoscaling/AutoScalingHandlerTest.java | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/148865f0/solr/core/src/test/org/apache/solr/cloud/autoscaling/AutoScalingHandlerTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/autoscaling/AutoScalingHandlerTest.java b/solr/core/src/test/org/apache/solr/cloud/autoscaling/AutoScalingHandlerTest.java
index edfd141..3da155f 100644
--- a/solr/core/src/test/org/apache/solr/cloud/autoscaling/AutoScalingHandlerTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/autoscaling/AutoScalingHandlerTest.java
@@ -379,9 +379,11 @@ public class AutoScalingHandlerTest extends SolrCloudTestCase {
req = createAutoScalingRequest(SolrRequest.METHOD.POST, removeTriggerCommand);
try {
response = solrClient.request(req);
- fail("Trying to remove trigger which has listeners registered should have failed");
+ String errorMsg = (String) ((NamedList)response.get("error")).get("msg");
+ assertTrue(errorMsg.contains("Cannot remove trigger: node_lost_trigger because it has active listeners: [xyz]"));
} catch (HttpSolrClient.RemoteSolrException e) {
// expected
+ assertTrue(e.getMessage().contains("Cannot remove trigger: node_lost_trigger because it has active listeners: [xyz]"));
}
String removeListenerCommand = "{\n" +
@@ -425,9 +427,11 @@ public class AutoScalingHandlerTest extends SolrCloudTestCase {
req = createAutoScalingRequest(SolrRequest.METHOD.POST, setListenerCommand);
try {
response = solrClient.request(req);
- fail("Adding a listener on a non-existent trigger should have failed");
+ String errorMsg = (String) ((NamedList)response.get("error")).get("msg");
+ assertTrue(errorMsg.contains("A trigger with the name node_lost_trigger does not exist"));
} catch (HttpSolrClient.RemoteSolrException e) {
// expected
+ assertTrue(e.getMessage().contains("A trigger with the name node_lost_trigger does not exist"));
}
}