use of org.apache.solr.common.PushWriter in project lucene-solr by apache.
the class TestPushWriter method testStandardResponse.
public void testStandardResponse() throws IOException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
OutputStreamWriter osw = new OutputStreamWriter(baos, UTF_8);
PushWriter pw = new JSONWriter(osw, new LocalSolrQueryRequest(null, new ModifiableSolrParams()), new SolrQueryResponse());
writeData(pw);
osw.flush();
log.info(new String(baos.toByteArray(), "UTF-8"));
Map m = (Map) Utils.fromJSON(baos.toByteArray());
checkValues(m);
writeData(new JavaBinCodec(baos = new ByteArrayOutputStream(), null));
m = (Map) new JavaBinCodec().unmarshal(new ByteArrayInputStream(baos.toByteArray()));
checkValues(m);
}
Aggregations