SolrCloudBootstrap implements Bootstrap { public CloudSolrClient getClient() { return new CloudSolrClient(zkHostString); } SolrCloudBootstrap();  SolrCloudBootstrap(URL url); @Override ComponentMetadata getMetadata(); @Override String getProperties(); @Override void loadConfig(Map<String, String> configs); @Override Bootstrap start(); @Override Bootstrap stop(); CloudSolrClient getClient(); static final int TIMEOUT; }
@Test public void solrCloudShouldStart() throws IOException, SolrServerException, KeeperException, InterruptedException, NotFoundServiceException { String collectionName = configuration.getString(SolrCloudConfig.SOLR_COLLECTION_NAME); CloudSolrClient client = ((SolrCloudBootstrap) HadoopBootstrap.INSTANCE.getService("SOLRCLOUD")).getClient(); for (int i = 0; i < 1000; ++i) { SolrInputDocument doc = new SolrInputDocument(); doc.addField("cat", "book"); doc.addField("id", "book-" + i); doc.addField("name", "The Legend of the Hobbit part " + i); client.add(collectionName, doc); if (i % 100 == 0) client.commit(collectionName); } client.commit("collection1"); SolrDocument collection1 = client.getById(collectionName, "book-1"); assertNotNull(collection1); assertThat(collection1.getFieldValue("name")).isEqualTo("The Legend of the Hobbit part 1"); client.close(); }