You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by sa...@apache.org on 2016/06/17 21:52:55 UTC
[2/2] lucene-solr:branch_5x: SOLR-8801: /bin/solr create script
always returns exit code 0 when a collection/core already exists
SOLR-8801: /bin/solr create script always returns exit code 0 when a collection/core already exists
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/77e7fbba
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/77e7fbba
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/77e7fbba
Branch: refs/heads/branch_5x
Commit: 77e7fbbaa37223e91f2adae9829ef48c689286ea
Parents: d58bff0
Author: Steve Rowe <sa...@apache.org>
Authored: Fri May 20 19:36:39 2016 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Fri Jun 17 17:52:18 2016 -0400
----------------------------------------------------------------------
solr/core/src/java/org/apache/solr/util/SolrCLI.java | 4 ++--
.../src/test/org/apache/solr/cloud/SolrCloudExampleTest.java | 4 ++++
2 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/77e7fbba/solr/core/src/java/org/apache/solr/util/SolrCLI.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/util/SolrCLI.java b/solr/core/src/java/org/apache/solr/util/SolrCLI.java
index 20f7515..adc7e19 100644
--- a/solr/core/src/java/org/apache/solr/util/SolrCLI.java
+++ b/solr/core/src/java/org/apache/solr/util/SolrCLI.java
@@ -1640,7 +1640,7 @@ public class SolrCLI {
String systemInfoUrl = solrUrl+"admin/info/system";
CloseableHttpClient httpClient = getHttpClient();
- Tool tool = null;
+ ToolBase tool = null;
try {
Map<String, Object> systemInfo = getJson(httpClient, systemInfoUrl, 2, true);
if ("solrcloud".equals(systemInfo.get("mode"))) {
@@ -1648,7 +1648,7 @@ public class SolrCLI {
} else {
tool = new CreateCoreTool(stdout);
}
- tool.runTool(cli);
+ tool.runImpl(cli);
} finally {
closeHttpClient(httpClient);
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/77e7fbba/solr/core/src/test/org/apache/solr/cloud/SolrCloudExampleTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/SolrCloudExampleTest.java b/solr/core/src/test/org/apache/solr/cloud/SolrCloudExampleTest.java
index 606d066..0562e8d 100644
--- a/solr/core/src/test/org/apache/solr/cloud/SolrCloudExampleTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/SolrCloudExampleTest.java
@@ -94,6 +94,10 @@ public class SolrCloudExampleTest extends AbstractFullDistribZkTestBase {
ensureAllReplicasAreActive(testCollectionName, "shard2", 2, 2, 10);
cloudClient.setDefaultCollection(testCollectionName);
+ int invalidToolExitStatus = 1;
+ assertEquals("Collection '" + testCollectionName + "' created even though it already existed",
+ invalidToolExitStatus, tool.runTool(cli));
+
// now index docs like bin/post would do but we can't use SimplePostTool because it uses System.exit when
// it encounters an error, which JUnit doesn't like ...
log.info("Created collection, now posting example docs!");