Search in sources :

Example 56 with CollectionAdminResponse

use of org.apache.solr.client.solrj.response.CollectionAdminResponse in project lucene-solr by apache.

the class CollectionsAPISolrJTest method testOverseerStatus.

@Test
public void testOverseerStatus() throws IOException, SolrServerException {
    CollectionAdminResponse response = new CollectionAdminRequest.OverseerStatus().process(cluster.getSolrClient());
    assertEquals(0, response.getStatus());
    assertNotNull("overseer_operations shouldn't be null", response.getResponse().get("overseer_operations"));
}
Also used : CollectionAdminResponse(org.apache.solr.client.solrj.response.CollectionAdminResponse) CollectionAdminRequest(org.apache.solr.client.solrj.request.CollectionAdminRequest) Test(org.junit.Test)

Example 57 with CollectionAdminResponse

use of org.apache.solr.client.solrj.response.CollectionAdminResponse in project lucene-solr by apache.

the class DeleteStatusTest method testDeletingNonExistentRequests.

@Test
public void testDeletingNonExistentRequests() throws Exception {
    final CloudSolrClient client = cluster.getSolrClient();
    CollectionAdminResponse rsp = CollectionAdminRequest.deleteAsyncId("foo").process(client);
    assertEquals("[foo] not found in stored responses", rsp.getResponse().get("status"));
}
Also used : CollectionAdminResponse(org.apache.solr.client.solrj.response.CollectionAdminResponse) CloudSolrClient(org.apache.solr.client.solrj.impl.CloudSolrClient) Test(org.junit.Test)

Example 58 with CollectionAdminResponse

use of org.apache.solr.client.solrj.response.CollectionAdminResponse in project ddf by codice.

the class BackupCommandTest method createDefaultCollection.

private static void createDefaultCollection() throws Exception {
    CollectionAdminRequest.Create create = CollectionAdminRequest.createCollection(DEFAULT_CORE_NAME, DEFAULT_CONFIGSET, 1, 1);
    CollectionAdminResponse response = create.process(miniSolrCloud.getSolrClient());
    if (response.getStatus() != 0 || response.getErrorMessages() != null) {
        fail("Could not create collection. Response: " + response.toString());
    }
    List<String> collections = CollectionAdminRequest.listCollections(miniSolrCloud.getSolrClient());
    assertThat(collections.size(), is(1));
    miniSolrCloud.getSolrClient().setDefaultCollection(DEFAULT_CORE_NAME);
}
Also used : CollectionAdminResponse(org.apache.solr.client.solrj.response.CollectionAdminResponse) CollectionAdminRequest(org.apache.solr.client.solrj.request.CollectionAdminRequest) Matchers.containsString(org.hamcrest.Matchers.containsString)

Aggregations

CollectionAdminResponse (org.apache.solr.client.solrj.response.CollectionAdminResponse)58 CollectionAdminRequest (org.apache.solr.client.solrj.request.CollectionAdminRequest)29 Test (org.junit.Test)21 NamedList (org.apache.solr.common.util.NamedList)11 HttpSolrClient (org.apache.solr.client.solrj.impl.HttpSolrClient)9 SolrClient (org.apache.solr.client.solrj.SolrClient)8 CloudSolrClient (org.apache.solr.client.solrj.impl.CloudSolrClient)8 ModifiableSolrParams (org.apache.solr.common.params.ModifiableSolrParams)8 ArrayList (java.util.ArrayList)7 SolrServerException (org.apache.solr.client.solrj.SolrServerException)7 Replica (org.apache.solr.common.cloud.Replica)7 QueryRequest (org.apache.solr.client.solrj.request.QueryRequest)6 IOException (java.io.IOException)5 Map (java.util.Map)5 SolrRequest (org.apache.solr.client.solrj.SolrRequest)5 HttpResponse (org.apache.http.HttpResponse)4 HttpGet (org.apache.http.client.methods.HttpGet)4 HttpPost (org.apache.http.client.methods.HttpPost)4 StringEntity (org.apache.http.entity.StringEntity)4 UpdateRequest (org.apache.solr.client.solrj.request.UpdateRequest)4