Examples of processResponse()


Examples of org.apache.solr.client.solrj.impl.BinaryResponseParser.processResponse()

    try {
      BinaryResponseWriter writer = new BinaryResponseWriter();
      ByteArrayOutputStream bos = new ByteArrayOutputStream();
      writer.write( bos, req, rsp );
      BinaryResponseParser parser = new BinaryResponseParser();
      return parser.processResponse( new ByteArrayInputStream( bos.toByteArray() ), "UTF-8" );
    }
    catch( Exception ex ) {
      throw new RuntimeException( ex );
    }
  }
View Full Code Here

Examples of org.apache.solr.client.solrj.impl.XMLResponseParser.processResponse()

  public void testDateFacets() throws Exception   {
    XMLResponseParser parser = new XMLResponseParser();
    InputStream is = new SolrResourceLoader(null, null).openResource("sampleDateFacetResponse.xml");
    assertNotNull(is);
    Reader in = new InputStreamReader(is, "UTF-8");
    NamedList<Object> response = parser.processResponse(in);
    in.close();
   
    QueryResponse qr = new QueryResponse(response, null);
    Assert.assertNotNull(qr);
   
View Full Code Here

Examples of org.apache.solr.client.solrj.impl.XMLResponseParser.processResponse()

{
  public void testSimple() throws Exception {
    DocumentObjectBinder binder = new DocumentObjectBinder();
    XMLResponseParser parser = new XMLResponseParser();
    NamedList<Object> nl = null;
    nl = parser.processResponse(new StringReader(xml));
    QueryResponse res = new QueryResponse(nl, null);
    SolrDocumentList solDocList = res.getResults();
    List<Item> l = binder.getBeans(Item.class,res.getResults());
    Assert.assertEquals(solDocList.size(), l.size());
    Assert.assertEquals(solDocList.get(0).getFieldValue("features"), l.get(0).features);
View Full Code Here

Examples of org.apache.solr.client.solrj.impl.XMLResponseParser.processResponse()

  }

  public void testDynamicFieldBinding(){
    DocumentObjectBinder binder = new DocumentObjectBinder();
    XMLResponseParser parser = new XMLResponseParser();
    NamedList<Object> nl = parser.processResponse(new StringReader(xml));
    QueryResponse res = new QueryResponse(nl, null);
    List<Item> l = binder.getBeans(Item.class,res.getResults());
    Assert.assertArrayEquals(new String[]{"Mobile Store","iPod Store","CCTV Store"}, l.get(3).getAllSuppliers());
    Assert.assertTrue(l.get(3).supplier.containsKey("supplier_1"));
    Assert.assertTrue(l.get(3).supplier.containsKey("supplier_2"));
View Full Code Here

Examples of org.apache.solr.client.solrj.impl.XMLResponseParser.processResponse()

{
  public void testSimple() throws Exception {
    DocumentObjectBinder binder = new DocumentObjectBinder();
    XMLResponseParser parser = new XMLResponseParser();
    NamedList<Object> nl = null;
    nl = parser.processResponse(new StringReader(xml));
    QueryResponse res = new QueryResponse(nl, null);
    SolrDocumentList solDocList = res.getResults();
    List<Item> l = binder.getBeans(Item.class,res.getResults());
    Assert.assertEquals(solDocList.size(), l.size());
    Assert.assertEquals(solDocList.get(0).getFieldValue("features"), l.get(0).features);
View Full Code Here

Examples of org.apache.solr.client.solrj.impl.XMLResponseParser.processResponse()

  }

  public void testDynamicFieldBinding(){
    DocumentObjectBinder binder = new DocumentObjectBinder();
    XMLResponseParser parser = new XMLResponseParser();
    NamedList<Object> nl = parser.processResponse(new StringReader(xml));
    QueryResponse res = new QueryResponse(nl, null);
    List<Item> l = binder.getBeans(Item.class,res.getResults());
    Assert.assertArrayEquals(new String[]{"Mobile Store","iPod Store","CCTV Store"}, l.get(3).getAllSuppliers());
    Assert.assertTrue(l.get(3).supplier.containsKey("supplier_1"));
    Assert.assertTrue(l.get(3).supplier.containsKey("supplier_2"));
View Full Code Here

Examples of org.apache.solr.client.solrj.impl.XMLResponseParser.processResponse()

{
  public void testSimple() throws Exception {
    DocumentObjectBinder binder = new DocumentObjectBinder();
    XMLResponseParser parser = new XMLResponseParser();
    NamedList<Object> nl = null;
    nl = parser.processResponse(new StringReader(xml));
    QueryResponse res = new QueryResponse(nl, null);
    SolrDocumentList solDocList = res.getResults();
    List<Item> l = binder.getBeans(Item.class,res.getResults());
    Assert.assertEquals(solDocList.size(), l.size());
    Assert.assertEquals(solDocList.get(0).getFieldValue("features"), l.get(0).features);
View Full Code Here

Examples of org.apache.solr.client.solrj.impl.XMLResponseParser.processResponse()

  @Test
  public void testDateFacets() throws Exception   {
    XMLResponseParser parser = new XMLResponseParser();
    FileReader in = new FileReader("sampleDateFacetResponse.xml");
    assertTrue("in is null and it shouldn't be", in != null);
    NamedList<Object> response = parser.processResponse(in);
    in.close();
   
    QueryResponse qr = new QueryResponse(response, null);
    Assert.assertNotNull(qr);
   
View Full Code Here

Examples of org.apache.solr.client.solrj.impl.XMLResponseParser.processResponse()

  @SuppressWarnings("unchecked")
  @Test
  public void testSimple() throws Exception {
    XMLResponseParser parser = new XMLResponseParser();
    NamedList<Object> nl = parser.processResponse(new StringReader(xml));
    QueryResponse res = new QueryResponse(nl, null);

    SolrDocumentList solDocList = res.getResults();
    List<Item> l = getBeans(solDocList);
    Assert.assertEquals(solDocList.size(), l.size());
View Full Code Here

Examples of org.apache.solr.client.solrj.impl.XMLResponseParser.processResponse()

  }

  @Test
  public void testDynamicFieldBinding() {
    XMLResponseParser parser = new XMLResponseParser();
    NamedList<Object> nl = parser.processResponse(new StringReader(xml));
    QueryResponse res = new QueryResponse(nl, null);

    List<Item> l = getBeans(res.getResults());

    Item item = l.get(3);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.