Search in sources :

Example 11 with SolrClient

use of org.codice.solr.client.solrj.SolrClient in project ddf by codice.

the class SolrClientFactoryImplTest method newClientWithUnknownClientType.

@Test
public void newClientWithUnknownClientType() {
    System.setProperty("solr.client", "Unknown");
    SolrClientFactoryImpl factory = new SolrClientFactoryImpl(mockHttpSolrClientFactory);
    SolrClient client = factory.newClient("core");
    assertThat(factory.getFactory(), is(mockHttpSolrClientFactory));
    assertThat(client, is(mockClient));
}
Also used : SolrClient(org.codice.solr.client.solrj.SolrClient) Test(org.junit.Test)

Example 12 with SolrClient

use of org.codice.solr.client.solrj.SolrClient in project ddf by codice.

the class SolrClientFactoryImplTest method newHttpSolrClient.

@Test
public void newHttpSolrClient() {
    System.setProperty("solr.client", "HttpSolrClient");
    SolrClientFactoryImpl factory = new SolrClientFactoryImpl(mockHttpSolrClientFactory);
    SolrClient client = factory.newClient("core");
    assertThat(factory.getFactory(), is(mockHttpSolrClientFactory));
    assertThat(client, is(mockClient));
}
Also used : SolrClient(org.codice.solr.client.solrj.SolrClient) Test(org.junit.Test)

Aggregations

SolrClient (org.codice.solr.client.solrj.SolrClient)12 Test (org.junit.Test)7 IOException (java.io.IOException)4 SolrServerException (org.apache.solr.client.solrj.SolrServerException)4 SolrException (org.apache.solr.common.SolrException)3 NamedList (org.apache.solr.common.util.NamedList)3 PersistenceException (org.codice.ddf.persistence.PersistenceException)3 CatalogProvider (ddf.catalog.source.CatalogProvider)2 ArrayList (java.util.ArrayList)2 Map (java.util.Map)2 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)2 SolrQuery (org.apache.solr.client.solrj.SolrQuery)2 QueryResponse (org.apache.solr.client.solrj.response.QueryResponse)2 UpdateResponse (org.apache.solr.client.solrj.response.UpdateResponse)2 SolrDocumentList (org.apache.solr.common.SolrDocumentList)2 CatalogFramework (ddf.catalog.CatalogFramework)1 CreateRequest (ddf.catalog.operation.CreateRequest)1 CreateResponse (ddf.catalog.operation.CreateResponse)1 SourceMonitor (ddf.catalog.source.SourceMonitor)1 SolrMetacardClientImpl (ddf.catalog.source.solr.SolrMetacardClientImpl)1