Github user tomjon commented on a diff in the pull request:

    https://github.com/apache/lucene-solr/pull/37#discussion_r63668163
  
    --- Diff: 
solr/core/src/test/org/apache/solr/cloud/CollectionsAPIDistributedZkTest.java 
---
    @@ -435,73 +278,55 @@ private void testErrorHandling() throws Exception {
         request.setPath("/admin/collections");
         gotExp = false;
         try {
    -      makeRequest(baseUrl, request);
    +      cloudClient.request(request);
         } catch (SolrException e) {
           gotExp = true;
         }
         assertTrue(gotExp);
         
    -    // Too many replicas
    +    // No numShards should fail
         params = new ModifiableSolrParams();
         params.set("action", CollectionAction.CREATE.toString());
    -    collectionName = "collection";
    +    collectionName = "acollection";
         params.set("name", collectionName);
    -    params.set("numShards", 2);
    +    params.set(REPLICATION_FACTOR, 10);
         if (secondConfigSet) {
           params.set("collection.configName", "conf1");
         }
    -    params.set(REPLICATION_FACTOR, 10);
         request = new QueryRequest(params);
         request.setPath("/admin/collections");
         gotExp = false;
         try {
    -      makeRequest(baseUrl, request);
    +      cloudClient.request(request);
         } catch (SolrException e) {
           gotExp = true;
         }
         assertTrue(gotExp);
    +  }
    +  
    +  @Test
    +  public void testBadParams() throws SolrServerException, IOException {
    +    int exceptionCount = 0;
         
    -    // No numShards should fail
    -    params = new ModifiableSolrParams();
    -    params.set("action", CollectionAction.CREATE.toString());
    -    collectionName = "acollection";
    -    params.set("name", collectionName);
    -    params.set(REPLICATION_FACTOR, 10);
    -    if (secondConfigSet) {
    -      params.set("collection.configName", "conf1");
    -    }
    -    request = new QueryRequest(params);
    -    request.setPath("/admin/collections");
    -    gotExp = false;
    +    // Too many replicas
         try {
    -      makeRequest(baseUrl, request);
    +      createCollection("collection", configSet, 2, 
10).process(cloudClient);
         } catch (SolrException e) {
    -      gotExp = true;
    +      ++exceptionCount;
    --- End diff --
    
    Yes, good idea - I was following how it'd already been done, here


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to