public void testSolrConnection(){
  SolrClient client=getSolrConnection();
  try {
    client.ping();
  }
 catch (  Exception e) {
    throw new IllegalArgumentException(String.format("Server refused connection at '%s'. Please make sure that either the Solr/Zookeeper services " + "are properly running or the collection '%s' exists in the Solr Server.",solrHost,collectionName),e);
  }
}

public void testSolrConnection ( ) { SolrClient client = getSolrConnection ( ) ; try { client . ping ( ) ; } catch ( Exception e ) { throw new IllegalArgumentException ( String . format ( "Server refused connection at '%s'. Please make sure that either the Solr/Zookeeper services " + "are properly running or the collection '%s' exists in the Solr Server." , solrHost , collectionName ) , e ) ; } }
verifies whether the solr server is running or not . also , validates whether the collection is registered with the solr server or not .
