public MiniSolrCloudCluster(int numServers,String hostContext,File solrXml,SortedMap<ServletHolder,String> extraServlets,SortedMap<Class,String> extraRequestFilters) throws Exception {
  testDir=Files.createTempDir();
  String zkDir=testDir.getAbsolutePath() + File.separator + "zookeeper/server1/data";
  zkServer=new ZkTestServer(zkDir);
  zkServer.run();
  SolrZkClient zkClient=null;
  InputStream is=null;
  try {
    zkClient=new SolrZkClient(zkServer.getZkHost(),AbstractZkTestCase.TIMEOUT,45000,null);
    zkClient.makePath("/solr",false,true);
    is=new FileInputStream(solrXml);
    zkClient.create("/solr/solr.xml",IOUtils.toByteArray(is),ZooDefs.Ids.OPEN_ACL_UNSAFE,CreateMode.PERSISTENT,true);
  }
  finally {
    IOUtils.closeQuietly(is);
    if (zkClient != null)     zkClient.close();
  }
  System.setProperty("solr.solrxml.location","zookeeper");
  System.setProperty("zkHost",zkServer.getZkAddress());
  jettys=new LinkedList<JettySolrRunner>();
  for (int i=0; i < numServers; ++i) {
    startJettySolrRunner(hostContext,extraServlets,extraRequestFilters);
  }
}

public MiniSolrCloudCluster ( int numServers , String hostContext , File solrXml , SortedMap < ServletHolder , String > extraServlets , SortedMap < Class , String > extraRequestFilters ) throws Exception { testDir = Files . createTempDir ( ) ; String zkDir = testDir . getAbsolutePath ( ) + File . separator + "zookeeper/server1/data" ; zkServer = new ZkTestServer ( zkDir ) ; zkServer . run ( ) ; SolrZkClient zkClient = null ; InputStream is = null ; try { zkClient = new SolrZkClient ( zkServer . getZkHost ( ) , AbstractZkTestCase . TIMEOUT , 45000 , null ) ; zkClient . makePath ( "/solr" , false , true ) ; is = new FileInputStream ( solrXml ) ; zkClient . create ( "/solr/solr.xml" , IOUtils . toByteArray ( is ) , ZooDefs . Ids . OPEN_ACL_UNSAFE , CreateMode . PERSISTENT , true ) ; } finally { IOUtils . closeQuietly ( is ) ; if ( zkClient != null ) zkClient . close ( ) ; } System . setProperty ( "solr.solrxml.location" , "zookeeper" ) ; System . setProperty ( "zkHost" , zkServer . getZkAddress ( ) ) ; jettys = new LinkedList < JettySolrRunner > ( ) ; for ( int i = 0 ; i < numServers ; ++ i ) { startJettySolrRunner ( hostContext , extraServlets , extraRequestFilters ) ; } }
" mini " solrcloud cluster to be used for testing
