DeployClient deployClient = new DeployClient(_miniCluster.getProtocol());
IndexState indexState = deployClient.addIndex(index.getName(), index.getParentFile().getAbsolutePath(), 1)
.joinDeployment();
assertEquals(IndexState.DEPLOYED, indexState);
ILuceneClient client = new LuceneClient(_miniCluster.getZkConfiguration());
final Query query = new QueryParser(Version.LUCENE_30, "", new KeywordAnalyzer()).parse(textFieldName + ": "
+ textFieldContent);
final Hits hits = client.search(query, new String[] { index.getName() }, 10);
assertNotNull(hits);
assertEquals(1, hits.getHits().size());
final Hit hit = hits.getHits().get(0);
final MapWritable details = client.getDetails(hit);
final Set<Writable> keySet = details.keySet();
assertEquals(1, keySet.size());
final Writable writable = details.get(new Text(binaryFieldName));
assertNotNull(writable);
assertThat(writable, instanceOf(BytesWritable.class));
BytesWritable bytesWritable = (BytesWritable) writable;
bytesWritable.setCapacity(bytesWritable.getLength());// getBytes() returns
// the full array
assertArrayEquals(bytesFieldContent, bytesWritable.getBytes());
client.close();
}